Skip to main content

Project structure

MBC CQRS serverless Project Structure

This page provides an overview of the project structure of a mbc-cqrs-serverless application. It covers top-level files and folders, configuration files.

Top-level folders

Top-level folders are used to organize your application's code, infrastructure for local development, data migration, and testing.

infra-localInfrastructure runs in a local environment
prismaConfiguration for your Prisma ORM and dynamoDB table
srcApplication source folder
testConfiguration for e2e Jest testing and manual API tests

Top-level files

Top-level files are used to configure your application, manage dependencies, and define environment variables.

.envEnvironment variables
.env.localLocal environment variables
.eslintrc.jsConfiguration file for ESLint
.gitignoreSpecifies files and directories that Git should ignore
.prettierrcConfigure Prettier's code formatting rules
jest.config.jsConfiguration for Jest testing
nest-cli.jsonNest.js plugins configuration
package-lock.jsonLockfile that holds information on the dependencies installed
package.jsonProject dependencies and scripts
README.mdInformation about a project, including its description, installation instruction, and usage guidelines
tsconfig.build.jsonConfiguration TypeScript compiler options
tsconfig.jsonConfiguration file for TypeScript

Application module conventions

The following file conventions are used to define new module in src folder.

folder
dtofolderDefine the DTO (Data Transfer Object) schema. A DTO is an object that defines how the data will be sent over the network.
entitiesfolderDefine the business object.
handlerfolderDefine the data sync handler classes.
[name].service.tsfileDefine business logics.
[name].controller.tsfileDefine a controller.
[name].module.tsfileOrganizes code relevant for a specific feature, keeping code organized and establishing clear boundaries.