How rhydham-music27/y3-backend works
Your Shikshak is a tutoring operations API: users and families create or manage leads, staff coordinate demos and convert leads into classes, and tutors deliver sessions tracked through attendance and payment. Its role-based routes also support tutor verification, student and parent access, notifications, announcements, and management dashboards. The sampled code verifies token identities, routes class operations through controllers into services, and persists domain records in MongoDB. Many route and service files are indexed but unsampled, so their internal calls are not expanded here.
Main entry points: routes API routes · classSessionService.ts Session management · server.ts HTTP server · authService.ts Authentication service
Components 27
API entry
- HTTP server
src/server.ts - API routes
src/routes
Identity and access
- Authentication routes
src/routes/authRoutes.ts - Authentication controller
src/controllers/authController.ts - Authentication service
src/services/authService.ts - Token authentication
src/middlewares/auth.ts - Role authorization
src/middlewares/authorize.ts - User records
src/models/User.ts
Tutoring operations
- Lead management
src/controllers/leadController.ts - Class lead records
src/models/ClassLead.ts - Tutor management
src/controllers/tutorController.ts - Tutor records
src/models/Tutor.ts - Manager operations
src/services/managerService.ts - Manager records
src/models/Manager.ts
Class delivery
- Class coordination
src/controllers/finalClassController.ts - Class lifecycle service
src/services/finalClassService.ts - Final class records
src/models/FinalClass.ts - Session management
src/services/classSessionService.ts - Class session records
src/models/ClassSession.ts - Attendance records
src/models/Attendance.ts - Payment operations
src/services/paymentService.ts - Payment records
src/models/Payment.ts - Student access
src/controllers/studentController.ts
Platform services
- Notifications
src/services/notificationService.ts - Email delivery
src/utils/emailService.ts - MongoDB connection
src/config/database.ts
Other components
- API clients
Connections 25
- API clients → HTTP server: sends requests
src/server.ts - HTTP server → API routes: mounts routes
src/server.ts - API routes → Authentication routes: includes
src/server.ts - Authentication routes → Authentication controller: routes requests
- Authentication controller → Authentication service: calls
src/controllers/authController.ts - Authentication service → User records: authenticates users
src/services/authService.ts - Authentication service → Email delivery: sends OTP email
src/services/authService.ts - API routes → Token authentication: protects endpoints
src/routes/tutorRoutes.ts - API routes → Role authorization: checks roles
src/routes/tutorRoutes.ts - Token authentication → User records: loads identity
src/middlewares/auth.ts - Token authentication → Manager records: loads manager profile
src/middlewares/auth.ts - Lead management → Class lead records: manages leads
- Tutor management → Tutor records: manages tutors
src/controllers/tutorController.ts - Manager operations → Manager records: reads and updates
src/services/managerService.ts - Manager operations → Class lead records: aggregates lead data
src/services/managerService.ts - Class coordination → Class lifecycle service: coordinates classes
src/controllers/finalClassController.ts - Class lifecycle service → Final class records: manages classes
- Class coordination → Notifications: creates notifications
src/controllers/finalClassController.ts - Session management → Final class records: reads classes
src/services/classSessionService.ts - Session management → Class session records: manages sessions
src/services/classSessionService.ts - Session management → Attendance records: reads attendance
src/services/classSessionService.ts - Payment operations → Payment records: manages payments
- Student access → Final class records: reads class data
src/controllers/studentController.ts - Student access → Payment records: reads payment data
src/controllers/studentController.ts - HTTP server → MongoDB connection: connects database
src/server.ts