How abdulwedud33/entrance_self_test works
This is a Grade 12 entrance-exam self-test system: students authenticate, choose an eligible subject and year, verify an exam password, answer questions, and receive scored results with answer review. Admins manage users, subjects, questions, events, exam settings, feedback, and results; instructors manage subject-scoped questions and review results. The graph groups the Next.js portals, Express API domains, shared authorization, and persistence. Frontend-to-API links reflect documented product/API capabilities; unsampled page-level calls are not asserted.
Main entry points: auth.middleware.ts Role guards · prisma.ts Prisma client · index.ts Express server · api.ts API client
Components 23
Web portals
- Student portal
frontend/src/app/student - Exam session
frontend/src/app/student/exam/page.tsx - Admin console
frontend/src/app/admin - Instructor portal
frontend/src/app/instructor - API client
frontend/src/lib/api.ts
API domains
- Express server
backend/src/index.ts - Auth routes
backend/src/routes/auth.routes.ts - Admin routes
backend/src/routes/admin.routes.ts - Administration
backend/src/controllers/admin.controller.ts - Exam routes
backend/src/routes/exam.routes.ts - Exam workflow
backend/src/controllers/exam.controller.ts - Student routes
backend/src/routes/student.routes.ts - Student services
backend/src/controllers/student.controller.ts - Instructor routes
backend/src/routes/instructor.routes.ts - Instructor services
backend/src/controllers/instructor.controller.ts
Identity and access
- Authentication
backend/src/controllers/auth.controller.ts - Role guards
backend/src/middleware/auth.middleware.ts - JWT helpers
backend/src/utils/jwt.ts
Persistence
- Prisma client
backend/src/utils/prisma.ts - PostgreSQL
Other components
- Student
- Administrator
- Instructor
Connections 33
- Student → Student portal: uses portal
- Student portal → API client: requests data
- Student portal → Exam session: opens exam
- Exam session → API client: submits answers
- Administrator → Admin console: uses portal
- Admin console → API client: requests data
- Instructor → Instructor portal: uses portal
- Instructor portal → API client: requests data
- API client → Express server: calls API
- Express server → Auth routes: mounts routes
backend/src/index.ts - Express server → Admin routes: mounts routes
backend/src/index.ts - Express server → Exam routes: mounts routes
backend/src/index.ts - Express server → Student routes: mounts routes
backend/src/index.ts - Express server → Instructor routes: mounts routes
backend/src/index.ts - Auth routes → Authentication: dispatches
backend/src/routes/auth.routes.ts - Auth routes → Role guards: uses guard
backend/src/routes/auth.routes.ts - Admin routes → Administration: dispatches
backend/src/routes/admin.routes.ts - Admin routes → Role guards: checks roles
backend/src/routes/admin.routes.ts - Exam routes → Exam workflow: dispatches
backend/src/routes/exam.routes.ts - Exam routes → Role guards: checks student
backend/src/routes/exam.routes.ts - Student routes → Student services: dispatches
backend/src/routes/student.routes.ts - Student routes → Role guards: checks student
backend/src/routes/student.routes.ts - Instructor routes → Instructor services: dispatches
backend/src/routes/instructor.routes.ts - Instructor routes → Role guards: checks instructor
backend/src/routes/instructor.routes.ts - Authentication → JWT helpers: signs tokens
backend/src/controllers/auth.controller.ts - Role guards → JWT helpers: verifies tokens
backend/src/middleware/auth.middleware.ts - Authentication → Prisma client: reads accounts
backend/src/controllers/auth.controller.ts - Role guards → Prisma client: loads scope
backend/src/middleware/auth.middleware.ts - Administration → Prisma client: manages records
backend/src/controllers/admin.controller.ts - Exam workflow → Prisma client: loads and saves
backend/src/controllers/exam.controller.ts - Student services → Prisma client: reads and writes
backend/src/controllers/student.controller.ts - Instructor services → Prisma client: queries results
backend/src/controllers/instructor.controller.ts - Prisma client → PostgreSQL: persists data