# maxim-kondratjev/bootcamp_ds_2025 architecture

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

- Interactive diagram: https://gitdiagram.com/maxim-kondratjev/bootcamp_ds_2025
- Repository: https://github.com/maxim-kondratjev/bootcamp_ds_2025

## Overview

##### Project type and purpose
- This is a full‑stack AI‑powered web application (“Interviewee Agent”) built with FastAPI (Python) on the backend and plain HTML pages on the frontend.
- It exposes REST endpoints for conducting and evaluating mock interviews, using OpenAI Agents under the hood with custom prompts and tools, plus speech‑to‑text (STT), text‑to‑speech (TTS), and text‑to‑text (TTT) modules.

##### File structure
- Top‑level:
- `.github/workflows/` – CI/CD pipeline deploying to DigitalOcean.
- `app/` – main Python package.
- `config/` – Nginx + FastAPI config for production.
- `requirements.txt`, `setup.sh`, `dev.sh`, `.env.example` – setup & runtime scripts.
- `app/` contains:
- `api/` – FastAPI routers (`interview.py`, `evaluation.py`).
- `agents/` – two agent classes (`interviewee_agent.py`, `evaluation_agent.py`), with `prompts/` (YAML templates + utils) and `tools/` (action/result extraction).
- `model/` – STT, TTS, TTT processing modules.
- `core/` – app config, constants, OpenAI client wrappers.
- `frontend/` – static HTML pages.
- `main.py` – FastAPI app instantiation + route mounting.

##### README for additional insights
- Confirms FastAPI + Uvicorn server, OpenAI Agent SDK usage.
- No persistent database is mentioned; state is transient per HTTP call.
- Deployment uses Nginx as reverse proxy on a DigitalOcean droplet.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client and Frontend
    Client["Browser (Client)"]:::client
    subgraph "Frontend Layer"
        Frontend["Static HTML Pages"]:::frontend
    end

    %% Reverse Proxy
    subgraph "Reverse Proxy"
        Nginx["Nginx Reverse Proxy"]:::proxy
    end

    %% Backend
    subgraph "Backend (FastAPI)"
        direction TB
        Main["App Entry (main.py)"]:::backend
        subgraph "API Layer"
            InterviewAPI["Interview Router"]:::api
            EvaluationAPI["Evaluation Router"]:::api
        end
        subgraph "Core Layer"
            Config["Application Config"]:::core
            Constants["Constants"]:::core
            OpenAIClient["OpenAI Client Wrapper"]:::core
        end
        subgraph "Agents Layer"
            InterviewAgent["IntervieweeAgent"]:::agent
            EvaluationAgent["EvaluationAgent"]:::agent
            subgraph Prompts
                EvalPrompt["evaluation_system_prompt.yaml"]:::prompt
                PersonaPrompt["persona_system_prompt.yaml"]:::prompt
                PromptUtils["utils.py"]:::prompt
            end
            subgraph Tools
                ExtractAction["extract_action.py"]:::tool
                ExtractResult["extract_result.py"]:::tool
                ExtractSituation["extract_situation.py"]:::tool
                ExtractTask["extract_task.py"]:::tool
                LieAnswer["lie_answer.py"]:::tool
            end
        end
        subgraph "Model Layer"
            STT["Speech-to-Text (STT)"]:::model
            TTS["Text-to-Speech (TTS)"]:::model
            TTT["Text-to-Text (TTT)"]:::model
        end
    end

    %% External Services
    External["OpenAI API"]:::external

    %% CI/CD Pipeline
    subgraph "CI/CD Pipeline"
        CI["GitHub Actions"]:::cicd
        Droplet["DigitalOcean Droplet"]:::deploy
    end

    %% Scripts
    subgraph "Setup & Dev Scripts"
        Setup["setup.sh"]:::script
        Dev["dev.sh"]:::script
    end

    %% Connections
    Client --> Frontend
    Frontend --> Nginx
    Nginx --> Main
    Main --> InterviewAPI
    Main --> EvaluationAPI
    InterviewAPI --> OpenAIClient
    InterviewAPI --> STT
    InterviewAPI --> TTS
    InterviewAPI --> InterviewAgent
    EvaluationAPI --> OpenAIClient
    EvaluationAPI --> TTT
    EvaluationAPI --> EvaluationAgent
    InterviewAgent --> EvalPrompt
    InterviewAgent --> PersonaPrompt
    InterviewAgent --> PromptUtils
    InterviewAgent --> ExtractAction
    InterviewAgent --> ExtractResult
    InterviewAgent --> ExtractSituation
    InterviewAgent --> ExtractTask
    InterviewAgent --> LieAnswer
    OpenAIClient --> External
    STT --> InterviewAgent
    TTS --> Frontend
    TTT --> EvaluationAgent
    CI --> Droplet

    %% Click Events
    click CI "https://github.com/maxim-kondratjev/bootcamp_ds_2025/blob/main/.github/workflows/digitalocean-deploy.yml"
    click Nginx "https://github.com/maxim-kondratjev/bootcamp_ds_2025/blob/main/config/nginx-fastapi.conf"
    click Frontend "https://github.com/maxim-kondratjev/bootcamp_ds_2025/tree/main/app/frontend/"
    click Main "https://github.com/maxim-kondratjev/bootcamp_ds_2025/blob/main/app/main.py"
    click InterviewAPI "https://github.com/maxim-kondratjev/bootcamp_ds_2025/blob/main/app/api/interview.py"
    click EvaluationAPI "https://github.com/maxim-kondratjev/bootcamp_ds_2025/blob/main/app/api/evaluation.py"
    click Config "https://github.com/maxim-kondratjev/bootcamp_ds_2025/blob/main/app/core/config.py"
    click Constants "https://github.com/maxim-kondratjev/bootcamp_ds_2025/blob/main/app/core/constants.py"
    click OpenAIClient "https://github.com/maxim-kondratjev/bootcamp_ds_2025/blob/main/app/core/openai.py"
    click InterviewAgent "https://github.com/maxim-kondratjev/bootcamp_ds_2025/blob/main/app/agents/interviewee_agent.py"
    click EvaluationAgent "https://github.com/maxim-kondratjev/bootcamp_ds_2025/blob/main/app/agents/evaluation_agent.py"
    click EvalPrompt "https://github.com/maxim-kondratjev/bootcamp_ds_2025/blob/main/app/agents/prompts/evaluation_system_prompt.yaml"
    click PersonaPrompt "https://github.com/maxim-kondratjev/bootcamp_ds_2025/blob/main/app/agents/prompts/persona_system_prompt.yaml"
    click PromptUtils "https://github.com/maxim-kondratjev/bootcamp_ds_2025/blob/main/app/agents/prompts/utils.py"
    click ExtractAction "https://github.com/maxim-kondratjev/bootcamp_ds_2025/blob/main/app/agents/tools/extract_action.py"
    click ExtractResult "https://github.com/maxim-kondratjev/bootcamp_ds_2025/blob/main/app/agents/tools/extract_result.py"
    click ExtractSituation "https://github.com/maxim-kondratjev/bootcamp_ds_2025/blob/main/app/agents/tools/extract_situation.py"
    click ExtractTask "https://github.com/maxim-kondratjev/bootcamp_ds_2025/blob/main/app/agents/tools/extract_task.py"
    click LieAnswer "https://github.com/maxim-kondratjev/bootcamp_ds_2025/blob/main/app/agents/tools/lie_answer.py"
    click STT "https://github.com/maxim-kondratjev/bootcamp_ds_2025/blob/main/app/model/stt.py"
    click TTS "https://github.com/maxim-kondratjev/bootcamp_ds_2025/blob/main/app/model/tts.py"
    click TTT "https://github.com/maxim-kondratjev/bootcamp_ds_2025/blob/main/app/model/ttt.py"
    click Setup "https://github.com/maxim-kondratjev/bootcamp_ds_2025/blob/main/setup.sh"
    click Dev "https://github.com/maxim-kondratjev/bootcamp_ds_2025/blob/main/dev.sh"

    %% Styles
    classDef client fill:#FFA500,stroke:#333,stroke-width:1px
    classDef frontend fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef proxy fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef backend fill:#87CEFA,stroke:#333,stroke-width:1px
    classDef api fill:#4682B4,stroke:#333,stroke-width:1px
    classDef core fill:#1E90FF,stroke:#333,stroke-width:1px
    classDef agent fill:#0000CD,stroke:#333,stroke-width:1px
    classDef prompt fill:#4169E1,stroke:#333,stroke-width:1px
    classDef tool fill:#5F9EA0,stroke:#333,stroke-width:1px
    classDef model fill:#6495ED,stroke:#333,stroke-width:1px
    classDef external fill:#32CD32,stroke:#333,stroke-width:1px
    classDef cicd fill:#8A2BE2,stroke:#333,stroke-width:1px
    classDef deploy fill:#9370DB,stroke:#333,stroke-width:1px
    classDef script fill:#FFA07A,stroke:#333,stroke-width:1px
```
