Back to projects
Nov 13, 2023
3 min read

NP Backend

Backend for New Product

This backend, developed with NestJS, leverages a microservices architecture featuring an API Gateway that orchestrates communication between independent services via RabbitMQ messaging. The modular design was strategically implemented to facilitate product customization, allowing clients to select only the microservices relevant to their needs. Each service operates in its own container, enabling flexible deployment based on client requirements. The backend supports both web and mobile applications, and the architecture allows for dynamic scaling and resource optimization, with containers able to scale up, down, or be deactivated in response to traffic demands.

This project is a robust, modular backend platform architected using Node.js and the NestJS framework, designed to support a microservices-oriented architecture. The system is organized into multiple applications—such as API Gateway, Auth, Backoffice, Files, Form Builder, Reports, and Users—each encapsulated within its own module under a monorepo structure. The use of NestJS enables scalable, maintainable code with strong TypeScript typing, dependency injection, and a clear separation of concerns. The project leverages Docker for containerization, ensuring consistent environments across development, testing, and production, and utilizes docker-compose for orchestrating multi-container deployments.

Key technologies integrated into the platform include TypeScript for type safety, Jest for comprehensive unit and end-to-end testing, and ESLint for code quality enforcement. The API Gateway acts as a single entry point, routing requests to the appropriate microservices and handling cross-cutting concerns such as authentication, authorization, and request validation. Each microservice is designed to be independently deployable and testable, with dedicated configuration files and environment management, supporting both horizontal scaling and rapid feature development.

The system incorporates advanced features such as JWT-based authentication, role-based access control, and modular gateways for different business domains (e.g., backoffice, files, form builder, reports, and users). The architecture supports seamless integration with external services and databases, and includes a static file server for handling file uploads. CI/CD pipelines are defined using Azure Pipelines, automating build, test, and deployment processes to ensure high code quality and rapid delivery cycles.

Comprehensive test coverage is achieved through Jest, with coverage reports and test results integrated into the development workflow. The project structure follows best practices for large-scale TypeScript applications, including shared libraries for common functionality, environment-specific configuration management, and clear separation between application logic and infrastructure. This backend platform exemplifies modern backend engineering, emphasizing scalability, maintainability, and developer productivity.