# yusuf-shafiq-raja/ai-interview-cheat-detector architecture

> Architecture diagram of the GitHub repository yusuf-shafiq-raja/ai-interview-cheat-detector, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yusuf-shafiq-raja/ai-interview-cheat-detector
- Repository: https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector

## Overview

Secure Recruit AI is a recruiter-side interview integrity monitor. A recruiter starts an interview in the dashboard; the browser sends audio chunks and video frames to the Flask API, which scores audio and visual behavior. The dashboard averages those scores for a live overall risk view and separately submits them for CSV logging. The README also describes privacy-aware, real-time multimodal analysis. The graph reflects the sampled runtime paths; the standalone audio-to-text route is not shown as part of the registered workflow, and unsampled capabilities are retained only where README evidence supports them.

Main entry points: [`frontend/src/App.js`](https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/frontend/src/App.js) (Interview dashboard), [`backend/app.py`](https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/backend/app.py) (Flask application), [`backend/app/routes/audio_stream.py`](https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/backend/app/routes/audio_stream.py) (Audio stream endpoint), [`backend/app/routes/fusion_logger.py`](https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/backend/app/routes/fusion_logger.py) (Fusion score logger)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Recruiter dashboard"]
  node_dashboard_ui["Interview dashboard<br/>[App.js]"]
end

subgraph group_api["Backend API"]
  node_flask["Flask application<br/>[app.py]"]
  node_fusion_logger["Fusion score logger<br/>[fusion_logger.py]"]
  node_fusion_csv[("Fusion results CSV<br/>[fusion_logger.py]")]
end

subgraph group_audio["Audio analysis"]
  node_audio_endpoint["Audio stream endpoint<br/>[audio_stream.py]"]
  node_audio_features["Speech and silence scoring<br/>[audio_stream.py]"]
  node_audio_smoothing["Temporal score smoothing<br/>[audio_stream.py]"]
  node_audio_to_text["File transcription route<br/>[audio_to_text.py]"]
  node_whisper["Faster-Whisper model<br/>[app.py]"]
end

subgraph group_language["Text analysis"]
  node_text_detector["AI text detector<br/>[text_analyzer.py]"]
  node_text_endpoint["Text analysis endpoint<br/>[text_analyzer.py]"]
end

subgraph group_video["Video analysis"]
  node_video_endpoint["Video analysis endpoint<br/>[video_analyzer.py]"]
  node_visual_behavior["Face and gaze analysis<br/>[video_analyzer.py]"]
end

node_recruiter(("Recruiter"))

node_recruiter -->|"starts monitoring"| node_dashboard_ui
node_dashboard_ui -->|"resets audio"| node_flask
node_dashboard_ui -->|"resets video"| node_flask
node_dashboard_ui -->|"sends audio chunks"| node_audio_endpoint
node_dashboard_ui -->|"sends frames"| node_video_endpoint
node_flask -->|"registers route"| node_audio_endpoint
node_flask -->|"registers route"| node_video_endpoint
node_flask -->|"registers route"| node_text_endpoint
node_flask -->|"registers route"| node_fusion_logger
node_audio_endpoint -->|"transcribes audio"| node_whisper
node_audio_endpoint -->|"extracts speech cues"| node_audio_features
node_audio_endpoint -->|"scores transcript"| node_text_detector
node_audio_endpoint -->|"smooths score"| node_audio_smoothing
node_text_endpoint -->|"predicts AI probability"| node_text_detector
node_video_endpoint -->|"scores frame"| node_visual_behavior
node_dashboard_ui -->|"submits scores"| node_fusion_logger
node_fusion_logger -->|"appends results"| node_fusion_csv
node_dashboard_ui -->|"averages scores"| node_dashboard_ui

click node_dashboard_ui "https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/frontend/src/App.js"
click node_flask "https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/backend/app.py"
click node_audio_endpoint "https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/backend/app/routes/audio_stream.py"
click node_audio_features "https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/backend/app/routes/audio_stream.py"
click node_audio_smoothing "https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/backend/app/routes/audio_stream.py"
click node_text_detector "https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/backend/app/routes/text_analyzer.py"
click node_text_endpoint "https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/backend/app/routes/text_analyzer.py"
click node_video_endpoint "https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/backend/app/routes/video_analyzer.py"
click node_visual_behavior "https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/backend/app/routes/video_analyzer.py"
click node_fusion_logger "https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/backend/app/routes/fusion_logger.py"
click node_audio_to_text "https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/backend/app/routes/audio_to_text.py"
click node_fusion_csv "https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/backend/app/routes/fusion_logger.py"
click node_whisper "https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/backend/app.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dashboard_ui toneBlue
class node_flask,node_fusion_logger,node_fusion_csv toneAmber
class node_audio_endpoint,node_audio_features,node_audio_smoothing,node_audio_to_text,node_whisper toneMint
class node_text_detector,node_text_endpoint toneRose
class node_video_endpoint,node_visual_behavior,node_recruiter toneIndigo
```

## Components

### Recruiter dashboard

- [Interview dashboard](https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/frontend/src/App.js): `frontend/src/App.js`

### Backend API

- [Flask application](https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/backend/app.py): `backend/app.py`
- [Fusion score logger](https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/backend/app/routes/fusion_logger.py): `backend/app/routes/fusion_logger.py`
- [Fusion results CSV](https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/backend/app/routes/fusion_logger.py): `backend/app/routes/fusion_logger.py`

### Audio analysis

- [Audio stream endpoint](https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/backend/app/routes/audio_stream.py): `backend/app/routes/audio_stream.py`
- [Speech and silence scoring](https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/backend/app/routes/audio_stream.py): `backend/app/routes/audio_stream.py`
- [Temporal score smoothing](https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/backend/app/routes/audio_stream.py): `backend/app/routes/audio_stream.py`
- [File transcription route](https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/backend/app/routes/audio_to_text.py): `backend/app/routes/audio_to_text.py`
- [Faster-Whisper model](https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/backend/app.py): `backend/app.py`

### Text analysis

- [AI text detector](https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/backend/app/routes/text_analyzer.py): `backend/app/routes/text_analyzer.py`
- [Text analysis endpoint](https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/backend/app/routes/text_analyzer.py): `backend/app/routes/text_analyzer.py`

### Video analysis

- [Video analysis endpoint](https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/backend/app/routes/video_analyzer.py): `backend/app/routes/video_analyzer.py`
- [Face and gaze analysis](https://github.com/yusuf-shafiq-raja/ai-interview-cheat-detector/blob/main/backend/app/routes/video_analyzer.py): `backend/app/routes/video_analyzer.py`

### Other components

- **Recruiter**

## Connections

- Recruiter → Interview dashboard: starts monitoring (evidence: `README.md`)
- Interview dashboard → Flask application: resets audio (evidence: `frontend/src/App.js`)
- Interview dashboard → Flask application: resets video (evidence: `frontend/src/App.js`)
- Interview dashboard → Audio stream endpoint: sends audio chunks (evidence: `frontend/src/App.js`)
- Interview dashboard → Video analysis endpoint: sends frames (evidence: `frontend/src/App.js`)
- Flask application → Audio stream endpoint: registers route (evidence: `backend/app.py`)
- Flask application → Video analysis endpoint: registers route (evidence: `backend/app.py`)
- Flask application → Text analysis endpoint: registers route (evidence: `backend/app.py`)
- Flask application → Fusion score logger: registers route (evidence: `backend/app.py`)
- Audio stream endpoint → Faster-Whisper model: transcribes audio (evidence: `backend/app/routes/audio_stream.py`)
- Audio stream endpoint → Speech and silence scoring: extracts speech cues (evidence: `backend/app/routes/audio_stream.py`)
- Audio stream endpoint → AI text detector: scores transcript (evidence: `backend/app/routes/audio_stream.py`)
- Audio stream endpoint → Temporal score smoothing: smooths score (evidence: `backend/app/routes/audio_stream.py`)
- Text analysis endpoint → AI text detector: predicts AI probability (evidence: `backend/app/routes/text_analyzer.py`)
- Video analysis endpoint → Face and gaze analysis: scores frame (evidence: `backend/app/routes/video_analyzer.py`)
- Interview dashboard → Fusion score logger: submits scores (evidence: `frontend/src/App.js`)
- Fusion score logger → Fusion results CSV: appends results (evidence: `backend/app/routes/fusion_logger.py`)
- Interview dashboard → Interview dashboard: averages scores (evidence: `frontend/src/App.js`)
