How nenertiy/backend-nenboard works
Main Components/Modules
• App Module – your core module that might include bootstrap or global providers such as the Prisma service (src/modules/app/prisma.service.ts).
• Auth Module – handles user authentication and authorization, with its controllers, services, dto definitions (e.g. sign-in, sign-up), and guards (located in src/modules/auth).
• Users Module – manages user data with its controllers, services, and repositories.
• Projects Module – encapsulates project creation, updating, etc.
• Tasks Module – manages task creation, updates, and their validation via DTOs.
• Media Module – handles media processing, again broken into controllers, services, repositories.
• Activity Log Module – includes a controller, service, repository and importantly a gateway (for WebSocket communications) to broadcast activity logs.
• Token Module – provides token strategies (such as the jwt.strategy) and token management services.
Common/Shared Modules and Utilities
• A “Common” section that shows shared decorators (e.g., decode-user.decorator.ts, project-role.decorator.ts) and types (JWT payload, user types, project types).
• A “Config Module” (src/config/config.ts) to indicate how environment-specific configurations are loaded (via .env.example and similar config files).
Data Layer
• Prisma layer (prisma/schema.prisma) as the underlying database connection layer that the repositories in various modules interact with.
Communication & Architecture Patterns
• From External Clients (e.g., via REST endpoints or WebSocket connections) to the Controllers.
• From Controllers to respective Services and then to Repositories.
• From Activity Log controllers and gateways to external clients (especially indicating WebSocket data flows).
• Use of architectural patterns like Dependency Injection (a core NestJS principle) and the layered pattern (controllers → services → repositories).
• If applicable, show the separation between synchronous (HTTP) requests in controllers and asynchronous events in gateways.
Technologies and Frameworks
• NestJS Framework – overall container and modules.
• TypeScript – code language and toolchain (with tsconfig.json files).
• Prisma – acts as your ORM and connects with the underlying database.
• Testing – Though not shown in the file tree directly, you might note that testing is integrated given the commands in the README (unit and e2e tests).