Architecture
Overall Architecture
The system is organized as a Nx monorepo, separating runtime applications from shared domain libraries. The apps
directory contains the main executable applications, including the backend server (server) and the mobile application
(sparrow-home-mobile).
The frontend layer is located under libs/fe and follows a domain-oriented structure, separated into domain and
feature layers. The backend is built with NestJS and organized under libs/nest, where functionality is grouped into
dedicated modules.
The architecture promotes clear separation of concerns: applications inside apps compose the final runtime environments, while business logic, integrations, and reusable features are encapsulated within shared libraries. This approach improves scalability, maintainability, code reuse, and independent development across frontend, mobile, and backend layers.
Frontend Technology Stack
The frontend is built with a modern technology stack centered around Angular as the primary framework for web and mobile application development.
State management is implemented using NgRx Signal Store, allowing reactive and lightweight state handling with Angular Signals integration. This approach simplifies data flow management, improves performance, and reduces boilerplate compared to traditional state management solutions.
Internationalization is handled with ngx-translate, providing dynamic multi-language support and flexible runtime translation loading across the application.
The UI layer is based on PrimeNG, which serves as the primary design system and component library for the project. PrimeNG provides a consistent visual language, reusable UI components, responsive layouts, and theming capabilities, significantly speeding up frontend development while maintaining a unified user experience across the application.
Combined with the Nx monorepo architecture, this stack enables modular development, code reuse between platforms, and efficient scaling of frontend functionality.
Backend Technology Stack
The backend is built with NestJS, providing a modular and scalable server-side architecture based on TypeScript. The application is organized into dedicated functional modules which improves separation of concerns and simplifies long-term maintenance and feature expansion.
Communication with the database is handled using PostgreSQL together with TypeORM, which is responsible for entity mapping, repository management, and database interaction. The project uses dedicated database migration scripts to manage schema evolution in a controlled and versioned way.
The REST API is fully documented using Swagger/OpenAPI generation integrated with NestJS. API documentation is automatically generated from application decorators and DTO definitions, ensuring that the documentation stays synchronized with the implementation. This significantly improves developer experience, simplifies frontend-backend integration, and provides a clear contract for external integrations and future extensions of the system.
Summary
Sparrow Home uses a modular, monorepo-based architecture designed for scalability and clear separation of concerns.
- Monorepo foundation: Nx monorepo structure with runtime applications in
appsand shared libraries inlibs. - Frontend stack: Angular with NgRx Signal Store for reactive state management, ngx-translate for i18n, and PrimeNG as the main UI component library.
- Backend stack: NestJS (TypeScript) organized into functional modules to support maintainability and feature growth.
- Data layer: PostgreSQL with TypeORM for data access and entity mapping, supported by versioned database migrations.
- API documentation: Swagger/OpenAPI generation integrated with NestJS to keep API docs aligned with implementation.
This combination enables code reuse across web, mobile, and backend layers while keeping development independent and maintainable.