How check-data-out/velog-dashboard-v2-api works
Main System Components
a) Client Layer
• External clients (Web/Mobile applications)
• Nginx reverse proxy (evident from nginx configuration files)
b) Application Layer
• Express.js API Server
• Authentication/Authorization System (visible from auth.middleware.ts)
• Token Encryption Module (from token_encryption directory)
c) Data Layer
• Database (indicated by db.config.ts)
Architectural Pattern
Controllers -> Services -> Repositories -> Database
Detailed Component Breakdown
a) API Layer (Controllers)
• Post Controller
• User Controller
• Tracking Controller
b) Service Layer
• Post Service
• User Service
• Tracking Service
c) Repository Layer
• Post Repository
• User Repository
• Tracking Repository
d) Cross-Cutting Concerns
• Error Handling Middleware
• Validation Middleware
• Authentication Middleware
• Logging System (logger.config.ts)
Data Flow Representation
• Client requests through Nginx to the API endpoints
• Request flow through middleware
• Business logic flow through services
• Data access through repositories
• Error handling flow
┌─ External Layer ─┐ ┌─ Application Layer ─┐ ┌─ Data Layer ─┐
• Nginx │ │ - Controllers │ │ - Repositories│
• Clients │──>│ - Services │──>│ - Database │
• ┘ │ - Middleware │ └──────────────┘
• ┘
Additional Notes
• Notes about the authentication flow
• Event tracking system's flow
• Statistics aggregation process
• Error handling paths
Technical Stack Indicators
Following technologies:
• Node.js/Express.js
• TypeScript
• Nginx
• Database system (from db.config.ts)
This system design should effectively communicate both the overall architecture and the specific implementation details of the Velog Dashboard backend API server.