Node.js Domain-Driven Design Boilerplate with TypeScript for Back-End.
- Check the logs;
- Test the dependencies and execution locally;
- Run automated tests;
- If necessary, merge with a hotfix on git;
- Rebuild the project and restart the service;
Nest Modules Graph and Classes
- JavaScript: Web programming laguage;
- TypeScript: JavaScript superset for typing;
- Node.js: JavaScript runtime;
- Nest.js: TypeScript Framework for Back-End;
- Express: Robust tooling for HTTP servers;
- Socket.io: WebSocket library;
- AWS-SDK: A Node.js SDK to access AWS resources, such as:
- SQS: Queue management service;
- SNS: Topic notification service;
- S3: Files storage service;
- Cognito: Users authenticator service;
- Sequelize: ORM for relational databases;
- PostgreSQL: Relational (SQL) database;
- MongoDB: Schematic and document-oriented NoSQL database;
- Redis: Cache and in-memory key-value NoSQL database;
- Docker: Services isolation and process resources management with containers;
- SonarQube: Test coverage and code quality analyzer;
- Winston: Custom logger with transports;
- Joi: Schema validator library;
- EsLint: JavaScript/TypeScript linter;
- Prettier: JavaScript/TypeScript formatter;
- Jest: Testing Framework;
- Huksy: Git hook-listenner used to check tests, format the code and the commits;
- Install project dependencies
yarn install
-
Install AWS CLI
AWS CLI -
Configure AWS CLI
$ aws configure
> AWS Access Key ID [****]: mock
> AWS Secret Access Key [****]: mock
> Default region name [us-east-1]: us-east-1
> Default output format [table]: json
- Start Docker containers;
- Mock external services;
- Creat database entities and populat registers;
- Start HTTP REST API & GraphQl API;
- Start TCP WebSocket;
- Send message to Queue;
- Receive message from Queue;
- Copy dotenv file
cp env/.env.development.local ./.env # copy development local example
source ./.env # load envs on shell session
- Initialize the composefile (
docker-compose.yml
) available on project root folder.
docker-compose up -d cloud database data cache # create and run all docker containers in background
yarn run migrate && yarn run seed # create database entities and populate database registers
yarn run mock-dependencies # create message queue and storager and start external services mock
yarn run start:dev # start application in development mode
yarn run receive-messages # create websocket client and start connection to receive events
yarn run send-message # send event message to queue
- localhost:3000 - Application Interface (API)
/
- WebSocket Root Endpoint/api
- REST Root Endpoint/api/docs
- Swagger API Documentation (Page)/api/docs.json
- Swagger API Documentation (JSON)/api/docs.yml
- Swagger API Documentation (YAML)
/graphql
- GraphQL Endpoint
- localhost:4000 - Mocked Service Page
- localhost:8000 - Nest.js DevTools Page
- localhost:8080 - Adminer Page
- localhost:8081 - Mongo Express Page
- localhost:8082 - Redis Commander Page
- localhost:8083 - Jenkins Page
- localhost:9000 - SonarQube Page
- Packaging
- Infra Utils Lib Package
- SQL
- UUID Fields
- Manual Queries
- Index
- Transactions
- Clustering
- Clusters
- Kubernetes
- Load Balancing
- Kubernetes
- Clusters
- CI/CD
- Jenkins
- GitHub Actions
- Deployment
- Heroku
- Nest.js
- Integrations
- OAuth
- PIX
- Kafka
- Tests
- Integration
- Configs
- Modules
- Core
- Infra
- Cron Tasks
- Logging
- Infra
- API
- Guards
- Pipes
- Schemas
- Events
- Queue Handler
- Handlers Schemas
- Websocket Guards
- Websocket Server
- Websocket Client
- Queue Handler
- Core
- End-to-End
- Modules
- Core
- Infra
- Database
- Data
- Cache
- Integration
- AWS
- REST
- Cron Jobs
- Start
- Infra
- API
- Controllers
- App
- Repositories
- Events
- Queue Consumer
- Queue Producer
- Websocket Gateway
- Reports
- Services
- Core
- Modules
- Integration