Skip to content

nestjs-mongodb-boilerplate is a modern backend boilerplate built with NestJS v10.x, featuring a Repository Design Pattern, and MongoDB integration using Mongoose. This template is designed for scalability, maintainability, and ease of use, with built-in support for containerization and essential backend features.

License

Notifications You must be signed in to change notification settings

niksbanna/nestjs-mongodb-boilerplate

NestJS-MongoDB Boilerplate

CI Docker CodeQL License: MIT

Description

This repository provides a boilerplate for starting a project with the NestJS framework and MongoDB. It includes the basic setup and configuration needed to quickly start developing a server-side application.

Features

  • NestJS Framework: A progressive Node.js framework for building efficient and scalable server-side applications.
  • MongoDB: A source-available cross-platform document-oriented database program.
  • Docker: Use Docker to containerize your application and its environment.
  • Docker Compose: Easily manage your application services.

Installation

Before you start, ensure you have Docker and Docker Compose installed on your machine.

# Clone the repository
$ git clone https://github.com/niksbanna/nestjs-mongodb-boilerplate.git

# Go to the project directory
$ cd nestjs-mongodb-boilerplate

# Start the project
$ docker-compose up

Usage

Once the application is up and running, you can access the Swagger API documentation at http://localhost:9001/api/docs.

Contributing

Contributions are welcome! Please see our Contributing Guide for more details on how to get started.

Before contributing, please read our Code of Conduct.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Stay in Touch

Support

This project is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Resources

  • Visit the NestJS Documentation to learn more about the framework.
  • For questions and support, please visit our Discord channel.
  • To dive deeper and get more hands-on experience, check out our official video courses.
  • Deploy your application to AWS with the help of NestJS Mau in just a few clicks.
  • Visualize your application graph and interact with the NestJS application in real-time using NestJS Devtools.
  • Need help with your project (part-time to full-time)? Check out our official enterprise support.
  • To stay in the loop and get updates, follow us on X and LinkedIn.

Deployment

When you're ready to deploy your NestJS application to production, there are some key steps you can take to ensure it runs as efficiently as possible. Check out the deployment documentation for more information.

Compile and Run the Project

# development
$ yarn run start

# watch mode
$ yarn run start:dev

# production mode
$ yarn run start:prod

Project Setup

$ yarn install

Run Tests

# unit tests
$ yarn run test

# e2e tests
$ yarn run test:e2e

# test coverage
$ yarn run test:cov

File Structure

The project follows the standard NestJS directory structure:

  • src/: Contains the source code of the application.
  • test/: Contains the tests for the application.
  • docker-compose.yml: Docker Compose file to start the application and MongoDB service.
  • package.json: Contains the dependencies and scripts for the application.

Conclusion

This boilerplate provides a solid foundation for building a NestJS application with MongoDB. It includes all the necessary configurations and scripts to get started quickly. Whether you are a beginner or an experienced developer, this boilerplate can help you save time and focus on building your application.

About

nestjs-mongodb-boilerplate is a modern backend boilerplate built with NestJS v10.x, featuring a Repository Design Pattern, and MongoDB integration using Mongoose. This template is designed for scalability, maintainability, and ease of use, with built-in support for containerization and essential backend features.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •