Overview:
This product is an opinionated starter pack for developing applications using NestJS and TypeScript. It includes a variety of features and configurations to help developers get started quickly and efficiently. Some of the key features include hot reloading, testing with Jest, Firebase authentication setup, Docker support, AWS SDK integration, rate limiting, OpenAPI/Swagger setup, data validation, global exception handlers, and MongoDB integration.
Features:
- Hot Reloading: Provides the ability to instantly see code changes without having to manually restart the server.
- Testing with Jest: Comes pre-configured with Jest for unit testing.
- Starter User Mongoose Schema: Provides a ready-to-use User schema along with a get/create endpoint that utilizes Firebase user data.
- JSON Based Config Setup: Allows for easy configuration through a JSON file (Sample config available at config.json).
- JSON Based Logging Setup: Logs can be configured using JSON format, utilizing the Pino library.
- Per Request UUID Logging: Generates a UUID for each request, making it easier to trace and debug the logs.
- Docker Setup: Includes a Docker configuration to facilitate containerization of the application.
- Firebase Auth Setup: Provides integration with Firebase authentication along with decorators that can be used at the endpoint level.
- Sample Module Setup (Health Check): Includes a sample module (health-check) with unit testing on the service and a sample end-to-end test.
- AWS SDK Integration: Includes integration with the AWS SDK and provides a sample S3 client as a starting point.
- Rate Limiting: Includes pre-configured rate limiting that restricts each IP to 100 requests per 15 minutes using express-rate-limit.
- OpenAPI/Swagger Setup: Includes setup for generating OpenAPI/Swagger documentation using the @nestjs/swagger module.
- Data Validation: Utilizes class-validator for data validation.
- Global Exception Handlers: Captures ServerErrors and responds to clients with corresponding error messages from errorCodes.json.
- Connected to MongoDB: Uses the @nestjs/mongoose package to connect to MongoDB using the URL specified in the configuration.
- Codebuild Configuration Setup: Provides a Codebuild configuration for build purposes, utilizing a buildspec.yml file and an environment variable for retrieving the config.json from an S3 bucket.
- Procfile Setup for Elastic Beanstalk: Includes a Procfile for Elastic Beanstalk to start the NestJS node process at port 8080.
- Pre-commit Hook: Runs TypeScript compilation and Prettier formatting as a pre-commit hook.
Summary:
This opinionated NestJS Typescript starter pack provides a comprehensive set of features and configurations to kickstart development with NestJS and TypeScript. It offers ready-to-use functionalities like user authentication, logging, database integration, testing, Docker support, AWS SDK integration, rate limiting, OpenAPI/Swagger documentation generation, and more. The installation process is straightforward, and developers can start building their applications quickly and efficiently.