This is a complete production ready project to learn modern techniques and approaches to build a performant and secure backend API services. It is designed for web apps, mobile apps, and other API services.
- NestJS
- Express Node
- Typescript
- Mongoose
- Mongodb
- Redis
- JsonWebToken
- Jest
- Docker
- Multer
- API key support
- Token based Authentication
- Role based Authorization
- Database dump auto setup
- vscode template support
- Unit Tests
- Integration Tests
- 75% plus Test Coverage
- Clean and modular codebase
A few things are added to aid the learning process
- disk submodule is added to provide images
- database dump is added to seed the database
WhereIsMyMotivation is a concept where you see videos and quotes that can inspire you everyday. You will get information on great personalities and make them your perceived mentors. You can also subscribe to topics of your interests.
You can track your happiness level and write down daily journals. You can also share things of interest from web to store in your motivation box.
Using this app can bring a little bit of happiness and energy to live an inspired life.
Mastering NestJS — Building an Effective REST API Backend
The Android App using this backend is also open-sourced. You can find the project here: Modern Android Development - WhereIsMyMotivation
vscode is the recommended editor - dark theme
# clone repository recursively
git clone https://github.com/unusualcodeorg/wimm-node-app.git --recursive
$ npm install
- Install Docker and Docker Compose. Find Instructions Here.
# install and start docker containers
docker-compose up --build
- You will be able to access the api from http://localhost:3000
docker exec -t tester npm run test:cov
If having any issue
- Make sure 3000 port is not occupied else change PORT in .env file.
- Make sure 27017 port is not occupied else change DB_PORT in .env file.
- Make sure 6379 port is not occupied else change REDIS_PORT in .env file.
Change the following hosts in the .env and .env.test
- DB_HOST=localhost
- REDIS_HOST=localhost
Best way to run this project is to use the vscode Run and Debug
button. Scripts are available for debugging and template generation on vscode.
$ npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
If you want to use plain Express.js to create the same project explore the Minimalistic version of this project
Minimalistic Backend Development - WhereIsMyMotivation
- Support it by clicking the ⭐ button on the upper right of this page. ✌️
Subscribe to the YouTube channel UnusualCode
for understanding the concepts used in this project:
Please feel free to fork it and open a PR.