How hemeshhere/ai-based-exam-evaluation-system works
This MERN exam system supports teacher-led exam creation, student exam sessions, AI-assisted subjective grading, and published results, alongside dashboards, schedules, profiles, and issue reporting. The frontend routes role-specific users through React pages and API services; the Express backend authenticates requests, dispatches controllers, and persists domain records in MongoDB. The sampled source shows the main exam and auth flows, but several page and controller implementations were not sampled, so their internal links are omitted or documented only at the API boundary.
Main entry points: server.js HTTP server · AppRoutes.jsx Role routes · apiServices.js API services · teacherController.js Exam and grading
Components 24
Web experience
- App entry
Frontend/src/main.jsx - Role routes
Frontend/src/routes/AppRoutes.jsx - Login and auth
Frontend/src/context/AuthContext.jsx - Exam taking
Frontend/src/pages/StudentExam.jsx - Student services
Frontend/src/pages - Teacher workspace
Frontend/src/pages - API services
Frontend/src/services/apiServices.js
Backend API
- HTTP server
Backend/server.js - Auth routes
Backend/src/routes/authRoutes.js - Authentication
Backend/src/controllers/authController.js - Access control
Backend/src/middlewares/authmiddleware.js - Exam routes
Backend/src/routes/teacherRoutes.js - Student exam flow
Backend/src/controllers/studentController.js - Exam and grading
Backend/src/controllers/teacherController.js - Other API features
Backend/src/controllers
Domain data
- Student records
Backend/src/models/student.model.js - Teacher records
Backend/src/models/teacher.model.js - Exam and questions
Backend/src/models/exam.model.js - Submissions
Backend/src/models/submission.model.js - Issue records
Backend/src/models/issue.model.js
External services
- Gemini AI
- MongoDB
Other components
- Student
- Teacher
Connections 31
- App entry → Role routes: renders
- Role routes → Login and auth: uses auth state
Frontend/src/routes/AppRoutes.jsx - Role routes → Exam taking: routes to
Frontend/src/routes/AppRoutes.jsx - Student → Role routes: opens app
- Teacher → Role routes: opens app
- Login and auth → API services: calls auth APIs
Frontend/src/context/AuthContext.jsx - Student → Exam taking: takes exam
- Exam taking → API services: loads and submits
Frontend/src/pages/StudentExam.jsx - Student services → API services: uses API
Frontend/src/pages/StudentExam.jsx - Teacher workspace → API services: uses API
Frontend/src/pages/StudentExam.jsx - API services → HTTP server: HTTP requests
Frontend/src/services/apiServices.js - HTTP server → Auth routes: mounts
Backend/server.js - HTTP server → Exam routes: mounts
Backend/server.js - HTTP server → Other API features: mounts feature routes
Backend/server.js - Auth routes → Authentication: dispatches
Backend/src/routes/authRoutes.js - Exam routes → Exam and grading: dispatches
Backend/src/routes/teacherRoutes.js - Exam routes → Access control: checks role
Backend/src/routes/teacherRoutes.js - HTTP server → Student exam flow: routes student API
- Authentication → Student records: reads and creates
Backend/src/controllers/authController.js - Authentication → Teacher records: reads and creates
Backend/src/controllers/authController.js - Access control → Student records: loads identity
Backend/src/middlewares/authmiddleware.js - Access control → Teacher records: loads identity
Backend/src/middlewares/authmiddleware.js - Student exam flow → Exam and questions: reads exams
Backend/src/controllers/studentController.js - Student exam flow → Submissions: creates and updates
Backend/src/controllers/studentController.js - Exam and grading → Exam and questions: creates and reads
Backend/src/controllers/teacherController.js - Exam and grading → Submissions: reads and updates
Backend/src/controllers/teacherController.js - Exam and grading → Gemini AI: requests grading
Backend/src/controllers/teacherController.js - Other API features → Issue records: manages reports
Backend/src/controllers/dashboardController.js - HTTP server → MongoDB: connects
Backend/server.js - Teacher → Teacher workspace: manages exams
- Teacher workspace → Gemini AI: AI evaluation capability