How ozymandiaz1876/learning-management-system-backend works
Main Components
a) Core Application Layer:
• Following modules as separate components within:
• Auth Module
• Users Module
• Questions Module
• Tests Module
• Results Module
b) Database Layer:
• MongoDB (indicated by Mongoose/Typegoose configuration)
• Collections for Users, Questions, Tests, and Results
c) Authentication Layer:
• JWT Authentication system
• Role-based access control
Component Relationships
• Client/External Requests → Auth Guard → Controllers
• Controllers → Services → Repositories → Database
• JWT flow from Auth Service to other protected modules
Detailed Module Breakdown
For each major module, create a sub-section showing:
a) Auth Module:
┌─ Auth Module ─────────────┐
• JWT Strategy │
• Guards │
• Controllers │
• Services │
• ┘
b) Tests Module:
┌─ Tests Module ────────────┐
• Test Algorithm Config │
• Test Controller │
• Test Service │
• Test Repository │
• ┘
Key Elements to Highlight
a) Security Layer:
• JWT Authentication flow
• Role Guards (UserRoles enum implementation)
• Authorization decorators
b) Data Flow:
• Request handling path
• Database interactions
• Test algorithm flow
Technical Details
• NestJS framework as the foundation
• MongoDB database connection
• JWT token implementation
• Configuration management
• Repository pattern implementation
┌─ Test Algorithm ────────────────┐
• Initial Difficulty → 5 │
• Max Questions → 20 │
• Difficulty Range → 1-10 │
• Adaptive Difficulty System │
• ┘