How rtcface/backend-oic works
Main Components
• API Layer (GraphQL): At the heart of the application is the GraphQL schema (schema.gql) alongside a series of resolver files (e.g., auth.resolver.ts, code-ethics.resolver.ts, etc.) which handle incoming API requests.
• Modules: The project is broken into several business-specific modules, such as:
• Authentication (src/auth)
• Code Ethic management (src/code-ethics)
• Ente (src/ente)
• Ethics Committe (src/ethics-committe)
• Integrity Rules (src/integrity-rules)
• KPIs (src/kpis)
• Menu (src/menu)
• Plan Work (src/plan-work)
• Users (src/users)
• Supporting Infrastructure:
• Configuration (src/configuration)
• Main application entry (src/main.ts)
• Environment configuration (.env.example) and containerization files (Dockerfile, Tem-docker-compose.yml, Procfile) which suggest deployment via Docker and potentially integration with some PaaS.
• Testing: An end-to-end test folder (test/) which indicates that integration flows and data flows should also be considered.
Interactions and Relationships
• Authentication & Security: Since there is an auth module with guards and strategies, include an authentication component that ensures secure API access. This part will interact with other modules by protecting endpoints.
• Configuration & Dependency Injection: Denote configuration management as a standalone service/component that provides a central configuration to various modules.
• Deployment/Environment: Represent the containerization (Docker) aspect and environment variables, showing that the application is set up for multiple deployment environments (development, staging, production).
Architectural Patterns and Technologies
• Modular Structure: Emphasize the clean separation of concerns by module. Each module follows a similar pattern with DTOs, inputs, resolvers, services, and schemas.
• GraphQL: Note that all modules interact via GraphQL, making use of resolvers to map incoming operations to business logic.
• NestJS & Dependency Injection: Illustrate how NestJS’s dependency injection allows for loose coupling between modules and the shared configuration mechanisms.
• Middleware/Guards: Point out the use of guards (e.g., GQL Auth Guard, JWT, local strategy) that sit between the incoming request and the resolvers.
Final Things
• A clear title indicating “NestJS Server-Side Application Architecture”.
• That each module is detailed to accommodate each internal folder structure (e.g., inputs, DTOs, guards, and strategies for the auth module), which reinforces the level of granularity in the architecture.