# laoode/eduview architecture

> Architecture diagram of the GitHub repository laoode/eduview, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/laoode/eduview
- Repository: https://github.com/laoode/eduview

## Overview

##### Main Components
- Frontend/UI:
- The “object_cheating/components” directory includes modules like camera_feed, coordinate_panel, detection_display, stats_panel, and controls. These represent the dynamic panels and control widgets that make up the user interface.
- The “assets” and “images” directories supply static files (CSS animations, images for the app view, etc.) that will be referenced in the UI.
- Backend/Processing:
- The core functionality is contained within the “object_cheating/object_cheating.py” file and related state management (e.g., “object_cheating/states/camera_state.py”). These handle the logic of real-time camera monitoring and state handling.
- The “object_cheating/utils” (with modules like eye_tracker.py) support specific analytical functions for tracking eye movement.
- AI & Detection Engines:
- Within “object_cheating/models” you see model files (e.g., YOLO and custom CNN models, plus a Mediapipe-related face_landmarker) which are used for object detection, facial recognition, and head movement analysis.
- Data Sources:
- The “uploaded_files” directory contains sample video files that serve as inputs or test cases for detection.
- Configuration & Integration:
- Files like “rxconfig.py” and the “requirements.txt” define the configuration and dependencies for the Reflex (full-stack) framework that integrates the frontend, backend, and machine learning modules.

##### Relationships and Interactions
- Data Flow:
- Video feeds (from live cameras or uploaded exam footage) are captured via the frontend components (camera_feed) and then sent to the backend processing.
- The backend (object_cheating.py) orchestrates calls to the AI models (YOLO, CNN, Mediapipe) and uses utility modules (like eye_tracker.py) to analyze video frames for suspicious activity.
- The detection results are then fed back into the UI panels (detection_display, stats_panel, table) to update teachers/examiners in real-time.
- Component Interactions:
- Controllers (controls.py) likely handle user inputs and state transitions (perhaps utilizing the “states/camera_state.py”).
- The design likely follows a modular structure where each component deals with a specific part of the exam monitoring process, tied together by the Reflex framework that handles routing, state, and UI rendering.

##### Architectural Patterns and Design Principles
- Separation of Concerns:
- There’s a clear divide between the presentation layer (UI components), the processing/logic layer (object_cheating core, state tracking), and the AI/detection layer (models).
- Modularity:
- The project is broken down into components, models, states, and utilities, making it easier to update or extend individual parts without affecting the whole system.
- Real-Time Processing & Feedback:
- The system emphasizes low-latency interactions between video input and UI feedback, essential for real-time cheating detection.

##### Technologies and Frameworks
- Reflex Framework: Serves as the glue between frontend and backend.
- YOLO: Used for object detection.
- Mediapipe: Used for facial landmark detection.
- Convolutional Neural Networks (CNN): Provide additional deep learning capabilities for analysis.
- Python (and its standard packaging structure) ties everything together.

##### Explicit Elements
- Each major component should be clearly labeled:
- “Frontend Components” (listing panels, controls, camera feed, etc.)
- “Backend Processing” (core logic, state management)
- “AI Models and Detection Engines” (models directory items)
- “Static Assets & Data Sources” (assets, images, uploaded_files)
- Flow from video input → UI capture → backend processing → AI analysis → feedback display.
- Visual distinction:

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Frontend/UI Components"
        CF["Camera Feed"]:::frontend
        CP["Coordinate Panel"]:::frontend
        DD["Detection Display"]:::frontend
        SP["Stats Panel"]:::frontend
        CT["Controls"]:::frontend
        BP["Behavior Panel"]:::frontend
        IP["Input Panel"]:::frontend
        TB["Table"]:::frontend
        TH["Treshold"]:::frontend
    end

    subgraph "Static Assets"
        CSS["CSS Animations"]:::assets
        IMG["Image Assets"]:::assets
    end

    subgraph "Backend Processing"
        OC["Object Cheating Core"]:::backend
        SM["State Management"]:::backend
        UT["Utility Module"]:::backend
    end

    subgraph "AI & Detection Engines"
        EM["Eye Model"]:::ai
        FL["Face Landmark Detection"]:::ai
        YOLO1["YOLO/CNN Model 1"]:::ai
        YOLO2["YOLO/CNN Model 2"]:::ai
    end

    subgraph "Data Sources"
        VF["Video/Test Files"]:::data
    end

    subgraph "Configuration & Integration"
        RX["rxconfig.py"]:::config
        REQ["requirements.txt"]:::config
    end

    VF --> CF
    CF --> OC
    CP --> OC
    BP --> OC
    IP --> OC
    TH --> OC
    CT --> SM
    CT --> OC
    OC --> UT
    OC --> DD
    OC --> SP
    OC --> TB
    OC --> YOLO1
    OC --> YOLO2
    OC --> FL
    OC --> EM
    CSS -- "styles" --> CF
    IMG -- "assets" --> CP
    RX --> OC
    REQ --> RX

    click CF "https://github.com/laoode/eduview/blob/main/object_cheating/components/camera_feed.py"
    click CP "https://github.com/laoode/eduview/blob/main/object_cheating/components/coordinate_panel.py"
    click DD "https://github.com/laoode/eduview/blob/main/object_cheating/components/detection_display.py"
    click SP "https://github.com/laoode/eduview/blob/main/object_cheating/components/stats_panel.py"
    click CT "https://github.com/laoode/eduview/blob/main/object_cheating/components/controls.py"
    click BP "https://github.com/laoode/eduview/blob/main/object_cheating/components/behavior_panel.py"
    click IP "https://github.com/laoode/eduview/blob/main/object_cheating/components/input_panel.py"
    click TB "https://github.com/laoode/eduview/blob/main/object_cheating/components/table.py"
    click TH "https://github.com/laoode/eduview/blob/main/object_cheating/components/treshold.py"
    
    click CSS "https://github.com/laoode/eduview/blob/main/assets/animations.css"
    click IMG "https://github.com/laoode/eduview/tree/main/images"
    
    click OC "https://github.com/laoode/eduview/blob/main/object_cheating/object_cheating.py"
    click SM "https://github.com/laoode/eduview/blob/main/object_cheating/states/camera_state.py"
    click UT "https://github.com/laoode/eduview/blob/main/object_cheating/utils/eye_tracker.py"
    
    click EM "https://github.com/laoode/eduview/blob/main/object_cheating/models/eye_model.h5"
    click FL "https://github.com/laoode/eduview/blob/main/object_cheating/models/face_landmarker.task"
    click YOLO1 "https://github.com/laoode/eduview/blob/main/object_cheating/models/modelv8.pt"
    click YOLO2 "https://github.com/laoode/eduview/blob/main/object_cheating/models/modelv8-2.pt"
    
    click VF "https://github.com/laoode/eduview/tree/main/uploaded_files"
    
    click RX "https://github.com/laoode/eduview/blob/main/rxconfig.py"
    click REQ "https://github.com/laoode/eduview/blob/main/requirements.txt"

classDef frontend fill:#AEDFF7,stroke:#333,stroke-width:2px;
classDef assets fill:#F7AEC3,stroke:#333,stroke-width:2px;
classDef backend fill:#F7D6AE,stroke:#333,stroke-width:2px;
classDef ai fill:#C3F7AE,stroke:#333,stroke-width:2px;
classDef data fill:#F7F7AE,stroke:#333,stroke-width:2px;
classDef config fill:#D6AEF7,stroke:#333,stroke-width:2px;
```
