# manu9986/hiring-assistent architecture

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

- Interactive diagram: https://gitdiagram.com/manu9986/hiring-assistent
- Repository: https://github.com/manu9986/hiring-assistent

## Overview

##### Project Type and Purpose
- This is a lightweight full-stack web application built with Streamlit serving as both frontend and backend.
- Purpose: An AI-powered chatbot to generate interview questions, evaluate answers via OpenAI GPT, and produce a PDF report.

##### File Structure
- Top-level files:
- app.py – the single entry point for the Streamlit app (UI + business logic)
- requirements.txt – Python dependencies (streamlit, openai, fpdf, python-dotenv, etc.)
- .gitignore – excludes virtual environment, .env
- README.md – project overview and setup
- No separate “frontend” or “backend” directories: Streamlit merges both.
- No database or storage directories—temporary in-memory data only.
- .env file (not checked in) holds OPENAI_API_KEY.

##### README for Technical Insights
- Framework: Streamlit
- AI backend: OpenAI GPT-3.5 Turbo for question generation and evaluation
- PDF generation: fpdf library
- Data privacy: no persistent storage, GDPR compliance
- Deployment: Streamlit Sharing or Docker

##### Main Components
a. End User (Recruiter/Candidate) via Web Browser
b. Streamlit Application (app.py) – UI layer
c. Business Logic Modules inside app.py:
- Candidate Input Collector
- Question Generator Module (prompts OpenAI API)
- Response Evaluator Module (prompts OpenAI API)
- PDF Report Generator (fpdf)
d. External Service: OpenAI GPT-3.5 Turbo API
e. Environment Configuration: .env for API key
f. (Optional future) Storage/Database component for logging or analytics

##### Relationships and Data Flows
- User → Streamlit UI: enters candidate details
- Streamlit UI → Candidate Input Collector → passes params to Question Generator
- Question Generator → OpenAI API → receives questions → UI displays questions
- User → UI: submits answers → Response Evaluator → OpenAI API → feedback & scores
- Feedback → PDF Generator → creates downloadable report → UI serves PDF to User
- All API calls read OPENAI_API_KEY from .env

##### Architectural Patterns and Design Principles
- Single-page interactive app (event loop managed by Streamlit)
- Request/response integration with external AI service
- Separation of concerns (input handling, AI calls, PDF creation) within one script
- Environment-driven configuration for secrets
- Stateless by design: no local persistence

## Diagram (Mermaid)

```mermaid
graph TB
    %% User Layer
    U[/"Recruiter/Candidate (Browser)"/]:::user

    %% UI Layer
    App["Streamlit Application"]:::ui

    %% Business Logic Modules
    Input["Candidate Input Collector"]:::biz
    QGen["Question Generator Module"]:::biz
    Eval["Response Evaluator Module"]:::biz
    PDF["PDF Report Generator"]:::biz

    %% External Services
    OpenAI["OpenAI GPT-3.5 Turbo API"]:::external
    Env["Environment Configuration (.env)"]:::external

    %% Future Component
    DB[(Future Storage/Database)]:::future

    %% Documentation
    README["README.md"]:::doc
    Req["requirements.txt"]:::doc
    GIT[".gitignore"]:::doc

    %% Data Flows
    U -->|"candidate details"| App
    App -->|"interface"| Input
    Input -->|"candidate details"| QGen
    QGen -->|"AI prompt"| OpenAI
    OpenAI -->|"questions"| QGen
    QGen -->|"questions"| App
    App -->|"answers"| Eval
    Eval -->|"AI prompt"| OpenAI
    OpenAI -->|"feedback & scores"| Eval
    Eval -->|"feedback & scores"| PDF
    PDF -->|"PDF file"| App
    Env -->|"provides API key"| App
    App -.->|"stateless design"| DB

    %% Click Events
    click App "https://github.com/manu9986/hiring-assistent/blob/main/app.py"
    click Input "https://github.com/manu9986/hiring-assistent/blob/main/app.py"
    click QGen "https://github.com/manu9986/hiring-assistent/blob/main/app.py"
    click Eval "https://github.com/manu9986/hiring-assistent/blob/main/app.py"
    click PDF "https://github.com/manu9986/hiring-assistent/blob/main/app.py"
    click OpenAI "https://github.com/manu9986/hiring-assistent/blob/main/app.py"
    click Env "https://github.com/manu9986/hiring-assistent/blob/main/.env"
    click README "https://github.com/manu9986/hiring-assistent/blob/main/README.md"
    click Req "https://github.com/manu9986/hiring-assistent/blob/main/requirements.txt"
    click GIT "https://github.com/manu9986/hiring-assistent/blob/main/.gitignore"

    %% Styles
    classDef user fill:#D6EAF8,stroke:#2E86C1,color:#000
    classDef ui fill:#AED6F1,stroke:#1B4F72,color:#000
    classDef biz fill:#A9DFBF,stroke:#196F3D,color:#000
    classDef external fill:#F9E79F,stroke:#B9770E,color:#000
    classDef future fill:#F5B7B1,stroke:#943126,color:#000
    classDef doc fill:#D5D8DC,stroke:#515A5A,color:#000
```
