atlas-cli / nestjs-boilerplate

NestJs Modular Monolith with AWS Lambda and CDK
19 stars 5 forks source link
api-gateway auth aws aws-lambda cdk devops docker esbuild iac lambda nestjs oidc postgres rds rds-data-api serverless swagger typeorm typescript

NestJS and PostgreSQL on AWS using CDK

Quality gate CircleCI

Description

Provide a robust backend solution leveraging NestJS with PostgreSQL on AWS infrastructure orchestrated with CDK (Cloud Development Kit). Employing a combination of AWS Lambda, Relational Database Service (RDS), RDS Proxy, CloudFormation, and CDK, this project ensures continuous deployment and management of your backend architecture using Infrastructure as Code (IAC) principles. Leverage the scalability, reliability, and flexibility of AWS services while maintaining efficient development workflows with CDK's programmable infrastructure approach.

Table of Contents

Features

Quick run

git clone --depth 1 https://github.com/atlas-cli/nestjs-boilerplate.git my-app
cd my-app/
cp .env.example .env
docker compose up -d

For check status run

docker compose logs

Comfortable development

git clone --depth 1 https://github.com/atlas-cli/nestjs-boilerplate.git my-app
cd my-app/
cp env.example .env

Run all using in docker compose:

docker compose up

Local use: localhost in host Inside a docker use: postgres host

npm install

npm run migration:run

npm run seed:run

npm run start:dev

Links

Database utils

Generate migration

npm run migration:generate -- src/database/migrations/CreateNameTable 

Run migration

npm run migration:run

Revert migration

npm run migration:revert

Drop all tables in database

npm run schema:drop

Run seed

npm run seed:run

Tests

# unit tests
npm run test

# e2e tests
npm run test:e2e

Inspirations:

https://github.com/brocoders/nestjs-boilerplate https://github.com/NeoSOFT-Technologies/rest-node-nestjs