Skip to content

serverless applications with CQRS on AWS, NestJS and local development

Notifications You must be signed in to change notification settings

mbc-net/mbc-cqrs-serverless

Repository files navigation

MBC CQRS serverless framework

Unleash the power of scalable, resilient serverless applications with CQRS on AWS, the magic of NestJS and the convenience of local development workflows! ✨

Overview

This package provides core functionalities for implementing the Command Query Responsibility Segregation (CQRS) pattern within AWS serverless architectures, powered by the incredible NestJS framework. It simplifies the development of highly scalable and decoupled systems that can handle complex business logic and high-volume data processing.

Features

  • CQRS framework for AWS serverless:
    • Structured approach for separating commands and queries
    • Integration with AWS services like Cognito, API Gateway, Lambda, DynamoDB, SNS, and SQS, StepFuction, RDS ⚡
  • Event-driven architecture:
    • Leverages event sourcing and messaging for asynchronous communication
    • Enables loose coupling and independent scaling of components
  • Command and query handlers:
    • Provides abstractions for handling commands and queries
    • Facilitates business logic implementation and data persistence
  • Asynchronous communication:
    • Supports event publishing and message passing for inter-component communication
  • Data consistency and integrity:
    • Ensures data consistency through event sourcing and optimistic locking
    • Enforces data integrity with validation and constraints
  • Experience a harmonious symphony of CQRS and NestJS:
    • Modular structure: Organize CQRS components with NestJS's elegant modularity
    • Dependency injection: Simplify dependency management and embrace loose coupling with NestJS's DI system
    • TypeScript support: Write type-safe, crystal-clear code with built-in TypeScript
    • Testing and error handling: Build confidence with comprehensive testing and robust error handling, courtesy of NestJS
    • Ecosystem compatibility: Tap into the vast NestJS universe of modules and libraries to expand possibilities

Local Development Symphony

  • Embrace agility: Experience rapid iteration and experimentation in a local environment, without the need for constant cloud deployment.
  • Debugging bliss: Debug with ease using your favorite tools and techniques, gaining deeper insights into your application's behavior.
  • Cost-effective exploration: Explore and refine your CQRS implementation locally, without incurring AWS costs during development.

Installation

$ npm i -g @mbc-cqrs-severless/cli

Usage

  • Create a new application
$ mbc new YOUR_PROJECT_NAME

Examples

Architecture

  • TODO

How to guide

  • TODO

Contributing

  • Add new packages by
$ npm init --scope mbc-cqrs-severless -w ./packages/{PACKAGE_NAME}
  • Build packages
$ npm run build
  • Publish packages
$ npm run release

References