How cegit27/moodle-proctor works
What this project is (type + purpose)
From the repo root and the file tree, this looks like a frontend-only (in this repo) Next.js application for an AI-powered online proctoring system integrated with Moodle.
Key signals:
• frontend/next.config.ts, frontend/app/..., page.tsx, layout.tsx → Next.js (App Router) web UI.
• frontend/src/services/api.ts → an HTTP API client to talk to a backend (not present in this repo).
• frontend/src/services/socket.ts + frontend/src/hooks/useSocket.ts → a WebSocket/Socket-based realtime channel (typical for proctoring: live status, events, video session signaling, alerts).
• UI composition in src/components/* and feature routes in app/dashboard, app/exams, app/login.
Top-level
• README.md → minimal, but clearly “Moodle Proctoring” domain.
• frontend/ → the deployable web app.
Next.js “feature slices” (routes)
• frontend/app/login/page.tsx → Login flow
• frontend/app/dashboard/page.tsx → Proctor dashboard / overview
• frontend/app/exams/page.tsx → Exams list / exam sessions
Also:
• frontend/app/layout.tsx → root layout (global nav, providers, theming)
• frontend/app/globals.css → styling baseline
Reusable UI building blocks
• src/components/Navbar.tsx
• src/components/AlertPanel.tsx (proctoring alerts are core)
• src/components/StudentCard.tsx (candidate status card)
• src/components/VideoGrid.tsx (live candidate streams / thumbnails)
Integration points (critical
These become connectors to external containers:
• src/services/api.ts → “Proctoring Backend REST API”
• src/services/socket.ts → “Realtime Server (WebSocket/Socket.IO)”
• src/hooks/useSocket.ts → the client-side wiring to realtime
• src/utils/constants.ts → environment/config values (API base URL, socket URL)
• src/types/student.ts → data contracts (student/candidate model)
Authentication
• User logs in via LoginPage
• Frontend calls Backend Auth endpoint (or Moodle SSO/LTI redirect)
Exam monitoring
• ExamsPage loads exam list via api.ts
• Selecting an exam loads roster/candidates
• DashboardPage subscribes to live events via useSocket
Realtime proctoring events
• Candidate events (face not detected, tab switch, multiple people) flow:
AI Engine → Backend → Realtime Server → Frontend socket.ts → UI (AlertPanel, StudentCard badges)
Video / media
• VideoGrid strongly suggests live video tiles.
• If the transport isn’t in repo (no WebRTC code visible), represent it as:
• “Video stream source (WebRTC/RTSP/3rd-party)” external to frontend
• UI receives stream URLs/tokens from backend, then renders streams
Diagramming conventions to use (clarity + detail)
Use these elements consistently:
• Clear labels:
• “Next.js Frontend (App Router)”
• “API Client (src/services/api.ts)”
• “Socket Client (src/services/socket.ts)”
• “Socket Hook (src/hooks/useSocket.ts)”
• “Moodle LMS (External)”
• “Proctoring Backend (External)”
• “Realtime Server (External)”
• HTTPS/JSON: exam roster
• WSS: candidateStatusChanged event
• HTTPS: auth/SSO
• Blue: UI/pages/components
• Purple: frontend integration code (API/socket)
• Orange: backend services
• Grey: external systems (Moodle, AI, storage)
• Granularity rule (don’t overthink, split more):
• Page (/login, /dashboard, /exams) as its own node.
• Key component (AlertPanel, VideoGrid, etc.) as its own node.
• Integration client (api.ts, socket.ts) as its own node.
Frontend components
• Routes: LoginPage, DashboardPage, ExamsPage
• Layout: RootLayout
• Components: Navbar, AlertPanel, VideoGrid, StudentCard
• Services: api.ts, socket.ts, useSocket.ts
• Shared: constants.ts, student.ts
That combination will be detailed, honest about what’s actually in the repo, and still represent the full “moodle-proctor” system as it must exist in production.