This repository contains a scalable 3-layer system for SSMU MCQs:
- mobile-app/: React Native Android app (student experience).
- backend/: Node.js + Express REST API + MongoDB.
- admin-panel/: React web admin console.
- Google/Gmail login flow (
POST /auth/google-login) with JWT session. - Single-device session policy: new login invalidates previous device session for the same account.
- 90-day subscription activation from verified payment (
INR 49). - Strict learning hierarchy: Course → Subject → Module → Topic → Task Type → MCQs.
- One-question-at-a-time MCQ engine with instant correct/incorrect + explanation.
- Offline-friendly behavior with cached course/content fallback.
- Admin content and import workflow for PDF/DOCX: upload → preview → validate/edit → publish.
- Seeded 6-course structure from the provided university curriculum.
/backend
/src
/config
/controllers
/middlewares
/models
/routes
/services
/seed
server.js
/mobile-app
/src
/components
/navigation
/screens
/services
/store
/utils
/admin-panel
/src
/pages
/servicesPOST /auth/google-login
GET /user/profileGET /user/subscription-status
POST /payment/create-orderPOST /payment/verify
GET /coursesGET /subjects/:course_idGET /modules/:subject_idGET /topics/:module_idGET /task-types/:topic_idGET /mcqs/:task_type_id
POST /mcq/attemptGET /mcq/historyPOST /mcq/bookmarkGET /mcq/bookmarks
POST /admin/coursePOST /admin/subjectPOST /admin/modulePOST /admin/topicPOST /admin/task-typePOST /admin/mcqPOST /admin/uploadGET /admin/usersGET /admin/paymentsGET /admin/analytics
- Gateway: Razorpay integration service with secure signature verification.
- UPI settlement target: merchant UPI mrx4u@ybl.
- Subscription starts only after verified payment.
- Duration: exactly 90 days server-side (
subscription_start+ 90 days).
- Mobile app caches course/content payloads using
AsyncStorage. - If API fails offline, cached content is shown.
- MCQ explanation always uses stored DB explanation; optional enhancement can be layered online later.
cd backend
npm install
cp .env.example .env
npm run devCreate .env with:
PORT=4000
MONGO_URI=mongodb://127.0.0.1:27017/ssmu_mcqs
JWT_SECRET=replace_in_production
JWT_EXPIRY=7d
RAZORPAY_KEY_ID=rzp_xxx
RAZORPAY_KEY_SECRET=xxx
FRONTEND_URL=http://localhost:5173
ADMIN_URL=http://localhost:5174cd backend
npm run seedcd mobile-app
npm install
npm run androidcd admin-panel
npm install
npm run dev- Replace mock Google sign-in in mobile/admin with official SDK + ID token verification.
- Enable webhook-based payment verification in addition to callback signature checks.
- Add refresh tokens, device binding, and secure key vault storage.
- Add pagination/search + audit export in admin panel.
- Add test suites (unit/integration/e2e) and CI pipelines.
- Deploy with Docker/Kubernetes + managed MongoDB + centralized logging.