How ankit-0369/chalchitra-backend works
Main Components
a) Core Application Layer:
• Express.js Application Server (indicated by app.js)
• Authentication Middleware
• File Upload Handling (Multer)
• Route Controllers
• API Response Handlers
b) External Services:
• Cloudinary (for media storage/management)
• Database Layer (likely MongoDB based on the model structure)
c) Business Logic Layer:
• User Management
• Video Management
• Subscription Management
Detailed Component Breakdown
API Layer (Blue):
• User Routes (/src/routes/user.routes.js)
• Video Routes (/src/routes/video.routes.js)
Middleware Layer (Yellow):
• Authentication Middleware
• Multer File Upload Middleware
Controller Layer (Green):
• User Controller
• Video Controller
Model Layer (Orange):
• User Model
• Video Model
• Subscription Model
External Services (Purple):
• Cloudinary
• Database
Utility Services (Gray):
• API Error Handler
• API Response Handler
• Async Handler
Connection Flows
• Request flow through middleware
• Controller interactions with models
• File upload flow to Cloudinary
• Database operations
• Error handling paths
Implementation Details
• Clear labels for each component
• Environment configuration dependencies (.env)
Additional Elements
• Configuration management
• Environment variables
• Temporary storage (public/temp)
• Error handling mechanisms
Key Flows to Highlight: