How harmeet10000/shiksha-dost-backend works
Main Components
A. Core Application Layer
• Express.js Application Server (src/app.js)
• Authentication Service (controllers/authController.js)
• Route Handlers (src/routes/*)
• Middleware Layer (src/middlewares/*)
B. Data Layer
• MongoDB Database
• Data Models (src/models/*)
• Database Connection (src/db/connect.js)
C. External Services Integration
• AWS S3 for file storage (helpers/s3.js)
• Razorpay for payments (helpers/razorpay.js)
• Email Service (helpers/email.js)
D. Security Layer
• Authentication Middleware
• Rate Limiting
• Security Headers (Helmet)
• XSS Protection
• MongoDB Sanitization
┌─────────────────────────────────────────────────────────┐
• Client Applications │
• ┘
• ↓
┌─────────────────────────────────────────────────────────┐
• API Gateway Layer │
• (Rate Limiting, Security Headers, Authentication) │
• ┘
• ↓
┌─────────────────────────────────────────────────────────┐
• Core Application Layer │
• ┬─────────────────┬───────────────────┤
• Auth Service │ Blog Service │ Mentor Service │
• User Service │ DPP Service │ Material Service │
• ┴─────────────────┴───────────────────┘
• ↓
┌─────────────────────────────────────────────────────────┐
• Data Layer │
• MongoDB Models │
• ┘
• ↕
┌─────────────────────────────────────────────────────────┐
• External Services │
• AWS S3 │ Razorpay │ Email Service (SES) │
• ┘
Component Details
A. API Routes (src/routes/*)
• Auth Routes
• Blog Routes
• Mentorship Routes
• Material Routes
• Payment Routes
• User Routes
B. Controllers (src/controllers/*)
• Relationship between routes and controllers
• Factory pattern used (handlerFactory.js)
C. Middleware Chain
• Authentication
• Error Handling
• Visit Tracking
D. Models Layer
• User Model
• Blog Model
• Mentor Model
• Material Model
• Mentorship Model
• DPP Model
• Comment Model
Additional Elements
• GitHub Actions workflow for CI/CD
• Environment configuration flow
• Error handling paths
• Security checkpoints