Skip to content

🌟 Node.js Production Setup Template This repository serves as a template for creating robust and production-ready Node.js applications. It incorporates best practices, essential tools, and modern development workflows to streamline your project setup!

Notifications You must be signed in to change notification settings

mohansahu18/nodejs-production-template

Repository files navigation

🌟 Node.js Production Setup Template

This repository serves as a template for creating robust and production-ready Node.js applications. It includes essential tools, best practices, and modern development workflows to help you kickstart your projects.

πŸš€ Features

  • πŸ—‚οΈ MVC Architecture: Organized folder structure for maintainability and scalability.
  • πŸ› οΈ Tool Integration: Pre-configured with Git, Husky, Prettier, and Commitlint for consistent and high-quality code.
  • 🌐 Environment Management: Efficient handling of development and production environments.
  • πŸ”’ Security Best Practices: Built-in measures to safeguard your app against vulnerabilities.
  • πŸ“ˆ Error Logging & Monitoring: Tools for tracking issues and maintaining application health.
  • 🐳 Docker Integration: Containerization support for modern deployment workflows.

πŸ“‚ Folder Structure

πŸ“ project-root
β”œβ”€β”€ πŸ“ .husky                 # Git hooks for enforcing code quality
β”œβ”€β”€ πŸ“ dist                   # Compiled output files
β”œβ”€β”€ πŸ“ docker                 # Docker-related configurations
β”œβ”€β”€ πŸ“ logs                   # Application log files
β”œβ”€β”€ πŸ“ migrations             # Database migration scripts
β”œβ”€β”€ πŸ“ node_modules           # Installed dependencies
β”œβ”€β”€ πŸ“ public                 # Static files
β”œβ”€β”€ πŸ“ script                 # Utility scripts
β”œβ”€β”€ πŸ“ src
β”‚   β”œβ”€β”€ πŸ“ config             # Configuration and environment variables
β”‚   β”œβ”€β”€ πŸ“ constant           # Constants used throughout the application
β”‚   β”œβ”€β”€ πŸ“ controller         # API request controllers
β”‚   β”œβ”€β”€ πŸ“ middleware         # Middleware for handling requests and errors
β”‚   β”œβ”€β”€ πŸ“ model              # Database models
β”‚   β”œβ”€β”€ πŸ“ router             # Route definitions
β”‚   β”œβ”€β”€ πŸ“ services           # Business logic and reusable services
β”‚   β”œβ”€β”€ πŸ“ types              # Type definitions for TypeScript
β”‚   └── πŸ“ util               # Utility functions for logging, error handling, etc.
β”‚   β”œβ”€β”€ πŸ“ app.ts             # Main application setup
β”‚   └── πŸ“ server.ts          # Entry point for starting the server
β”œβ”€β”€ πŸ“ .dockerignore          # Files to exclude from Docker builds
β”œβ”€β”€ πŸ“ .env.development       # Environment variables for development
β”œβ”€β”€ πŸ“ .env.example           # Example environment variables
β”œβ”€β”€ πŸ“ .env.production        # Environment variables for production
β”œβ”€β”€ πŸ“ .gitignore             # Ignored files for Git
β”œβ”€β”€ πŸ“ commitlint.config.js   # Commit linting rules
β”œβ”€β”€ πŸ“ ecosystem.config.js    # PM2 configuration for process management
β”œβ”€β”€ πŸ“ eslint.config.mjs      # ESLint configuration file
β”œβ”€β”€ πŸ“ nodemon.json           # Nodemon configuration for development
β”œβ”€β”€ πŸ“ package-lock.json      # Lock file for dependencies
β”œβ”€β”€ πŸ“ package.json           # Project metadata and dependencies
β”œβ”€β”€ πŸ“ README.md              # Documentation
└── πŸ“ tsconfig.json          # TypeScript configuration

About

🌟 Node.js Production Setup Template This repository serves as a template for creating robust and production-ready Node.js applications. It incorporates best practices, essential tools, and modern development workflows to streamline your project setup!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published