How juri-sinitson/angular-monorepo works
Main Components Identification
• Apps:
• Backend App (“central-backend”): Contains REST routes (e.g. persons-management-routes.ts), assets, and primary service logic.
• Frontend App (“persons-management-frontend”): Implements the UI using Angular, with configurations, Storybook support, and proxy settings.
• Testing Suites: Separate e2e applications for backend (“central-backend-e2e”) and frontend (“persons-management-frontend-e2e”) to show automated testing layers.
• Libraries (Modules):
• Domain and API Libraries (“libs/persons-management/api-persons”, “libs/persons-management/domain”): Housing business interfaces, state management, and data store interactions.
• Feature Libraries (“libs/persons-management/feature-birthdays”): Encapsulate specific business features.
• Shared Libraries (“libs/shared/ui-chart”, “libs/shared/ui-common”, “libs/shared/ui-menu”, “libs/shared/util-common”, etc.): Abstract common UI components and utility functions.
• Non-Production Tools (“libs/non-prod”): Contains generators, Storybook setups, and testing helpers.
• CI/CD and Build Infrastructure:
• Dockerfile and docker-compose; GitHub workflows under “.github/workflows” represent the deployment and continuous integration pipelines.
Relationships and Interactions
• Separation between the frontend and backend apps.
• Dependency flow: For example, the “persons-management-frontend” consumes UI components from shared libraries and interacts with APIs provided by the “central-backend” (or through the “persons-management/api-persons” lib).
• How the domain libraries and feature libraries interact with both the apps and shared business logic.
• CI/CD pipeline component as an external orchestrator (GitHub Actions, NX distributed caching) interacting with the repo (e.g., triggering builds, tests, and deployments).
Architectural Patterns & Design Principles
• Use of dependency constraints to enforce modularity.
• Use layered design principles where presentation (UI), business logic (domain and API libraries), and infrastructure (backend and CI/CD) are separated.
• Use of automatic code generation to avoid repetition and encourage DRY practices.
Technologies and Frameworks
• Angular (for frontend), NodeJS (for backend service execution).
• Nx as the build system and workspace manager.
• Testing frameworks like Jest, Cypress (for e2e), and Storybook for UI interaction tests.
• Docker for containerization.
• Additional UI toolkits like PrimeNG and PrimeFlex are used by the UI libraries.