# projectultra/employai architecture

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

- Interactive diagram: https://gitdiagram.com/projectultra/employai
- Repository: https://github.com/projectultra/employai

## Overview

##### Project type and purpose
- This is a full-stack Flask web application (“EmployAI”) that helps users generate CVs, cover letters, interview questions, and related materials using Python scripts and embedded LLM/quantization experiments.
- The README points to quantization and finetuning notebooks for LLMs (e.g., Gemma), so the core value-add is on-the-fly AI-powered document and question generation.

##### File structure
Top-level:
- app.py              – Flask application entry point
- cover_letter.py     – standalone cover-letter generator
- interview_questions.py – interview question generator
- df.csv              – seed data (e.g., question banks, templates)
- requirements.txt    – Python dependencies
- static/             – JavaScript, CSS, assets for client side
- templates/          – Jinja2 HTML templates for each view
- gemma_test/         – Jupyter notebooks and experiments (not part of production)
- *.ipynb             – exploratory notebooks (e.g., interview_gen_ai.ipynb)

Architectural hints:
- MVC pattern—Flask routes (controllers) in app.py invoke Python modules (models), render Jinja2 templates (views).
- Static assets served from “static” directory; dynamic pages use “templates.”
- No dedicated database; a CSV is used as a read-only data source.

##### README for additional insights
- README provides links to quantization/finetuning of LLMs (Gemma) and indicates that the project is intended to tie into custom-quantized LLM inference for generation tasks.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client Layer"
        Browser["User Browser"]:::frontend
        Static["Static Asset Server"]:::frontend
    end

    %% Server Layer
    subgraph "Server Layer"
        App["Flask Application<br/>(app.py)"]:::backend

        subgraph "Controllers"
            Routes["Route Handlers<br/>(/login, /dashboard, /cv_generator, /interview)"]:::backend
        end

        subgraph "Business Logic Modules"
            CL["Cover Letter Module<br/>(cover_letter.py)"]:::backend
            IQ["Interview Questions Module<br/>(interview_questions.py)"]:::backend
        end

        subgraph "Views (Jinja2 Templates)"
            subgraph "templates/"
                Base["Base Layout<br/>(base.html)"]:::backend
                Index["Landing Page<br/>(index.html)"]:::backend
                Login["Login Page<br/>(login.html)"]:::backend
                Dashboard["Dashboard<br/>(dashboard.html)"]:::backend
                CVView["CV Generator<br/>(cv_generator.html)"]:::backend
                InterviewView["Interview Generator<br/>(interview.html)"]:::backend
            end
        end
    end

    %% Model Layer
    subgraph "Model Layer"
        Data["CSV Data Store<br/>(df.csv)"]:::datastore
        LLM["LLM Inference Engine<br/>(Gemma or External API)"]:::ai
    end

    %% Experimentation (Side)
    subgraph "Experimental Notebooks"
        Experiments["gemma_test/"]:::notebook
        Quant["Quantization Notebook<br/>(gemma_test/Quant_Test.ipynb)"]:::notebook
        Ngrok["Flask + ngrok Experiment<br/>(gemma_test/flask_ngrok.ipynb)"]:::notebook
        InterviewNB["Interactive Interview AI Notebook<br/>(interview_gen_ai.ipynb)"]:::notebook
    end

    %% Connections
    Browser -->|"HTTP Request"| App
    App -->|"handles routes"| Routes
    Routes -->|"invokes"| CL
    Routes -->|"invokes"| IQ
    CL -->|"reads data"| Data
    IQ -->|"reads data"| Data
    CL -->|"calls inference"| LLM
    IQ -->|"calls inference"| LLM
    LLM -->|"returns result"| CL
    LLM -->|"returns result"| IQ
    Routes -->|"renders"| Base
    Base --> Index
    Base --> Login
    Base --> Dashboard
    Base --> CVView
    Base --> InterviewView
    Browser -->|"loads assets"| Static

    %% Click Events
    click App "https://github.com/projectultra/employai/blob/main/app.py"
    click CL "https://github.com/projectultra/employai/blob/main/cover_letter.py"
    click IQ "https://github.com/projectultra/employai/blob/main/interview_questions.py"
    click Data "https://github.com/projectultra/employai/blob/main/df.csv"
    click Static "https://github.com/projectultra/employai/tree/main/static/"
    click Base "https://github.com/projectultra/employai/blob/main/templates/base.html"
    click Index "https://github.com/projectultra/employai/blob/main/templates/index.html"
    click Login "https://github.com/projectultra/employai/blob/main/templates/login.html"
    click Dashboard "https://github.com/projectultra/employai/blob/main/templates/dashboard.html"
    click CVView "https://github.com/projectultra/employai/blob/main/templates/cv_generator.html"
    click InterviewView "https://github.com/projectultra/employai/blob/main/templates/interview.html"
    click Experiments "https://github.com/projectultra/employai/tree/main/gemma_test/"
    click Quant "https://github.com/projectultra/employai/blob/main/gemma_test/Quant_Test.ipynb"
    click Ngrok "https://github.com/projectultra/employai/blob/main/gemma_test/flask_ngrok.ipynb"
    click InterviewNB "https://github.com/projectultra/employai/blob/main/interview_gen_ai.ipynb"

    %% Styles
    classDef frontend fill:#FDE68A,stroke:#F59E0B
    classDef backend fill:#BFDBFE,stroke:#3B82F6
    classDef ai fill:#D9F99D,stroke:#84CC16
    classDef datastore fill:#FEF3C7,stroke:#FBBF24
    classDef notebook fill:#EFF6FF,stroke:#3B82F6,stroke-dasharray: 5 5
```
