S
Web App2026CompletedFeatured Project

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...

RoleSole Developer
Classificationhigh
Client / ContextOpen Source Project
Development TimelineCompleted

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

Architectural Visualizer · System Architecture

Core System Features

Key capabilities & architectural features

FEATURE 01

Voice‑to‑text assignment creation and submission

Voice‑to‑text assignment creation and submission

FEATURE 02

AI‑assisted auto‑grading via NLPEngine

AI‑assisted auto‑grading via NLPEngine

FEATURE 03

Token‑based wallet system for rewarding students

Token‑based wallet system for rewarding students

FEATURE 04

Razorpay integration for purchasing tokens

Razorpay integration for purchasing tokens

FEATURE 05

Role‑based dashboards for teachers and students

Role‑based dashboards for teachers and students

FEATURE 06

Secure JWT authentication with HTTP‑only cookies

Secure JWT authentication with HTTP‑only cookies

FEATURE 07

Admin analytics console with Recharts visualizations

Admin analytics console with Recharts visualizations

FEATURE 08

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

Challenge #1

Balancing real‑time voice processing latency against server‑side NLP grading performance

Balancing real‑time voice processing latency against server‑side NLP grading performance

Challenge #2

Ensuring token accounting consistency across asynchronous payment callbacks and submission deductions

Ensuring token accounting consistency across asynchronous payment callbacks and submission deductions

Challenge #3

Managing JWT expiration and refresh without exposing refresh tokens to the client

Managing JWT expiration and refresh without exposing refresh tokens to the client

Challenge #4

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

Challenge #5

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

AppMODULE 01
eduquest-next/app

Module component managing app source logic

ApiMODULE 02
eduquest-next/app/api

Module component managing api source logic

ComponentsMODULE 03
eduquest-next/components

Module component managing components source logic

UiMODULE 04
eduquest-next/components/ui

Module component managing ui source logic

LibMODULE 05
eduquest-next/lib

Module component managing lib source logic

HooksMODULE 06
eduquest-next/hooks

Module component managing hooks source logic

ServicesMODULE 07
eduquest-next/lib/services

Module component managing services source logic

ScriptsMODULE 08
scripts

Module component managing scripts source logic

User Journey Pipeline

  1. 1User Access & Preset Selection: User opens client interface and configures request parameters or task workflow presets.
  2. 2Client Payload Dispatch: Front-end components (React, Next.js, TailwindCSS) serialize input objects and send HTTP/WebSocket requests to `/api/analyze`.
  3. 3Middleware & Validation Check: API Gateway evaluates CORS headers, authorization tokens, and input validation schemas.
  4. 4Service & Inference Execution: Service controllers dispatch request frames to model inference engine (Local Engine) or storage layer.
  5. 5Response Delivery & State Synchronization: Serialized output payload is returned to the client and rendered in the visual workspace.

Execution Code Flow

  1. 1Client or caller initiates request to application entrypoint
  2. 2Database ORM/client executes storage query
  3. 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

View All Systems