How amrmuhamedd/blog-posts works
Component Relationships
a) External Connections:
• Client → API Gateway (REST APIs)
• API Gateway → Cloudinary
• API Gateway → PostgreSQL
b) Internal Module Connections:
• Dependencies between modules (e.g., Posts depend on Users)
• Audit Service's connections to all modules
Detailed Component Breakdown
For each major module, include:
a) Core Components:
• Middleware Stack
• Auth Middleware
• Admin Middleware
• Audit Middleware
• Error Middleware
• Upload Middleware
b) Module Structure (for each module):
• Module (e.g., Posts)
• Controller
• Service
• Routes
• DTOs
Key Flows to Highlight
a) Authentication Flow:
Client → Auth Middleware → JWT Validation → Route Handler
b) Post Creation Flow:
Client → Upload Middleware → Media Service → Cloudinary
→ Post Service → Database → Audit Service
c) Data Access Flow:
Client → Auth Middleware → Role Check → Service → Prisma → PostgreSQL
• Request → Auth → Admin → Audit → Route → Response
• Error → Error Middleware → Client Response
Technical Details
Specifications:
• Node.js Runtime (>18.16.0)
• Express.js Framework
• TypeScript Implementation
• Prisma ORM
• JWT Authentication
• CORS Enabled
• Class Validator
• Jest Testing Framework
Deployment Context
A small section showing:
• Docker container boundaries
• Vercel deployment setup
• Environment variable dependencies