Build production-ready serverless applications on AWS in minutes, not months.
Building enterprise-grade serverless applications on AWS is hard. You need to handle:
- Event sourcing and CQRS patterns
- Multi-tenancy and data isolation
- DynamoDB to RDS synchronization
- Sequence number generation
- Async task processing
- ...and much more
MBC CQRS Serverless provides all of this out of the box, so you can focus on your business logic.
| Feature | What You Get |
|---|---|
| Zero to API in 5 minutes | CLI generates complete project structure with best practices |
| Built-in Multi-tenancy | Data isolation, tenant settings, and RBAC out of the box |
| Event Sourcing | Full audit trail with DynamoDB Streams and automatic RDS sync |
| Local Development | Complete offline mode with Docker - no AWS costs during development |
| Production Ready | Battle-tested in enterprise SaaS applications |
# Install CLI
npm install -g @mbc-cqrs-serverless/cli
# Create new project
mbc new my-saas-app
# Start development
cd my-saas-app
npm install
npm run build # Build the project
npm run offline:docker # Start local AWS services
npm run migrate # Run database migrations
npm run offline:sls # Start API serverThat's it! Your API is running at http://localhost:4000
// todo.controller.ts
@Controller('api/todo')
export class TodoController {
constructor(
private readonly commandService: CommandService,
private readonly dataService: DataService,
) {}
@Post()
async create(@Body() dto: CreateTodoDto, @IInvoke() invokeContext: IInvoke) {
const command = new TodoCommandDto({
pk: dto.pk,
sk: dto.sk,
tenantCode: invokeContext.tenantCode,
name: dto.name,
attributes: { description: dto.description },
});
return this.commandService.publishSync(command, { invokeContext });
}
@Get(':pk/:sk')
async findOne(@Param('pk') pk: string, @Param('sk') sk: string) {
return this.dataService.getItem({ pk, sk });
}
}What happens automatically:
- Command is validated and persisted to DynamoDB
- Event is emitted via DynamoDB Streams
- Data is synced to RDS for complex queries
- Full audit trail is maintained
- Multi-tenant isolation is enforced
┌─────────────────────────────────────────────────────────────────────┐
│ Your Application │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ Client Request │
│ │ │
│ ▼ │
│ ┌─────────┐ ┌─────────┐ ┌──────────────┐ │
│ │ API │───▶│ Service │───▶│ CommandService│ │
│ │ Gateway │ │ Layer │ │ (Write) │ │
│ └─────────┘ └─────────┘ └──────────────┘ │
│ │ │ │
│ │ ▼ │
│ │ ┌──────────────┐ │
│ │ │ DynamoDB │──── Stream ───┐ │
│ │ │ (Commands) │ │ │
│ │ └──────────────┘ ▼ │
│ │ ┌──────────────┐│
│ ▼ │Step Functions││
│ ┌──────────────┐ └──────────────┘│
│ │ DataService │ │ │
│ │ (Read) │ ▼ │
│ └──────────────┘ ┌──────────────┐│
│ │ │ DynamoDB ││
│ ▼ │ (Data) ││
│ ┌──────────────┐ └──────────────┘│
│ │ RDS │◀──── Sync ───────────────────┘ │
│ │ (Query) │ │
│ └──────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────┘
| Package | Description | Version |
|---|---|---|
| @mbc-cqrs-serverless/core | Core CQRS framework with AWS integrations | |
| @mbc-cqrs-serverless/cli | CLI tool for project scaffolding | |
| @mbc-cqrs-serverless/tenant | Multi-tenancy support | |
| @mbc-cqrs-serverless/master | Master data and hierarchical settings | |
| @mbc-cqrs-serverless/sequence | Sequence number generation with rotation | |
| @mbc-cqrs-serverless/task | Async task processing and queue management | |
| @mbc-cqrs-serverless/import | Data import with CSV and REST support | |
| @mbc-cqrs-serverless/ui-setting | UI configuration management |
- CQRS Pattern - Clean separation of commands (writes) and queries (reads)
- Event Sourcing - Complete audit trail with immutable event log
- Optimistic Locking - Automatic conflict resolution for concurrent updates
- Lambda - Serverless compute with automatic scaling
- DynamoDB - Event store and data persistence
- RDS/Aurora - Complex queries with Prisma ORM
- Cognito - Authentication and authorization
- Step Functions - Workflow orchestration
- SNS/SQS - Event-driven messaging
- Multi-tenancy - Built-in tenant isolation and settings hierarchy
- Sequence Generation - Auto-incrementing IDs with date rotation
- Master Data - Centralized configuration management
- Async Tasks - Background job processing with retries
- Full TypeScript - Type-safe development with excellent IDE support
- NestJS Foundation - Familiar patterns and dependency injection
- Local Development - Complete offline mode with Docker
- CLI Tools - Project scaffolding and code generation
Check out our sample repository for complete working examples:
| Example | Description |
|---|---|
| step-01-setup | Environment setup |
| step-02-create | Create operations with CommandService |
| step-03-rds-sync | DynamoDB to RDS synchronization |
| step-04-read | Read operations with DataService |
| step-05-search | Search with Prisma/RDS |
| step-06-update-delete | Update and soft delete |
| step-07-sequence | Sequence number generation |
| complete/basic | Full CRUD implementation |
Visit our documentation site for:
npm install -g @mbc-cqrs-serverless/clinpm install -g @mbc-cqrs-serverless/cli@betanpm install -g @mbc-cqrs-serverless/cli@1.0.17We welcome contributions! Please see our Contributing Guide for details.
# Clone the repository
git clone https://github.com/mbc-net/mbc-cqrs-serverless.git
# Install dependencies
npm install
# Build all packages
npm run build
# Run tests
npm test- Fork the repository
- Create a feature branch from
develop - Make your changes with tests
- Submit a pull request
- GitHub Issues - Bug reports and feature requests
- GitHub Discussions - Questions and discussions
- Changelog - Release notes
Copyright © 2024-2025, Murakami Business Consulting, Inc.
This project is licensed under the MIT License.
Get Started Now | View Examples | Read the Docs
Made with love for the serverless community

