- Node.js (18.x)
- NPM
- TypeScript, NestJS
- Git
- Redis, MongoDB
- Docker - Install Docker community edition
🎁 If you are a big fan of docker, just don't wait, clone the repository and use the following docker commands:
# to run with docker-compose.yml
docker-compose up
Let's clone the repository on your machine.
The application includes the following files and folders.
src
- code for the application written in TypeScript, NestJS, Express.js.cli
- node cli script which can be performed from terminal.test
- to test all the features.docker-compose.dev.yml
- to run in develoment mode.docker-compose.yml
- to run in production mode..env.example
- a sample of .env which can be helpful for configuration.
# architecture
# deep drive in src directory
src/
├── developer/
│ ├── dto/
│ │ ├── developer.dto.ts
│ │ └── index.ts
│ │
│ ├── schemas/
│ │ └── developer.schema.ts
│ │
│ ├── developer.controller.ts
│ ├── developer.module.ts
│ ├── developer.service.ts
│ └── in-memory-developer.service.ts
│
├── core/
│ ├── enums/
│ │ └── EDeveloper.ts
│ │
│ └── interfaces/
│ ├── IDeveloperService.ts
│ └── IService.ts
│
├── app.module.ts
└── main.ts
Let's move to the cloned directory with your terminal.
To install, build, and start the application for the first time, run the following commands in your shell using makefile
(only for macOS and Linux):
make install
Let's rename from .env.example
to .env
and make sure all the necessary information is correct:
PORT=3000
MONGODB_URI=<MongoDB_ATLAS_URI>
REDIS_URL=<REDIS_CLOUD_URL>
CACHE_TTL=180
Already done? Cool! You are almost ready to enjoy the app. ⛳️
make build
make start
# development mode
# with docker
make start-dev
# production mode
make start-prod
Oh! You wanna trigger testing for the application from terminal
# e2e test in production
make test
# e2e test development
make test-dev
make lint
make eslint
To learn more, you can use the following commands:
make help
npm i
npm run build
# run
npm run start
npm run start:dev
npm run start:prod
# production mode
npm run test:e2e
# development mode
npm run test:e2e:dev
# lint
npm run lint
npm run eslint
🎯 Have question about api endpoints? Please check out our details guide
- Author - Sazal Ahamed