Skip to content

This repository is a starter template that includes pre-configured ESLint, Prettier, Docker, and other essential settings for initializing new projects with the NestJS framework.

License

Notifications You must be signed in to change notification settings

laerthe-souza/nestjs-starter-template

Repository files navigation

🚀 NestJS Project Template

NestJS TypeScript Docker VS Code ESLint Prettier Vitest Commitlint Husky

📖 Description

This repository provides a robust and well-structured base template for projects developed with the NestJS framework. It follows best practices for modularity, maintainability, and scalability, ensuring an optimal development experience.

🛠 Technologies Used

  • 🚀 NestJS - A progressive Node.js framework for building efficient and scalable server-side applications.
  • TypeScript - A strongly typed programming language that builds on JavaScript.
  • 🐳 Docker & Docker Compose - Used to containerize the application for easy deployment and development.
  • 🎨 ESLint & Prettier - Ensures consistent code formatting and best practices.
  • 🧪 Vitest - A fast testing framework for unit and integration tests.
  • 🖥 DevContainers (VS Code) - Provides an isolated development environment.
  • 🔄 Commitlint - Enforces consistent commit message conventions.
  • 🐶 Husky - Automates Git hooks for improved development workflow.

🏗 Running the Project Locally

  1. Ensure you have Node.js and Yarn installed on your system.
  2. Install dependencies:
    yarn install
  3. Copy the environment file and configure it:
    cp .env.example .env
  4. Start the application in development mode:
    yarn start:dev
  5. The application will be available at:
    http://localhost:3000
    

🐳 Running with Docker-Compose

  1. Ensure Docker and Docker Compose are installed on your system.
  2. Build and start the services:
    docker-compose up --build
  3. Access the container shell:
    docker exec -it <container_id> sh
  4. Inside the container, start the application:
    yarn start:dev
  5. The application will be available at:
    http://localhost:${PORT}
    
  6. To stop and remove containers:
    docker-compose down

🏗 Running with DevContainers (VS Code)

  1. Install the Dev Containers extension in Visual Studio Code.
  2. Ensure Docker is installed and running on your system.
  3. Open the project in VS Code and select Reopen in Container when prompted.
  4. The containerized development environment will be automatically set up.
  5. Run commands inside the container terminal as you would locally:
    yarn start:dev
    yarn test:dev
  6. The environment ensures consistency across different development setups.

🙏 Acknowledgment

Thank you for using this template! Your feedback and suggestions are highly appreciated. If you find this project useful, feel free to give it a star ⭐ and share it with others.

📝 License

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

🚀 Happy coding!

About

This repository is a starter template that includes pre-configured ESLint, Prettier, Docker, and other essential settings for initializing new projects with the NestJS framework.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published