How sridesiyan/examgen works
Purpose and Entry Points
ExamGen Nexus is a full examination-lifecycle platform: role-based access, exam authoring/delivery, identity/proctoring signals, adaptive assessment, scoring, and outcomes analytics. The browser application starts at frontend/src/main.tsx and routes through frontend/src/App.tsx; the API process starts at backend/src/index.ts and configures Express in backend/src/app.ts.
Client Application and Role Workflows
The React/Vite frontend separates student, teacher, and administrator workflows. Shared shell/navigation is in frontend/src/components/layout/DashboardLayout.tsx; authentication state is centralized in frontend/src/store/authStore.ts, with backend calls behind frontend/src/services/api.ts.
• Student flow: readiness/identity, lobby, secure exam room, then results: frontend/src/pages/student/IdentityVerificationPage.tsx, frontend/src/pages/student/ExamRoom.tsx, frontend/src/pages/student/ResultPage.tsx.
• Teacher flow: create exams, monitor active candidates, and view reports: frontend/src/pages/teacher/CreateExamPage.tsx, frontend/src/pages/teacher/LiveMonitorPage.tsx, frontend/src/pages/teacher/ReportsPage.tsx.
• Administrative overview: frontend/src/pages/admin/AdminDashboard.tsx.
API Boundary, Authentication, and Persistence
Express exposes domain-oriented HTTP route modules for auth, exams/questions, sessions/submissions, biometrics, and analytics: backend/src/routes/auth.ts, backend/src/routes/exams.ts, backend/src/routes/sessions.ts. JWT authorization and role enforcement are a middleware boundary in backend/src/middleware/auth.ts; centralized failures pass through backend/src/middleware/errorHandler.ts.
Prisma defines the persistent domain model and migration history in backend/prisma/schema.prisma and backend/prisma/migrations/20260613093336_init/migration.sql. The checked-in local datastore is SQLite (backend/prisma/examgen.db), while PostgreSQL is the intended production database.
Exam Authoring and Question Intelligence
Teachers create and manage exams through the exam and question APIs (backend/src/routes/exams.ts, backend/src/routes/questions.ts). AI-assisted generation is isolated behind backend/src/services/aiService.ts, allowing the provider/integration to be swapped without coupling route handlers or client pages to it. Question selection adapts to current performance through backend/src/services/adaptiveEngine.ts.
Assessment Session and Proctoring Flow
A candidate enters an exam session via backend/src/routes/sessions.ts, answers through the exam-room UI, and submits via backend/src/routes/submissions.ts. The browser gathers webcam/WebRTC and browser-behavior signals; identity and biometric interactions cross the API through backend/src/routes/biometrics.ts.
Server-side proctoring interpretation is decomposed into backend/src/services/agentInvigilator.ts, backend/src/services/leakageDetection.ts, and backend/src/services/riskEngine.ts. This separates raw integrity events from derived alerts/risk scores used by live monitoring and post-exam review.
Evaluation, Analytics, and Recommendations
Submission data drives scoring and outcome analysis through backend/src/routes/submissions.ts and backend/src/routes/analytics.ts. Topic-level mastery and remediation are calculated in backend/src/services/skillGap.ts; placement-oriented readiness is produced by backend/src/services/placementEngine.ts. These outputs feed student results and teacher reports rather than being embedded in exam delivery.
Runtime and External Dependencies
The system runs a TypeScript React 18 SPA built by Vite (frontend/package.json) and a TypeScript Node.js/Express API (backend/package.json). Authentication uses JWT and bcryptjs. Planned client-side proctoring depends on browser APIs, WebRTC, and face-api.js; visualization is expected through Recharts. No separate queue, object store, or deployed AI provider is represented in the repository tree, so AI and biometric/provider concerns remain service-layer integration boundaries.
Main entry points: App.tsx App router · sessions.ts Domain routes · api.ts API client · skillGap.ts Outcome analysis
Components 20
React browser app
- Vite entry
frontend/src/main.tsx - App router
frontend/src/App.tsx - Dashboard shell · Role-aware navigation shell.
frontend/src/components/layout/DashboardLayout.tsx - Auth state
frontend/src/store/authStore.ts - API client
frontend/src/services/api.ts - Student exam workflow · Identity verification, exam room, and results.
frontend/src/pages/student/ExamRoom.tsx - Teacher workflow · Exam authoring, live monitoring, and reports.
frontend/src/pages/teacher/CreateExamPage.tsx - Admin overview
frontend/src/pages/admin/AdminDashboard.tsx - Browser proctoring signals · Webcam, identity, and behavior signals.
Express API
- API process
backend/src/index.ts - Express application
backend/src/app.ts - JWT role boundary
backend/src/middleware/auth.ts - Domain routes · Auth, exams, sessions, submissions, biometrics, and analytics endpoints.
backend/src/routes/sessions.ts - Error handling
backend/src/middleware/errorHandler.ts
Assessment services
- Exam intelligence · AI generation and adaptive question selection.
backend/src/services/adaptiveEngine.ts - Proctoring risk pipeline · Interprets events into alerts and risk scores.
backend/src/services/riskEngine.ts - Outcome analysis · Skill gaps, remediation, and placement readiness.
backend/src/services/skillGap.ts - AI provider boundary · Swappable generation-provider integration.
backend/src/services/aiService.ts
Persistence
- Prisma domain model
backend/prisma/schema.prisma - Local SQLite datastore · Development datastore; PostgreSQL is intended for production.
backend/prisma/examgen.db
Connections 27
- Vite entry → App router: mounts
- App router → Dashboard shell: renders
- App router → Student exam workflow: student routes
- App router → Teacher workflow: teacher routes
- App router → Admin overview: admin route
- Dashboard shell → Auth state: uses
- Student exam workflow → API client: exam/session calls
- Teacher workflow → API client: authoring/report calls
- Admin overview → API client: API calls
- Student exam workflow → Browser proctoring signals: collects
- Browser proctoring signals → API client: sends signals
- API client → Express application: HTTPS
- API process → Express application: starts
- Express application → JWT role boundary: protects routes
- JWT role boundary → Domain routes: authorizes
- Express application → Error handling: failures
- Domain routes → Exam intelligence: authoring/adaptation
- Exam intelligence → AI provider boundary: generation
- Domain routes → Proctoring risk pipeline: biometric events
- Domain routes → Outcome analysis: submissions
- Domain routes → Prisma domain model: reads and writes
- Proctoring risk pipeline → Prisma domain model: stores alerts
- Outcome analysis → Prisma domain model: stores outcomes
- Prisma domain model → Local SQLite datastore: local persistence
- Proctoring risk pipeline → Teacher workflow: live risk data
- Outcome analysis → Student exam workflow: results
- Outcome analysis → Teacher workflow: reports