# chethansk65/mock-interview-system-python-main architecture

> Architecture diagram of the GitHub repository chethansk65/mock-interview-system-python-main, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chethansk65/mock-interview-system-python-main
- Repository: https://github.com/chethansk65/mock-interview-system-python-main

## Overview

##### Main Components
a. Frontend (React client)
b. Backend API Server (Python Flask/FastAPI)
c. AI/ML Modules
d. Static Assets (3D models, face-detection models)
e. External Services (optional, e.g., OpenAI or third-party ML APIs)

##### Relationships & Data Flows
- User Device (Browser) captures video and audio → feeds into React UI
- React components (FaceRecognition, Canvas3D, Model) load ML models from `public/face_models`
- Frontend calls Backend endpoints: `/emotion`, `/questions`, `/review` via HTTP REST
- Backend’s `app.py` routes requests to logic in `functions/`:
– `emotion_analysis.py`
– `question_generation.py`
– `review_generation.py`
- Backend returns JSON responses → Frontend displays animated feedback, 3D animations, and review pages

##### Architectural Patterns & Design Principles
- Separation of concerns:
– UI layer (React) vs Business logic (Python)
– Static assets served separately
- Modularization:
– React “pages” under `src/pages/`
– Reusable “components” under `src/components/`
– Server “functions” as independent modules
- Asynchronous calls / RESTful API design

##### Technology Stack Callouts
- Frontend: React.js, Webpack, face-api.js (for browser ML), Three.js or Canvas3D
- Backend: Python 3.12+, Flask (or FastAPI), standard ML libraries (TensorFlow/PyTorch) or external AI APIs
- Static Assets: GLB 3D models, pre-trained face-detection models shipped in `public/face_models`
- No persistent database in current scope (stateless interactions)

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Client (Browser)"
        direction TB
        Browser["User Browser\n(Camera & Audio)"]:::external

        subgraph "React UI Layer"
            direction TB
            App["App\n(client/src/App.js)"]:::frontend

            subgraph Pages
                direction TB
                Home["HomePage\n(client/src/pages/HomePage.jsx)"]:::frontend
                Interview["InterviewPage\n(client/src/pages/InterviewPage.jsx)"]:::frontend
                Review["ReviewPage\n(client/src/pages/ReviewPageNew.jsx)"]:::frontend
            end

            subgraph Components
                direction TB
                FaceRec["FaceRecognition\n(client/src/components/FaceRecognition.jsx)"]:::frontend
                Canvas3D["Canvas3D\n(client/src/components/utils/Canvas3D.jsx)"]:::frontend
                ModelUtil["Model Loader\n(client/src/components/utils/Model.jsx)"]:::frontend
            end

            subgraph Utils
                direction TB
                GlobalState["GlobalState\n(client/src/components/utils/GlobalState.js)"]:::frontend
                PageVis["PageVisibility\n(client/src/components/utils/PageVisibility.jsx)"]:::frontend
                Toast["ToastStyle\n(client/src/components/utils/toastStyle.js)"]:::frontend
            end
        end

        Static3D["3D Assets\n(client/public/assets/3d_models/)"]:::assets
        StaticFace["Face Models\n(client/public/face_models/)"]:::assets
        HTML["HTML Template\n(client/public/index.html)"]:::assets
    end

    subgraph "Server (Backend)"
        direction TB
        APIGateway["API Gateway\n(server/app.py)"]:::backend

        subgraph "Business Logic Modules"
            direction TB
            Emotion["Emotion Analysis\n(server/functions/emotion_analysis.py)"]:::ml
            Questions["Question Generation\n(server/functions/question_generation.py)"]:::ml
            ReviewGen["Review Generation\n(server/functions/review_generation.py)"]:::ml
        end
    end

    %% Connections
    Browser -->|"loads UI"| App
    App -->|"renders pages"| Home
    App --> Interview
    App --> Review
    Home --> FaceRec
    Interview --> Canvas3D
    Interview --> ModelUtil
    Review --> GlobalState
    Review --> PageVis
    Review --> Toast
    App -->|"API Client (fetch)"| APIGateway
    App --> Static3D
    App --> StaticFace
    App --> HTML
    APIGateway -->|"POST /emotion"| Emotion
    APIGateway -->|"POST /questions"| Questions
    APIGateway -->|"POST /review"| ReviewGen
    Emotion --> APIGateway
    Questions --> APIGateway
    ReviewGen --> APIGateway
    APIGateway --> App

    %% Click Events
    click App "https://github.com/chethansk65/mock-interview-system-python-main/blob/main/client/src/App.js"
    click Home "https://github.com/chethansk65/mock-interview-system-python-main/blob/main/client/src/pages/HomePage.jsx"
    click Interview "https://github.com/chethansk65/mock-interview-system-python-main/blob/main/client/src/pages/InterviewPage.jsx"
    click Review "https://github.com/chethansk65/mock-interview-system-python-main/blob/main/client/src/pages/ReviewPageNew.jsx"
    click FaceRec "https://github.com/chethansk65/mock-interview-system-python-main/blob/main/client/src/components/FaceRecognition.jsx"
    click Canvas3D "https://github.com/chethansk65/mock-interview-system-python-main/blob/main/client/src/components/utils/Canvas3D.jsx"
    click ModelUtil "https://github.com/chethansk65/mock-interview-system-python-main/blob/main/client/src/components/utils/Model.jsx"
    click GlobalState "https://github.com/chethansk65/mock-interview-system-python-main/blob/main/client/src/components/utils/GlobalState.js"
    click PageVis "https://github.com/chethansk65/mock-interview-system-python-main/blob/main/client/src/components/utils/PageVisibility.jsx"
    click Toast "https://github.com/chethansk65/mock-interview-system-python-main/blob/main/client/src/components/utils/toastStyle.js"
    click Static3D "https://github.com/chethansk65/mock-interview-system-python-main/tree/main/client/public/assets/3d_models/"
    click StaticFace "https://github.com/chethansk65/mock-interview-system-python-main/tree/main/client/public/face_models/"
    click HTML "https://github.com/chethansk65/mock-interview-system-python-main/blob/main/client/public/index.html"
    click APIGateway "https://github.com/chethansk65/mock-interview-system-python-main/blob/main/server/app.py"
    click Emotion "https://github.com/chethansk65/mock-interview-system-python-main/blob/main/server/functions/emotion_analysis.py"
    click Questions "https://github.com/chethansk65/mock-interview-system-python-main/blob/main/server/functions/question_generation.py"
    click ReviewGen "https://github.com/chethansk65/mock-interview-system-python-main/blob/main/server/functions/review_generation.py"

    %% Styles
    classDef frontend fill:#D6EAF8,stroke:#1B4F72,color:#1B2631
    classDef backend fill:#D4EFDF,stroke:#186A3B,color:#145A32
    classDef ml fill:#FCF3CF,stroke:#B7950B,color:#7D6608
    classDef assets fill:#E5E7E9,stroke:#A6ACAF,color:#424949
    classDef external fill:#F5EEF8,stroke:#7D3C98,color:#512E5F
```
