How luun0/trustexam-ideal-structure works
TrustExam is an online-proctoring application with student and proctor roles. Students join an exam, answer questions, share their screen and camera, and are monitored for violations; proctors monitor students, chat, record assessments, and review recordings. The frontend separates exam, monitoring, media, and socket concerns, while backend HTTP and socket entry points dispatch to application services and repositories. README documents additional grading and exam capabilities. Some frontend wiring and backend domain details are represented from README and the tree; those source files were not sampled.
Main entry points: StudentService.ts Student Service · StudentExam.tsx Exam UI · Routes.ts HTTP Routes · ProctorDashboard.tsx Proctor Dashboard
Components 27
Student Experience
- Role Login
src/presentation/App.tsx - Exam UI
src/presentation/StudentExam.tsx - Exam Controls
src/application/hooks - AI Proctoring
src/application/hooks/useProctoring.ts - Media Recording
src/application/hooks/useRecording.ts - Student API
src/application/api/studentApi.ts - Recording API
src/application/api/recordingApi.ts
Proctor Experience
- Proctor Dashboard
src/presentation/ProctorDashboard.tsx - Monitoring Socket
src/application/hooks/useProctorSocket.ts - Chat Views
src/presentation - Socket Client
src/infrastructure/socketClient.ts
Backend Runtime
- HTTP Routes
back/presentation/Routes.ts - Socket Events
back/presentation/SocketHandler.ts - Student Service
back/application/StudentService.ts - Recording Service
back/application/RecordingService.ts - Exam Rules
back/domain - Student Broadcast
back/application/BroadcastNotifier.ts - Ban Gateway
back/infrastructure/socket/BanGateway.ts - Server Bootstrap
back/server.ts
State and Storage
- Repository Contracts
back/infrastructure/repositories/IRepositories.ts - Student Store
back/infrastructure/repositories/InMemoryStudentRepository.ts - Recording Files
back/infrastructure/repositories/FileRecordingRepository.ts
Shared Contracts
- Shared Types
shared/types
Other components
- Student
- Proctor
- Camera and Screen
- AI Model CDN
Connections 36
- Student → Role Login: signs in
- Proctor → Role Login: signs in
- Role Login → Exam UI: opens exam
- Role Login → Proctor Dashboard: opens dashboard
- Exam UI → Exam Controls: uses controls
- Exam UI → AI Proctoring: starts monitoring
- Exam UI → Media Recording: starts recording
- Exam UI → Student API: submits answers
- Exam UI → Socket Client: joins exam
- Media Recording → Camera and Screen: captures media
- AI Proctoring → Camera and Screen: reads camera
- AI Proctoring → AI Model CDN: loads models
- AI Proctoring → Socket Client: reports violations
- Media Recording → Recording API: uploads chunks
- Proctor Dashboard → Monitoring Socket: uses monitoring
- Proctor Dashboard → Student API: updates students
- Proctor Dashboard → Recording API: lists recordings
- Proctor Dashboard → Socket Client: joins as proctor
- Chat Views → Socket Client: sends chat
- Student API → HTTP Routes: calls REST
- Recording API → HTTP Routes: calls REST
- Socket Client → Socket Events: exchanges events
- Server Bootstrap → HTTP Routes: mounts routes
- Server Bootstrap → Socket Events: registers events
- HTTP Routes → Student Service: dispatches student actions
- HTTP Routes → Recording Service: dispatches recording actions
- Socket Events → Student Service: dispatches student events
- Student Service → Student Store: reads and writes
- Student Service → Student Broadcast: notifies updates
- Student Service → Ban Gateway: requests bans
- Student Service → Exam Rules: grades answers
- Recording Service → Recording Files: reads and writes
- Recording Service → Student Service: updates recording state
- HTTP Routes → Recording Service: streams recordings
- Student Store → Repository Contracts: implements
- Recording Files → Repository Contracts: implements