How trungthanhdev/it_er_forum works
Main Components
• NestJS Application Core – Start with the application bootstrap (src/main.ts) that initializes the entire system.
• Modules – Each subdirectory under "src/modules" represents a key component. For instance, include modules for:
• Authentication (auth): Handles login, registration, and auth-related operations.
• Blacklist: Manages token refresh or security blacklisting.
• Comment: Manages operations related to comments.
• Notification: Deals with user notifications.
• Post: Manages posting logic.
• Report: Handles reporting of content.
• Tag and Tag_by: Manage tagging features.
• User: Handles all user-related functionalities.
• Global Components – Include elements defined in the "global" folder (e.g., enums) and "guard" for route/method protection (auth.guard, role.guard).
• Data Transfer Objects (DTOs) – Represented in the "dto" folder and inside module-specific dto directories, these ensure correct data formats for incoming and outgoing data.
• External Services/Infrastructure – Although not explicitly shown, include a generic Database component (as indicated by dbconfig.ts) where persistent storage will reside.
Relationships and Interactions
• Data Flow: Indicate how HTTP requests enter via controllers (e.g., auth.controller, post.controller) and then funneled through service layers.
• DTO Utilization: Show that the data flows between the client and server are validated by DTOs.
Architectural Patterns
• Modular Architecture: Emphasize the well-defined separation of concerns through distinct modules.
• Layered Architecture: Outline the typical request-handling flow from controller -> service -> entities/ORM -> database.
• Use of DTOs: Illustrate the pattern of data validation and transformation using DTOs.
• Dependency Injection: Optionally, note that NestJS relies on dependency injection, which wires controllers and services together, even if it is abstracted away in code.
Relevant Technologies and Frameworks
• NestJS – The overall Node.js framework powering the application.
• TypeScript – The language used for type safety across modules.
• Database (ORM) – While the specific ORM (like TypeORM) isn’t explicitly mentioned, the presence of entity files and a dbconfig.ts suggests one is used.
• Testing Frameworks – Represent "jest" usage by noting the test folder for unit and integration/e2e tests.