How ayaz-11257/lms-backend works
This is an Express backend for an LMS. Its main user workflow covers registration and sign-in, course discovery and lecture access, then subscription purchase and verification for paid access. The backend also supports course and lecture management, profile/password maintenance, and administrative statistics. The graph reflects the sampled controller/model calls and app wiring; route and model files for courses, payments, and miscellaneous features exist in the tree, but their implementations were not sampled, so uncertain internal links are omitted.
Main entry points: app.js Express app · payment.controller.js Subscription workflows · user.controller.js User workflows · user.routes.js User routes
Components 20
HTTP entry
- Express app
app.js - Server startup
server.js - User routes
routes/user.routes.js - Course routes
routes/course.route.js - Payment routes
routes/payment.route.js - Misc routes
routes/miscellaneous.route.js - Error handling
middleware/error.middleware.js - MongoDB connection
config/dbConnection.js
Accounts
- Authentication
middleware/auth.middleware.js - User workflows
controller/user.controller.js - User records
models/user.model.js - Email delivery
utils/sendEmail.js
Learning content
- Course workflows
controller/course.controller.js - Course records
models/course.model.js - Cloudinary media
Subscriptions and admin
- Subscription workflows
controller/payment.controller.js - Payment records
models/payment.model.js - Razorpay
- Contact and stats
controller/miscellaneous.controller.js
Other components
- API client
Connections 21
- API client → Express app: sends requests
- Express app → User routes: mounts routes
- Express app → Course routes: mounts routes
- Express app → Payment routes: mounts routes
- Express app → Misc routes: mounts routes
- Express app → Error handling: forwards errors
- Server startup → Express app: starts
- Server startup → MongoDB connection: connects
- User routes → User workflows: dispatches
- User routes → Authentication: guards requests
- User workflows → User records: reads and writes
- User workflows → Email delivery: sends reset email
- User workflows → Cloudinary media: uploads avatars
- Course workflows → Course records: reads and writes
- Course workflows → Cloudinary media: uploads course media
- Subscription workflows → User records: reads and updates
- Subscription workflows → Payment records: creates payment record
- Subscription workflows → Razorpay: manages subscriptions
- Subscription workflows → Server startup: gets client
- Contact and stats → User records: counts users
- Contact and stats → Email delivery: sends contact email