Skip to content

Ali-Islam111/Horas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

85 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ Horas β€” AI-Powered Online Exam Proctoring System

A full-stack, real-time proctoring platform built for the modern academic environment. Graduation Project β€” Faculty of Computers & Artificial Intelligence

FastAPI Python React PyTorch License: MIT


🎬 Demo

Watch the full system demo below:

Project-demo.mp4

If the video does not play inline, click here to download the demo.


πŸ“‹ Table of Contents

  1. Overview
  2. Key Features
  3. Tech Stack
  4. System Architecture
  5. Database ERD
  6. Installation
  7. Configuration
  8. Running the System
  9. API Reference
  10. Project Structure
  11. Future Roadmap
  12. Team & Acknowledgements

🧭 Overview

Horas is an intelligent, real-time online exam proctoring system designed to uphold academic integrity without requiring physical invigilation. It combines a FastAPI backend, a React frontend, and a dedicated AI Engine that analyzes live webcam feeds using computer vision models to detect and log suspicious behavior during exams.

The name Horas derives from the Arabic word for "guardian" β€” the system acts as a silent, impartial invigilator, ensuring fair assessments regardless of geography.


✨ Key Features

  • πŸ” JWT + Google OAuth2 Authentication β€” Secure, dual-mode login supporting both traditional credentials and Google Sign-In.
  • 🎭 Role-Based Access Control β€” Distinct student, teacher, and admin roles with guarded API routes.
  • πŸ“ Full Exam Lifecycle Management β€” Teachers create exams with MCQ questions; students enroll and submit via access code.
  • πŸ“Š Automatic Scoring Engine β€” Weighted point-per-question grading with configurable total/passing marks.
  • πŸ‘οΈ Real-Time AI Proctoring β€” Live video frames streamed over WebSocket to an AI pipeline that detects:
    • Gaze deviation & head pose anomalies
    • Foreign object detection via YOLO (phones, books)
    • Behavioral anomaly detection (IForest / LSTM)
  • 🚦 AI Readiness Gate β€” Exam submission is blocked until the AI engine confirms it is calibrated and ready.
  • πŸ“„ PDF Proctoring Reports β€” Auto-generated after each session with a full event log; securely downloadable by teacher or student.
  • πŸ“‘ Structured Event Logging β€” Every AI anomaly is persisted to the DB with timestamp, category, description, and evidence screenshot path.

πŸ› οΈ Tech Stack

Layer Technology
Backend Framework FastAPI (Python 3.10+)
Frontend React 18
AI / ML Engine PyTorch, MediaPipe, Ultralytics YOLO, DeepFace / ArcFace
Anomaly Detection Isolation Forest, LSTM (custom-trained)
Database ORM SQLAlchemy + SQLite (dev) / PostgreSQL (prod-ready)
Data Validation Pydantic v2
Authentication JWT (python-jose), Google OAuth2 (Authlib)
Real-Time Transport WebSockets (FastAPI native)
Report Generation ReportLab (PDF)
Dev Tools Uvicorn, python-dotenv

πŸ—οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  Horas AI Proctoring Platform                β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚   Student UI    β”‚              β”‚     Teacher UI       β”‚   β”‚
β”‚  β”‚   (React)       β”‚              β”‚     (React)          β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚           β”‚  REST + WebSocket          REST  β”‚               β”‚
β”‚           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β”‚
β”‚                           β”‚                                  β”‚
β”‚          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”            β”‚
β”‚          β”‚        FastAPI Backend               β”‚            β”‚
β”‚          β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚            β”‚
β”‚          β”‚  β”‚  Routers (auth/exam/session/  β”‚   β”‚            β”‚
β”‚          β”‚  β”‚  questions/events/users/ws)   β”‚   β”‚            β”‚
β”‚          β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚            β”‚
β”‚          β”‚                 β”‚                    β”‚            β”‚
β”‚          β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚            β”‚
β”‚          β”‚  β”‚  Services Layer              β”‚    β”‚            β”‚
β”‚          β”‚  β”‚  β€’ ProctoringManager         β”‚    β”‚            β”‚
β”‚          β”‚  β”‚  β€’ ScoringEngine             β”‚    β”‚            β”‚
β”‚          β”‚  β”‚  β€’ ReportGenerator           β”‚    β”‚            β”‚
β”‚          β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚            β”‚
β”‚          β”‚                 β”‚                    β”‚            β”‚
β”‚          β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚            β”‚
β”‚          β”‚  β”‚  SQLAlchemy ORM β†’ SQLite/PG  β”‚    β”‚            β”‚
β”‚          β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚            β”‚
β”‚          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜            β”‚
β”‚                           β”‚ WebSocket frames                 β”‚
β”‚          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”            β”‚
β”‚          β”‚          AI Engine (Python)          β”‚            β”‚
β”‚          β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚            β”‚
β”‚          β”‚  β”‚  β€’ Head Pose Estimation      β”‚    β”‚            β”‚
β”‚          β”‚  β”‚  β€’ Gaze Tracking             β”‚    β”‚            β”‚
β”‚          β”‚  β”‚  β€’ YOLO Object Detection     β”‚    β”‚            β”‚
β”‚          β”‚  β”‚  β€’ Anomaly Detection         β”‚    β”‚            β”‚
β”‚          β”‚  β”‚    (IForest / LSTM)          β”‚    β”‚            β”‚
β”‚          β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚            β”‚
β”‚          β”‚  Logs events β†’ POST /api/events/log  β”‚            β”‚
β”‚          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜            β”‚
β”‚                                                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”‚
β”‚  β”‚  Mobile App (Flutter)  ← Planned / Future        β”‚        β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ—„οΈ Database ERD

Reverse-engineered directly from the SQLAlchemy models.

Database Entity Relationship Diagram

Relationship Summary

Relationship Cardinality Cascade
User β†’ Exams One-to-Many (teacher creates exams) β€”
User β†’ Sessions One-to-Many (student takes exams) β€”
Exam β†’ Questions One-to-Many delete-orphan
Exam β†’ Sessions One-to-Many delete-orphan
Session β†’ Events One-to-Many delete-orphan

βš™οΈ Installation

Prerequisites (required for both methods)

  • Python 3.10+
  • Node.js 18+ & npm
  • Git

⚑ Option A β€” One-Click Setup (Recommended for Windows)

  1. Download only the project_setup.bat script and place it where you want to install the project.
  2. Right-click project_setup.bat β†’ Run as Administrator.
  3. The script will automatically:
    • Create a Python virtual environment
    • Install all backend dependencies (requirements.txt)
    • Install all frontend dependencies (npm install)
    • Verify GPU availability for the AI engine

πŸ”§ Option B β€” Manual Setup

Caution

Dependencies must be installed in the exact order below to prevent binary conflicts between PyTorch, MediaPipe, and Whisper.

Step 1: Clone the repository

git clone https://github.com/Ali-Islam111/Horas-Demo.git
cd "Horas"

Step 2: Create and activate a virtual environment

# Windows (use the Python Launcher to pin the exact version)
py -3.10 -m venv venv
venv\Scripts\activate

# Linux / macOS
python3 -3.10 -m venv venv
source venv/bin/activate

Step 3 β€” Install GPU-Accelerated PyTorch

Install the CUDA 12.1 PyTorch wheels first. This ensures YOLO and DeepFace utilize the GPU instead of defaulting to slower CPU binaries.

pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121

Step 4 β€” Prevent Audio Library Conflicts

faster-whisper will break if ctranslate2 is not installed first. Lock in the correct binaries before proceeding.

pip install ctranslate2>=4.0.0

Step 5 β€” Install Remaining Dependencies

Once the core ML binaries are locked in, install the rest of the web server and AI dependencies.

# Run from the repository root:
pip install -r backend/requirements.txt

Step 6 β€” Install frontend dependencies

cd frontend
npm install
cd ..

πŸ”‘ Configuration (Environment Variables)

Create a .env file in the backend/ directory. Use the template below:

# ─── Application ─────────────────────────────────────────────
SECRET_KEY=your-super-secret-jwt-key-change-this-in-production
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=60

# ─── Database ────────────────────────────────────────────────
# SQLite (default for local dev):
DATABASE_URL=sqlite:///./horas.db

# PostgreSQL (production-ready alternative):
# DATABASE_URL=postgresql://user:password@localhost:5432/horas_db 

# ─── Google OAuth2 ───────────────────────────────────────────
GOOGLE_CLIENT_ID=your-google-client-id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your-google-client-secret
GOOGLE_REDIRECT_URI=http://localhost:8000/auth/google/callback

# ─── Frontend ────────────────────────────────────────────────
FRONTEND_URL=http://localhost:3000

Note: Never commit your .env file. It is already listed in .gitignore.


πŸš€ Running the System

Using the Startup Script (Windows β€” Recommended)

  1. Place server_startup.bat in the project root directory (same level as backend/ and frontend/).
  2. Right-click β†’ Run as Administrator.

The script will launch the FastAPI backend, wait for it to become healthy, then start the React frontend and open your browser automatically.

Manual Start

Terminal 1 β€” Backend API Server:

cd backend
python main.py

Terminal 2 β€” Frontend Dev Server:

cd frontend
npm run dev
Service URL
Backend API http://localhost:8000
Interactive API Docs (Swagger) http://localhost:8000/docs
Alternative API Docs (ReDoc) http://localhost:8000/redoc
Frontend App http://localhost:3000

πŸ“‘ API Reference

All REST endpoints are prefixed with /api (e.g. http://localhost:8000/api/auth/login). The WebSocket endpoint is served at the root level without this prefix.

πŸ” Authentication

Method Route Auth Required Role Description
POST /auth/register ❌ Any Register a new user account
POST /auth/login ❌ Any Login; returns a JWT Bearer token
GET /auth/google ❌ Any Redirect to Google OAuth2 login page
GET /auth/google/callback ❌ Any Google OAuth2 callback; issues JWT & redirects to frontend

πŸ‘€ Users

Method Route Auth Required Role Description
GET /users/ βœ… Any Get all registered users
GET /users/me βœ… Any Get the currently authenticated user's profile
GET /users/{user_id} βœ… Any Get a specific user by ID

πŸ“ Exams

Method Route Auth Required Role Description
POST /exams/ βœ… Teacher Create a new exam (with questions in one batch)
GET /exams/my-exams βœ… Teacher Get all exams created by the authenticated teacher
GET /exams/ βœ… Any Get a list of all available exams
GET /exams/{exam_id} βœ… Any Get a specific exam's full metadata
DELETE /exams/{exam_id} βœ… Teacher Delete an exam (owner only; cascades to sessions & questions)

❓ Questions

Method Route Auth Required Role Description
POST /questions/{exam_id} βœ… Teacher Add a single question to an existing exam
GET /questions/{exam_id} βœ… Any Get all questions; teachers see correct_choice, students do not

πŸ§ͺ Sessions

Method Route Auth Required Role Description
POST /sessions/enroll/{exam_id} βœ… Student Enroll in an exam; creates (or returns existing) session
POST /sessions/{session_id}/submit βœ… Student Submit answers; triggers scoring; blocked if AI not ready
GET /sessions/my-submissions βœ… Student Get all of the student's own exam sessions
GET /sessions/all-submissions βœ… Teacher Get all student sessions for the teacher's exams
GET /sessions/{session_id}/events βœ… Teacher Get all proctoring event logs for a specific session
GET /sessions/{session_id}/ai-status βœ… Any Poll AI readiness status (waiting/initializing/ready/failed)
GET /sessions/my-reports βœ… Student Get all sessions with a generated proctoring PDF report
GET /sessions/{session_id}/report βœ… Teacher/Student Stream-download the proctoring PDF for a session
GET /sessions/reports/student/{user_id} βœ… Teacher Get all reports for a specific student (teacher's exams only)

🚨 Proctoring Events

Method Route Auth Required Role Description
POST /events/log ❌* AI Engine Internal: AI engine POSTs a detected anomaly event to persist it

*The /events/log endpoint is called internally by the AI Engine process running server-side and does not require a user JWT in the current implementation.

πŸ“‘ Live Streaming (WebSocket)

Note

The WebSocket router is registered without the /api prefix. Connect to ws://localhost:8000/ws/sessions/{session_id} directly.

Protocol Route Description
WS ws://localhost:8000/ws/sessions/{session_id} Bi-directional: frontend streams raw video frames β†’ AI engine processes and returns real-time alerts

πŸ“ Project Structure

Horas Demo V1.0/
β”‚
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ main.py                        # FastAPI app entrypoint β€” registers all routers,
β”‚   β”‚                                  #   CORS, SessionMiddleware, and DB creation
β”‚   β”œβ”€β”€ requirements.txt               # Python dependency list (pip freeze)
β”‚   β”œβ”€β”€ yolo11n.pt                     # YOLOv11-nano weights file (object detection)
β”‚   β”œβ”€β”€ database_seeder.py             # One-off script to populate DB with test data
β”‚   β”‚
β”‚   β”œβ”€β”€ core/
β”‚   β”‚   β”œβ”€β”€ config.py                  # Pydantic Settings β€” loads all .env variables
β”‚   β”‚   β”œβ”€β”€ database.py                # SQLAlchemy engine, SessionLocal, create_tables()
β”‚   β”‚   β”œβ”€β”€ security.py                # bcrypt hashing, JWT create/verify
β”‚   β”‚   β”œβ”€β”€ dependencies.py            # FastAPI Depends guards: get_current_user/teacher/student
β”‚   β”‚   └── crud/                      # All DB query helpers (users, exams, sessions, questions)
β”‚   β”‚        β”œβ”€β”€ user.py                    
β”‚   β”‚        β”œβ”€β”€ exam.py                    
β”‚   β”‚        β”œβ”€β”€ questions.py               
β”‚   β”‚        └── session.py                 
β”‚   β”‚
β”‚   β”œβ”€β”€ models/                        # SQLAlchemy ORM β€” defines the actual DB tables
β”‚   β”‚   β”œβ”€β”€ user.py                    # users table
β”‚   β”‚   β”œβ”€β”€ exam.py                    # exams table (FK β†’ users)
β”‚   β”‚   β”œβ”€β”€ questions.py               # questions table (FK β†’ exams, stores choices as JSON)
β”‚   β”‚   β”œβ”€β”€ session.py                 # sessions table (FK β†’ users + exams, stores answers as JSON)
β”‚   β”‚   └── events.py                  # events table (FK β†’ sessions, AI anomaly log)
β”‚   β”‚
β”‚   β”œβ”€β”€ schemas/                       # Pydantic v2 β€” request/response validation shapes
β”‚   β”‚   β”œβ”€β”€ auth.py                    # UserCreate, UserResponse, Token, TokenData
β”‚   β”‚   β”œβ”€β”€ exam.py                    # ExamCreate, ExamCreateBatch, ExamResponse
β”‚   β”‚   β”œβ”€β”€ questions.py               # QuestionCreate, QuestionResponse, QuestionTeacherResponse
β”‚   β”‚   β”œβ”€β”€ session.py                 # SessionCreate/Response, StudentAnswerSubmit,
β”‚   β”‚   β”‚                                SubmissionResult, AIStatusResponse, ReportListItem
β”‚   β”‚   └── events.py                  # EventCreate, EventOut
β”‚   β”‚
β”‚   β”œβ”€β”€ routers/                       # FastAPI route handler files (one per domain)
β”‚   β”‚   β”œβ”€β”€ auth.py                    # POST /auth/register, /auth/login, GET /auth/google*
β”‚   β”‚   β”œβ”€β”€ users.py                   # GET /users/, /users/me, /users/{id}
β”‚   β”‚   β”œβ”€β”€ exam.py                    # CRUD for /exams/ (teacher-gated creates/deletes)
β”‚   β”‚   β”œβ”€β”€ questions.py               # POST/GET /questions/{exam_id}
β”‚   β”‚   β”œβ”€β”€ session.py                 # Full session lifecycle: enroll β†’ submit β†’ reports
β”‚   β”‚   β”œβ”€β”€ events.py                  # POST /events/log (internal AI β†’ DB bridge)
β”‚   β”‚   └── streaming.py               # WS /ws/sessions/{id} (live video frame pipeline)
β”‚   β”‚
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ proctoring_manager.py      # WebSocket connection registry; routes frames to
β”‚   β”‚   β”‚                                ProctoringSession; tracks per-session AI status
β”‚   β”‚   └── exam_scoring.py            # ScoringEngine.calculate_score() β€” weighted MCQ grading
β”‚   β”‚
β”‚   └── AI_engine/                     # Self-contained CV/ML proctoring pipeline
β”‚       β”œβ”€β”€ config.py                  # All AI tunables: thresholds, paths, model settings
β”‚       β”œβ”€β”€ core.py                    # AlertHook, AttentionScore, play_alert() β€” shared primitives
β”‚       β”œβ”€β”€ main.py                    # run() β€” top-level proctoring loop; draws HUD on frames
β”‚       β”œβ”€β”€ proctoring_session.py      # ProctoringSession β€” per-student thread; starts/stops detectors
β”‚       β”œβ”€β”€ offline_trainer.py         # CLI tool: trains IForest & LSTM on collected datasets
β”‚       β”œβ”€β”€ yolo11n.pt                 # YOLO weights copy inside AI_engine
β”‚       β”‚
β”‚       β”œβ”€β”€ detectors/                 # One file per detection modality
β”‚       β”‚   β”œβ”€β”€ head_pose.py           # HeadPoseDetector β€” MediaPipe + solvePnP yaw/pitch/roll
β”‚       β”‚   β”œβ”€β”€ face_signals.py        # GazeDetector, LipMovementDetector, GlowDetector, BlinkDetector
β”‚       β”‚   β”œβ”€β”€ object_detector.py     # ObjectDetector β€” async YOLO inference on background thread
β”‚       β”‚   β”œβ”€β”€ anomaly.py             # IForestDetector, LSTMAutoencoder β€” unsupervised anomaly scoring
β”‚       β”‚   β”œβ”€β”€ audio.py               # MicMonitor β€” volume, faster-whisper transcription, YAMNet events
β”‚       β”‚   β”œβ”€β”€ identity.py            # IdentityVerifier β€” ArcFace face enrollment + frame verification
β”‚       β”‚   β”œβ”€β”€ dataset_collector.py   # DatasetCollector β€” snapshots frames + metadata to disk for retraining
β”‚       β”‚   β”œβ”€β”€ llm_verifier.py        # Gemini API vision fallback for ambiguous cheating frames
β”‚       β”‚   └── one_euro_filter.py     # 1€ smoothing filter for noisy landmark coordinates
β”‚       β”‚
β”‚       β”œβ”€β”€ reports/
β”‚       β”‚   └── pdf_report.py          # generate() β€” full PDF evidence report with sparklines & snapshots
β”‚       β”‚
β”‚       β”œβ”€β”€ evidence/                  # Runtime: AI stores screenshot evidence here
β”‚       β”œβ”€β”€ session_reports/           # Runtime: generated PDF reports stored here
β”‚       β”œβ”€β”€ saved_models/              # Runtime: persisted IForest & LSTM model files
β”‚       β”œβ”€β”€ dataset/                   # Runtime: DatasetCollector frame snapshots per category
β”‚       └── reference_faces/           # Runtime: ArcFace enrollment embeddings per student
β”‚
β”œβ”€β”€ frontend/                          # React 18 + Vite web application
β”‚   β”œβ”€β”€ index.html                     # Vite HTML entry point
β”‚   β”œβ”€β”€ vite.config.js                 # Vite config (proxy, plugins)
β”‚   β”œβ”€β”€ package.json                   # npm dependencies & scripts
β”‚   β”œβ”€β”€ eslint.config.js               # ESLint rules
β”‚   β”‚
β”‚   └── src/
β”‚       β”œβ”€β”€ main.jsx                   # React DOM root mount
β”‚       β”œβ”€β”€ App.jsx                    # Top-level router β€” maps URL query params to page components
β”‚       β”œβ”€β”€ App.css / index.css        # Global styles & CSS variables
β”‚       β”‚
β”‚       β”œβ”€β”€ components/                # Page-level React components (one file = one screen/page)
β”‚       β”‚   β”œβ”€β”€ LandingPage.jsx        # Public home page β€” hero, features, CTA
β”‚       β”‚   β”œβ”€β”€ Login.jsx              # Login form with role selector (student / teacher)
β”‚       β”‚   β”œβ”€β”€ CreateAccount.jsx      # Registration form with validation
β”‚       β”‚   β”œβ”€β”€ GoogleCallback.jsx     # Handles /auth/callback redirect from Google OAuth
β”‚       β”‚   β”œβ”€β”€ CookieBanner.jsx       # GDPR cookie consent banner
β”‚       β”‚   β”‚
β”‚       β”‚   β”œβ”€β”€ StudentDashboard.jsx   # Student home β€” exam list, enroll, history
β”‚       β”‚   β”œβ”€β”€ StudentExam.jsx        # Exam-taking UI β€” timer, question nav, webcam feed
β”‚       β”‚   β”œβ”€β”€ AIInitializingScreen.jsx # Blocks exam start; polls AI readiness status
β”‚       β”‚   β”œβ”€β”€ ExamSubmission.jsx     # Post-submit score screen with pass/fail feedback
β”‚       β”‚   β”‚
β”‚       β”‚   β”œβ”€β”€ ExaminerDashboard.jsx  # Teacher home β€” stats overview, exam list
β”‚       β”‚   β”œβ”€β”€ ExamCreation.jsx       # Multi-step exam builder with question editor
β”‚       β”‚   β”œβ”€β”€ ExaminerExam.jsx       # Teacher exam detail view β€” metadata, questions
β”‚       β”‚   β”œβ”€β”€ ExaminerStudents.jsx   # Student submission table for a teacher's exam
β”‚       β”‚   β”œβ”€β”€ ExaminerAlerts.jsx     # Proctoring event log viewer per session
β”‚       β”‚   β”œβ”€β”€ ExaminerSettings.jsx   # Teacher account & platform settings
β”‚       β”‚   β”‚
β”‚       β”‚   β”œβ”€β”€ ProctoringMonitor.jsx  # Live WebSocket status dashboard during exam
β”‚       β”‚   └── ExamReportScreen.jsx   # Full PDF-style report viewer with evidence timeline
β”‚       β”‚
β”‚       β”œβ”€β”€ controllers/               # Custom hooks β€” business logic decoupled from UI
β”‚       β”‚   β”œβ”€β”€ useAuthController.js   # Login/register state, role switching
β”‚       β”‚   └── useExamController.js   # Exam CRUD, enroll, answer, submit, submissions
β”‚       β”‚
β”‚       β”œβ”€β”€ hooks/
β”‚       β”‚   └── useExamCreation.js     # Multi-step exam creation form state machine
β”‚       β”‚
β”‚       β”œβ”€β”€ services/                  # Raw API call wrappers (fetch/axios)
β”‚       β”‚   β”œβ”€β”€ authService.js         # login(), register(), getProfile(), setSession()
β”‚       β”‚   β”œβ”€β”€ examService.js         # CRUD for exams + questions; parseExamFile() via AI
β”‚       β”‚   β”œβ”€β”€ sessionService.js      # enrollExam(), submitExam(), getMySubmissions(), getAIStatus()
β”‚       β”‚   β”œβ”€β”€ proctoringService.js   # WebSocket client: connectProctoringWS(), sendFrame(), close()
β”‚       β”‚   └── geminiService.js       # Client-side Gemini API integration for exam file parsing
β”‚       β”‚
β”‚       β”œβ”€β”€ contexts/
β”‚       β”‚   └── LanguageContext.jsx    # i18n context provider; useLanguage() hook
β”‚       β”‚
β”‚       β”œβ”€β”€ i18n/
β”‚       β”‚   └── translations.js        # AR/EN translation strings (~58 KB, full bilingual UI)
β”‚       β”‚
β”‚       └── utils/
β”‚           └── routeMapping.js        # URL ↔ page name mapping helpers
β”‚
β”œβ”€β”€ frontend/mobile app/               # Flutter mobile app (Android, iOS, Web)
β”‚   β”œβ”€β”€ pubspec.yaml                   # Flutter dependency manifest
β”‚   └── lib/
β”‚       β”œβ”€β”€ main.dart                  # App entry point, MaterialApp root
β”‚       β”œβ”€β”€ models/models.dart         # JSON-serializable data models (User, Exam, etc.)
β”‚       β”œβ”€β”€ services/api_service.dart  # Singleton HTTP client β€” wraps all backend API calls
β”‚       └── screens/                   # One file per screen
β”‚           β”œβ”€β”€ login_screen.dart
β”‚           β”œβ”€β”€ create_account_screen.dart
β”‚           β”œβ”€β”€ student_dashboard_screen.dart
β”‚           β”œβ”€β”€ student_exam_screen.dart
β”‚           β”œβ”€β”€ examiner_dashboard_screen.dart
β”‚           β”œβ”€β”€ exam_creation_screen.dart
β”‚           └── proctoring_monitor_screen.dart
β”‚
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ COMPLETE-FUNCTIONS-LIST.md     # Granular breakdown of all 200+ internal functions
β”‚   β”œβ”€β”€ Exam Session Interaction.png   # Database ERD diagram
β”‚   β”œβ”€β”€ Project-demo.mp4               # Full system demonstration video
β”‚   └── Graduuation Project Report- 2026.docx
β”‚
β”œβ”€β”€ project_setup.bat                  # One-click Windows installer (clones, venv, deps)
β”œβ”€β”€ server_startup.bat                 # Launches backend + frontend + opens browser
β”œβ”€β”€ Exam_Monitor_Postman_Collection.json  # Ready-to-import Postman test suite
└── README.md

πŸ“– For a granular breakdown of all 200+ internal functions across every module, see COMPLETE-FUNCTIONS-LIST.md.


πŸ—ΊοΈ Future Roadmap

  • Mobile App β€” Develop a Flutter-based cross-platform client (Android/iOS) to extend exam access beyond web browsers.
  • Dockerization β€” Containerize the FastAPI backend, AI Engine, and React frontend into a single docker-compose stack for zero-friction deployment.
  • PostgreSQL Migration β€” Transition from the local SQLite database to a managed PostgreSQL instance for production scalability and concurrent write support.
  • Admin Dashboard β€” A dedicated admin panel for user management, platform-wide analytics, and system health monitoring.
  • Live Alerts to Teacher β€” Push real-time proctoring alerts to the teacher's dashboard via a second WebSocket channel.
  • Question Bank β€” Allow teachers to maintain a reusable pool of questions across multiple exams.

πŸ‘₯ Team & Acknowledgements

This project was developed as a graduation project.

Name Role GitHub LinkedIn
Ibrahim Mohammed Al-Batrawshy Team Lead & Frontend Developer IbrahimAlBatrawshy Ibrahim Al-Batrawshy
Ali Islam Taha Backend Lead Ali-Islam111 Ali Islam
Mohammed Emad Mohammed Backend Developer mohamedemad6244 β€”
Saif El-Dien El-Saied Mohammed AI Engineer saifs22 Saif El Dien El Saied
Karim Abdel-Hakim Amer AI Engineer Karim-Abdel-Hakim-Amer Karim Abd-Elhakim
Amr Bakr Data Scientist AmrBakr12 Amr Bakr
Moamen Hekal DevOps Engineer MoamenHekal Moamen Hekal

We would like to thank our academic supervisor: Dr.Mahmoud Mounir Mahmoud for his guidance throughout the project.


Made with ❀️ for the love of clean architecture and academic integrity.

About

Horas is an AI-powered proctoring system designed to ensure academic integrity in online assessments through real-time monitoring and automated behavior analysis.

Topics

Resources

Stars

Watchers

Forks

Used by

Contributors

Languages