How shuvro86/mahabharat works
Mahabharat is a vocabulary, character, and Bhagavad Gita study application. Learners use the browser interface to authenticate, explore vocabulary and characters, practise quizzes and spaced-repetition reviews, and read or search the full Gita; results and study history are served by the Express API and backed by MongoDB or process-local memory. The map preserves documented study and content branches. Several controllers and routes are represented from the source index; their internal implementation was not fully sampled, so only indexed or explicit relationships are shown.
Main entry points: app.ts Web app and API · authMiddleware.ts JWT authentication · models Study models · wordRoutes.ts Vocabulary routes
Components 25
App entry
- Web app and API
src/app.ts
Identity and access
- Auth routes
src/routes/authRoutes.ts - Authentication
src/controllers/authController.ts - JWT authentication
src/middlewares/authMiddleware.ts - Role checks
src/middlewares/roleMiddleware.ts
Vocabulary study
- Vocabulary API
src/controllers/wordController.ts - Vocabulary routes
src/routes/wordRoutes.ts - Spaced repetition
src/controllers/progressController.ts - Progress routes
src/routes/progressRoutes.ts - Quiz practice
src/controllers/quizController.ts - Quiz routes
src/routes/quizRoutes.ts - Search history
src/controllers/searchHistoryController.ts - Search routes
src/routes/searchHistoryRoutes.ts
Epic content
- Character directory
src/controllers/characterController.ts - Character routes
src/routes/characterRoutes.ts - Shloka API
src/controllers/shlokaController.ts - Shloka routes
src/routes/shlokaRoutes.ts - Full Gita API
src/modules/fullGita/routes.ts - Gita reader
src/modules/fullGita/page.ts - Hall of Frame
src/modules/hallOfFrame/page.ts
Persistence
- Study models
src/models - Memory adapter
src/config/inMemoryDb.ts - Database setup
src/config/db.ts
Other components
- Learner
- MongoDB
Connections 40
- Learner → Web app and API: uses
README.md - Web app and API → Auth routes: mounts routes
src/app.ts - Web app and API → Vocabulary routes: mounts routes
src/app.ts - Web app and API → Progress routes: mounts routes
src/app.ts - Web app and API → Quiz routes: mounts routes
src/app.ts - Web app and API → Search routes: mounts routes
src/app.ts - Web app and API → Character routes: mounts routes
src/app.ts - Web app and API → Shloka routes: mounts routes
src/app.ts - Web app and API → Full Gita API: mounts routes
src/app.ts - Web app and API → Gita reader: serves page
src/app.ts - Web app and API → Hall of Frame: renders page
src/app.ts - Auth routes → Authentication: routes to
src/routes/authRoutes.ts - Authentication → JWT authentication: uses request type
src/controllers/authController.ts - Auth routes → JWT authentication: authenticates
src/routes/authRoutes.ts - Vocabulary routes → Vocabulary API: routes to
src/routes/wordRoutes.ts - Vocabulary routes → JWT authentication: authenticates
src/routes/wordRoutes.ts - Vocabulary routes → Role checks: checks role
src/routes/wordRoutes.ts - Character routes → Character directory: routes to
src/routes/characterRoutes.ts - Character routes → JWT authentication: authenticates
src/routes/characterRoutes.ts - Character routes → Role checks: checks role
src/routes/characterRoutes.ts - Shloka routes → Shloka API: routes to
src/routes/shlokaRoutes.ts - Shloka routes → JWT authentication: authenticates
src/routes/shlokaRoutes.ts - Shloka routes → Role checks: checks role
src/routes/shlokaRoutes.ts - Progress routes → Spaced repetition: routes to
src/routes/progressRoutes.ts - Progress routes → JWT authentication: authenticates
src/routes/progressRoutes.ts - Quiz routes → Quiz practice: routes to
src/routes/quizRoutes.ts - Quiz routes → JWT authentication: authenticates
src/routes/quizRoutes.ts - Search routes → Search history: routes to
src/routes/searchHistoryRoutes.ts - Search routes → JWT authentication: authenticates
src/routes/searchHistoryRoutes.ts - Vocabulary API → Study models: uses vocabulary model
src/controllers/wordController.ts - Spaced repetition → Study models: reads and writes
src/controllers/progressController.ts - Quiz practice → Study models: reads and writes
src/controllers/quizController.ts - Search history → Study models: uses history model
src/controllers/searchHistoryController.ts - Character directory → Study models: uses character model
src/controllers/characterController.ts - Shloka API → Study models: uses shloka model
src/controllers/shlokaController.ts - Authentication → Study models: uses user model
src/controllers/authController.ts - Database setup → MongoDB: connects
src/config/db.ts - Database setup → Memory adapter: fallback storage
src/config/db.ts - Memory adapter → Study models: patches models
src/config/inMemoryDb.ts - Full Gita API → Gita reader: serves Gita data