Skip to content
/ nest-starter Public template

Production grade nest js starter Boilerplate project designed to kickstart the development of a Nest.js application with a focus on production-level quality, performance, and best practices.

Notifications You must be signed in to change notification settings

losefor/nest-starter

Repository files navigation

Getting Started with Nest.js

Welcome to your journey with Nest.js! This README provides an overview of how to set up a production-grade Nest.js application using some of the best tools and libraries available.

Prerequisites

Before you begin, ensure you have the following prerequisites installed:

  • Node.js (v14 or later)
  • npm or Yarn

Installation

  1. Clone this repository:
   git clone https://github.com/losefor/nest-starter
   cd nest-starter

2.Install dependencies:

npm install
# or
yarn install

features

ERD (Auto generated)

Auto generated erd

Versioning

Versioning, especially in the context of software development and APIs, brings several benefits that contribute to efficient collaboration, compatibility, and overall project management

Production-Grade Tools and Libraries

To ensure the reliability, security, and performance of our Nest.js application in production, we should use the following tools and libraries:

  • express: The foundation of Nest.js, providing a fast and minimalist web framework.
  • helmet: Enhances security by setting appropriate HTTP headers.
  • morgan: Logs incoming requests and responses for debugging and monitoring.
  • class-validator: Data validation and sanitization to prevent vulnerabilities.
  • passport.js: Authentication middleware with support for various strategies.
  • cors: Middleware to handle Cross-Origin Resource Sharing.
  • pino: Logging libraries for structured and customizable logs.
  • prisma: A powerful Object-Relational Mapping library for database interactions.
  • Memcached: In-memory caching solutions for improved performance.
  • nodemailer: Sending emails, useful for features like password resets.
    • Setup template system
  • pm2: Process manager for monitoring, restarting, and load balancing.
  • helmet: Content Security Policy middleware to prevent XSS attacks.
  • jest: Testing frameworks for unit and integration tests.
  • supertest: Library for testing HTTP requests and responses.
  • eslint: Static code analysis tool for code quality checks.
  • prettier: Code formatting tool for maintaining consistent styles.
  • swagger: Documenting your API endpoints for easy consumption.
    • security auth before entering swagger
  • i18n: Localization functionality.
  • sharp: Image manipulation library used for image optimization
  • @casl/ability: ACL authorization
    • Cache ability instance for recent active users
  • husky: Set up git hooks
  • multer: Multipart handler to upload files
    • Digital ocean upload files
    • Maintenance and Cleanup - Implement a routine to clean up unused or expired images from your storage solution. Set up cron jobs or background tasks to perform this cleanup.
    • Monitoring and Logging - Set up monitoring and logging to track image-related activities, including uploads, retrievals, and errors. Monitoring helps you identify and address performance issues or anomalies.
  • docker: Docker image for the app

Contributing

Contributions are welcome! If you find any issues or have improvements to suggest, feel free to open a pull request.

Happy coding!

About

Production grade nest js starter Boilerplate project designed to kickstart the development of a Nest.js application with a focus on production-level quality, performance, and best practices.

Topics

Resources

Stars

Watchers

Forks