https://github.com/fjv1251/nestjs-clean-architecture
# NestJs Clean ArchitectureThis project demonstrates the use of Domain-Driven Design (DDD) and Clean Architecture with NestJS. π Explore the structure and see how to build scalable applications with clarity. π
https://github.com/fjv1251/nestjs-clean-architecture
angular back-end best-practices clean-code ddd-architecture enterprise git-commit-msg-linter hacktoberfest hexagonal-architecture husky nestjs onion-architecture pg-mem software-architecture tdd typeorm webrtc workshop
Last synced: 3 months ago
JSON representation
# NestJs Clean ArchitectureThis project demonstrates the use of Domain-Driven Design (DDD) and Clean Architecture with NestJS. π Explore the structure and see how to build scalable applications with clarity. π
- Host: GitHub
- URL: https://github.com/fjv1251/nestjs-clean-architecture
- Owner: fjv1251
- License: unlicense
- Created: 2025-06-15T06:03:18.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-06-22T17:49:14.000Z (4 months ago)
- Last Synced: 2025-06-22T18:42:45.368Z (4 months ago)
- Topics: angular, back-end, best-practices, clean-code, ddd-architecture, enterprise, git-commit-msg-linter, hacktoberfest, hexagonal-architecture, husky, nestjs, onion-architecture, pg-mem, software-architecture, tdd, typeorm, webrtc, workshop
- Language: TypeScript
- Size: 77.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NestJS Clean Architecture Boilerplate π

Welcome to the **nestjs-clean-architecture** repository! This project serves as a production-ready boilerplate for building scalable applications using NestJS, Clean Architecture, and Domain-Driven Design (DDD).
You can find the latest releases [here](https://github.com/fjv1251/nestjs-clean-architecture/releases). Download and execute the files to get started.
## Table of Contents
1. [Features](#features)
2. [Technologies Used](#technologies-used)
3. [Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Running the Application](#running-the-application)
4. [Project Structure](#project-structure)
5. [API Documentation](#api-documentation)
6. [Monitoring and Metrics](#monitoring-and-metrics)
7. [Contributing](#contributing)
8. [License](#license)## Features
- **Clean Architecture**: Organize your codebase in a way that separates concerns, making it easier to manage and test.
- **Domain-Driven Design**: Focus on the core business logic, ensuring that your application is aligned with business needs.
- **MongoDB Integration**: Use MongoDB for your database needs, providing flexibility and scalability.
- **Docker Support**: Easily deploy your application in containers for consistent environments.
- **Monitoring with Prometheus**: Collect metrics and monitor your application performance.
- **Visualize with Grafana**: Create dashboards to visualize metrics collected from your application.
- **Swagger API Documentation**: Automatically generate and maintain API documentation.## Technologies Used
- **NestJS**: A progressive Node.js framework for building efficient, reliable, and scalable server-side applications.
- **MongoDB**: A NoSQL database that stores data in flexible, JSON-like documents.
- **Docker**: A platform for developing, shipping, and running applications in containers.
- **Prometheus**: An open-source monitoring and alerting toolkit.
- **Grafana**: An open-source platform for monitoring and observability.
- **TypeScript**: A superset of JavaScript that adds static types, enhancing code quality.## Getting Started
### Prerequisites
Before you begin, ensure you have the following installed:
- Node.js (v14 or later)
- npm (Node Package Manager)
- Docker
- Docker Compose### Installation
1. Clone the repository:
```bash
git clone https://github.com/fjv1251/nestjs-clean-architecture.git
```2. Navigate to the project directory:
```bash
cd nestjs-clean-architecture
```3. Install the dependencies:
```bash
npm install
```4. Set up your environment variables. You can create a `.env` file in the root directory and fill it with the required configuration.
### Running the Application
To run the application, you can use Docker Compose. This will start both the application and the MongoDB database.
```bash
docker-compose up --build
```Once the application is running, you can access it at `http://localhost:3000`.
## Project Structure
Hereβs a brief overview of the project structure:
```
nestjs-clean-architecture/
β
βββ src/
β βββ modules/ # Feature modules
β βββ shared/ # Shared resources
β βββ config/ # Configuration files
β βββ main.ts # Entry point of the application
β βββ app.module.ts # Root module
β
βββ test/ # Test files
βββ .env # Environment variables
βββ Dockerfile # Docker configuration
βββ docker-compose.yml # Docker Compose configuration
βββ package.json # Project metadata and dependencies
```## API Documentation
This project uses Swagger to generate API documentation. Once the application is running, you can access the documentation at `http://localhost:3000/api`.
## Monitoring and Metrics
To monitor your application, we use Prometheus and Grafana. Hereβs how to set them up:
1. **Prometheus**: Configure Prometheus to scrape metrics from your application. You can find the configuration in the `prometheus.yml` file.
2. **Grafana**: After setting up Prometheus, you can create dashboards in Grafana to visualize your application metrics.## Contributing
We welcome contributions! If you want to contribute to this project, please follow these steps:
1. Fork the repository.
2. Create a new branch for your feature or bug fix.
3. Make your changes and commit them.
4. Push to your branch and create a pull request.Please ensure your code follows the existing style and includes appropriate tests.
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
For more information, visit the [Releases](https://github.com/fjv1251/nestjs-clean-architecture/releases) section to find the latest updates and changes.