How vivek-dubey-0305/gha works
Purpose and Deployable Surfaces
This is a three-client learning-platform monorepo: a learner-facing site, instructor portal, and administrative portal backed by a shared API. Each client is a separate Vite/React application; the backend is a Node.js HTTP service.
• Learner entry: frontend/src/main.jsx, frontend/src/App.jsx
• Instructor entry: Instructor/src/main.jsx, Instructor/src/App.jsx
• Admin entry: Admin/src/main.jsx, Admin/src/App.jsx
• API process entry: backend/server.js, backend/app.js
Client Routing, Layout, and Access Control
Each React app routes page-level features through a central router and separates public authentication screens from authenticated workspace layouts. Route protection is a frontend boundary; the API enforces role-specific authorization separately.
• Learner routes/layout: frontend/src/router/router.jsx, frontend/src/components/layout/UserLayout.jsx, frontend/src/components/protected/Protect.jsx
• Instructor routes/layout: Instructor/src/router/router.jsx, Instructor/src/components/layout/InstructorLayout.jsx, Instructor/src/components/protected/Protect.jsx
• Admin routes/layout: Admin/src/router/router.jsx, Admin/src/components/layout/AdminLayout.jsx, Admin/src/components/protected/Protect.jsx
State and API Integration
All three clients use Redux stores organized by domain slices. Feature pages dispatch resource/auth actions through shared API and authentication utilities; UI state and feedback are rendered through reusable modal/toast components.
• Learner store and domain state: frontend/src/redux/store/store.js, frontend/src/redux/slices/course.slice.js, frontend/src/redux/slices/auth.slice.js
• Instructor store: Instructor/src/redux/store/store.js, Instructor/src/redux/slices/course.slice.js, Instructor/src/redux/slices/liveclass.slice.js
• Admin store: Admin/src/redux/store/store.js, Admin/src/redux/slices/admin.slice.js, Admin/src/redux/slices/course.slice.js
Core Learning Domain Flow
Courses are the central aggregate: instructors create/edit courses with modules, lessons, materials, assignments, and live classes; learners enroll, consume content, submit work, receive progress/reviews/certificates; admins manage and moderate platform-wide resources.
• API domain endpoints: backend/routes/course.routes.js, backend/routes/enrollment.routes.js, backend/routes/progress.routes.js
• Persistence models: backend/models/course.model.js, backend/models/module.model.js, backend/models/lesson.model.js
• Course composition and ownership logic: backend/services/fullCourse.service.js, backend/services/ownership.service.js, backend/services/progress.service.js
API Request and Security Pipeline
The backend follows route → controller → model/service processing, with shared async/error handling, sanitization, request logging, file upload processing, and distinct user/instructor/admin authentication middleware. Controllers expose domain APIs while services hold cross-resource workflows.
• Application/middleware boundary: backend/app.js, backend/middlewares/error.middleware.js, backend/middlewares/sanitization.middleware.js
• Role authentication: backend/middlewares/user.auth.middleware.js, backend/middlewares/instructor.auth.middleware.js, backend/middlewares/admin.auth.middleware.js
• Authentication APIs/services: backend/routes/user.auth.routes.js, backend/controllers/user.auth.controller.js, backend/services/auth.service.js
Engagement, Assessment, and Finance Workflows
Beyond course delivery, the system supports announcements, discussions/study groups, doubt tickets, notifications, assignment submission/grading, and platform financial records. Grading includes a dedicated worker and reconciliation service, creating an asynchronous boundary from normal CRUD requests.
• Assessment pipeline: backend/routes/submission.routes.js, backend/services/mcq-grading.service.js, backend/workers/mcq-grading.worker.js
• Community/support: backend/routes/discussion.routes.js, backend/routes/study-group.routes.js, backend/services/doubt-ticket.service.js
• Financial resources: backend/routes/payment.routes.js, backend/models/wallet.model.js, backend/services/payment.service.js
External Services and Infrastructure Boundaries
The API integrates media, object storage, caching, email, and payment-oriented infrastructure through dedicated adapters. Live classes and video delivery are isolated behind services rather than embedded in controllers. Environment/configuration is centralized under backend configs and .env inputs.
• Video/media providers: backend/services/cloudflare-stream.service.js, backend/services/bunny.service.js, backend/services/image.service.js
• Storage/cache and email: backend/services/r2.service.js, backend/services/redis.service.js, backend/services/mail.service.js
• Runtime configuration and deployment clues: backend/configs/env.config.js, frontend/vercel.json, Instructor/vercel.json
Main entry points: sanitization.middleware.js Sanitization, errors & role auth · fullCourse.service.js Course composition & progress · app.js HTTP application · submission.routes.js Community, support & submissions
Components 19
React clients
Three Vite/React applications for distinct platform roles.
- Learner app
frontend/src/main.jsx - Learner routes & workspace · Public auth screens are separated from protected learner workspace routes.
frontend/src/router/router.jsx - Learner course & auth state
frontend/src/redux/store/store.js - Instructor app
Instructor/src/main.jsx - Instructor routes & workspace · Protected instructor workspace routes are rendered in the instructor layout.
Instructor/src/router/router.jsx - Instructor course & live-class state
Instructor/src/redux/store/store.js - Admin app
Admin/src/main.jsx - Admin routes & workspace · Protected administration routes are rendered in the admin layout.
Admin/src/router/router.jsx - Admin & course state
Admin/src/redux/store/store.js
Node.js API
Shared HTTP service and domain workflows.
- HTTP application · Applies shared request processing before domain routes.
backend/app.js - Sanitization, errors & role auth · User, instructor, and admin authorization are enforced by the API.
backend/middlewares/sanitization.middleware.js - Authentication API
backend/routes/user.auth.routes.js - Course, enrollment & progress APIs
backend/routes/course.routes.js - Course composition & progress · Builds full courses, verifies ownership, and manages learner progress.
backend/services/fullCourse.service.js - Course content models · Courses contain modules and lessons.
backend/models/course.model.js - Community, support & submissions
backend/routes/submission.routes.js - MCQ grading workflow · Submission grading crosses an asynchronous worker boundary.
backend/services/mcq-grading.service.js - Payments & wallet
backend/routes/payment.routes.js
Infrastructure adapters
External media, storage, cache, email, and payment integrations.
- Media, storage, cache & email · Provider integrations are isolated behind backend services.
backend/services/cloudflare-stream.service.js
Connections 22
- Learner app → Learner routes & workspace: mounts
- Learner routes & workspace → Learner course & auth state: dispatches
- Instructor app → Instructor routes & workspace: mounts
- Instructor routes & workspace → Instructor course & live-class state: dispatches
- Admin app → Admin routes & workspace: mounts
- Admin routes & workspace → Admin & course state: dispatches
- Learner course & auth state → HTTP application: API requests
- Instructor course & live-class state → HTTP application: API requests
- Admin & course state → HTTP application: API requests
- HTTP application → Sanitization, errors & role auth: applies
- Sanitization, errors & role auth → Authentication API: authorizes
- Sanitization, errors & role auth → Course, enrollment & progress APIs: authorizes
- Sanitization, errors & role auth → Community, support & submissions: authorizes
- Sanitization, errors & role auth → Payments & wallet: authorizes
- Authentication API → Course composition & progress: identity context
- Course, enrollment & progress APIs → Course composition & progress: orchestrates
- Course composition & progress → Course content models: reads and writes
- Community, support & submissions → MCQ grading workflow: submissions
- MCQ grading workflow → Course content models: records results
- Payments & wallet → Media, storage, cache & email: payment integration
- Course composition & progress → Media, storage, cache & email: content media and storage
- Community, support & submissions → Media, storage, cache & email: notifications and cache