EduQuest
Admin User Creation Script This script allows you to create an admin user for the EduQuest platform. Prerequisites Make sure your MongoDB connection string is set in the environmen...
Technical Architecture & Engineering Overview
Detailed system design and core implementation
The system follows a domain‑driven modular architecture where each functional area (auth, assignments, submissions, payments, wallet) lives in its own API route folder and is backed by dedicated Mongoose models (User, Assignment, Submission, TokenWallet, Transaction, Payment). Authentication uses JWTs stored in HTTP‑only cookies, providing a 7‑day session that gates access to teacher‑only pages via client‑side guards (useAuth).
Data ingestion begins when a teacher creates an assignment via /api/assignments. The payload is validated, persisted, and made queryable through GET /api/assignments endpoints. Students retrieve assignments by code, record voice input, and submit answers to /api/submissions. The submission handler invokes the NLPEngine (abstracted in lib/) to generate auto‑graded feedback and updates token balances in TokenWallet.
Payment flow is mediated by the RazorPayGateway. When a student purchases tokens, the client calls POST /api/payments/create-order, which creates a Razorpay order, stores a Payment document, and on verification updates the wallet balance. All financial state transitions are recorded in the Transaction collection, ensuring auditability.
Security guardrails include server‑side password hashing with bcrypt, JWT signature verification, role‑based redirects, and strict TypeScript typings for request/response contracts. The monorepo leverages Yarn workspaces to share ESLint configs and TypeScript settings across the web and admin packages, simplifying CI/CD pipelines.
Build topology uses Next.js’s edge‑runtime for API routes, enabling fast cold‑start times, while UI components are compiled with TailwindCSS for a responsive design. The admin console runs on a separate port (3002) and provides analytics via Recharts, consuming the same MongoDB data layer for consistency.
System Diagrams & Flow Visualizations
Interactive Mermaid architecture & execution flows
Core System Features
Key capabilities & architectural features
Voice‑to‑text assignment creation and submission
Voice‑to‑text assignment creation and submission
AI‑assisted auto‑grading via NLPEngine
AI‑assisted auto‑grading via NLPEngine
Token‑based wallet system for rewarding students
Token‑based wallet system for rewarding students
Razorpay integration for purchasing tokens
Razorpay integration for purchasing tokens
Role‑based dashboards for teachers and students
Role‑based dashboards for teachers and students
Secure JWT authentication with HTTP‑only cookies
Secure JWT authentication with HTTP‑only cookies
Admin analytics console with Recharts visualizations
Admin analytics console with Recharts visualizations
Monorepo structure enabling shared code between student and admin apps
Monorepo structure enabling shared code between student and admin apps
Engineering Challenges & Solutions
Problem statements & resolution strategies
Balancing real‑time voice processing latency against server‑side NLP grading performance
Balancing real‑time voice processing latency against server‑side NLP grading performance
Ensuring token accounting consistency across asynchronous payment callbacks and submission deductions
Ensuring token accounting consistency across asynchronous payment callbacks and submission deductions
Managing JWT expiration and refresh without exposing refresh tokens to the client
Managing JWT expiration and refresh without exposing refresh tokens to the client
Designing a schema that supports both voice‑only and voice‑text assignment modes without schema bloat
Designing a schema that supports both voice‑only and voice‑text assignment modes without schema bloat
Isolating admin‑only routes while sharing the same MongoDB instance to prevent privilege escalation
Isolating admin‑only routes while sharing the same MongoDB instance to prevent privilege escalation
Key Code Modules & Architecture
Core file entrypoints and service responsibilities
eduquest-next/appModule component managing app source logic
eduquest-next/app/apiModule component managing api source logic
eduquest-next/componentsModule component managing components source logic
eduquest-next/components/uiModule component managing ui source logic
eduquest-next/libModule component managing lib source logic
eduquest-next/hooksModule component managing hooks source logic
eduquest-next/lib/servicesModule component managing services source logic
scriptsModule component managing scripts source logic
User Journey Pipeline
- 1User Access & Preset Selection: User opens client interface and configures request parameters or task workflow presets.
- 2Client Payload Dispatch: Front-end components (React, Next.js, TailwindCSS) serialize input objects and send HTTP/WebSocket requests to `/api/analyze`.
- 3Middleware & Validation Check: API Gateway evaluates CORS headers, authorization tokens, and input validation schemas.
- 4Service & Inference Execution: Service controllers dispatch request frames to model inference engine (Local Engine) or storage layer.
- 5Response Delivery & State Synchronization: Serialized output payload is returned to the client and rendered in the visual workspace.
Execution Code Flow
- 1Client or caller initiates request to application entrypoint
- 2Database ORM/client executes storage query
- 3Application serializes JSON/audio/data response back to client
System FAQ & Technical Specifications
Frequently asked questions and core architecture details
Q: What technologies are used in EduQuest?
EduQuest is engineered using modern full-stack frameworks.
Q: What core engineering problem does EduQuest solve?
Admin User Creation Script This script allows you to create an admin user for the EduQuest platform. Prerequisites Make sure your MongoDB connection string is set in the environmen...
Q: How is 'Balancing real‑time voice processing latency against server‑side NLP grading performance' resolved in EduQuest?
Resolved through specialized system architecture and resilient state handling.
Related Systems & Case Studies
Explore similar technical architectures and projects