Overview
The NestJS + MongoDB API boilerplate is a REST API template built using NestJS and MongoDB. It provides a solid foundation for developing scalable and efficient APIs. With features like a sample resource, health route, linting, unit tests, CI workflow, custom JSON logger, env configuration system, OpenAPI spec, and Conventional commits spec, this boilerplate offers a comprehensive set of tools and functionalities to jumpstart your API development.
Features
- Sample resource ("instrument"): The boilerplate includes a sample resource called "instrument" which can be used as a starting point for building out your API endpoints.
- Health route: Provides a built-in health route to check the status of the API and ensure it is running smoothly.
- Linting: Includes an ESLint linter with the popular Airbnb style guide to maintain code quality and enforce best practices.
- Unit tests: Comes with a testing framework using Jest to write and run unit tests for your API endpoints.
- CI workflow: Offers an automated CI workflow using GitHub Actions to ensure that your code passes all the tests and builds successfully.
- Custom JSON logger: Features a custom JSON logger powered by Winston for easy and structured logging of API events.
- Env configuration system: Provides an environment configuration system to manage different configurations for different environments (e.g., development, production, staging).
- OpenAPI spec: Allows for generating an OpenAPI spec for your API, making it easier to document and visualize the API endpoints.
- Conventional commits spec: Follows the Conventional commits specification, ensuring consistent and standardized commit messages.
Summary
The NestJS + MongoDB API boilerplate provides a robust foundation for building REST APIs using NestJS and MongoDB. With its extensive set of features, including sample resource, health route, linting, unit tests, CI workflow, custom JSON logger, env configuration system, OpenAPI spec, and Conventional commits spec, you can accelerate your API development process while maintaining code quality and best practices. Tested with multiple Node.js versions and offering automated CI test runs, this boilerplate ensures a reliable and efficient API development experience.