# inatanayaxsk/rozgaar architecture

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

- Interactive diagram: https://gitdiagram.com/inatanayaxsk/rozgaar
- Repository: https://github.com/inatanayaxsk/rozgaar

## Overview

##### Project Type and Purpose
- Rozgaar is a Python‑based, Streamlit‑driven web application that simplifies job applications using an LLM (LLaMA 3.1 Quantized) and optional voice support.
- It’s a single‑repository “full‑stack” style app (UI + backend logic + AI) rather than a multi‑service microservices setup.

##### File Structure
– Top level:
- README.md – high‑level description.
- genai/ – core application package.
– genai/ contents:
- main.py – entry point, Streamlit server, routes to various features.
- employer_portal.py – logic for employers (job postings, management).
- mew.py – LLM orchestration (prompt construction, inference).
- voice.py – text‑to‑speech or voice‑interaction module.
- templates/index.html – HTML template for resume or cover‑letter generation.
- test.py – unit/integration tests.
- requirements.txt – Python dependencies (streamlit, llama‑related libs, TTS, etc.).

##### Extract Architectural Insights from README
- UI Layer: Streamlit
- “Brain”: LLaMA 3.1 Quantized LLM
- Support components: resume/cover‑letter templating, voice interface

##### Main Components & Their Relationships
a. User Interface (Streamlit)
– Renders pages (job search, resume builder, employer portal)
– Gathers user input (skills, preferences)
b. Application Logic
– main.py: route controller
– employer_portal.py: CRUD on job postings
– mew.py: formats prompts, calls LLM inference engine
– voice.py: converts generated text to audio (optional)
c. Data/State
– In‑memory or lightweight storage for job postings (could be JSON, in‑app state)
– Templates in genai/templates for dynamic document generation
d. LLM Inference Engine
– Local LLaMA 3.1 Quantized model loaded in mew.py
– May leverage GPU or CPU backend
e. External Services (if any)
– TTS cloud API or local TTS library used by voice.py
– (Future) Database or external job‑board integrations

##### Architectural Patterns & Design Principles
– MVC‑like layering:
- View: Streamlit UI
- Controller: main.py + feature modules
- Model: LLM inference + in‑memory data
– Single‑process monolith (deployed as one Streamlit app)
– Clear feature separation: employer vs. job‑seeker flows, resume vs. voice modules

1. UI Layer (blue)
2. Controller Layer (green)
3. LLM Inference (orange)
4. Voice/TTS Module (purple)
5. Data/Template Store (gray)
– UI → Controller (user input flows)
– Controller → LLM Inference (prompt requests)
– LLM → Controller (responses)
– Controller → Templates (document generation)
– Controller → Voice (text → speech) → UI

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% UI Layer
    subgraph "UI Layer" 
        direction TB
        UI["Streamlit App\n(genai/main.py)"]:::ui
    end

    %% Controller Layer
    subgraph "Controller Layer"
        direction TB
        EP["Employer Portal\n(genai/employer_portal.py)"]:::controller
    end

    %% LLM Inference Layer
    subgraph "LLM Inference (AI Brain)"
        direction TB
        LLM["LLaMA 3.1 Quantized\n(genai/mew.py)"]:::llm
    end

    %% Voice/TTS Module
    subgraph "Voice/TTS Module"
        direction TB
        VOICE["Voice Interface\n(genai/voice.py)"]:::voice
    end

    %% Data/Template Store
    subgraph "Template Store\n(genai/templates/index.html)" 
        direction TB
        TPL["Resume/Cover-Letter Templates"]:::data
    end

    %% Dev Tools & Docs
    subgraph "Development Tools & Docs"
        direction TB
        TEST["Tests\n(genai/test.py)"]:::tool
        REQ["Dependencies\n(genai/requirements.txt)"]:::tool
        DOC["Documentation\n(README.md)"]:::tool
    end

    %% Connections
    UI -->|"user skills JSON"| EP
    UI -->|"resume request"| TPL
    EP -->|"route control"| LLM
    LLM -->|"LLM response JSON"| EP
    EP -->|"generated text"| VOICE
    VOICE -->|"audio stream"| UI

    %% Click Events
    click UI "https://github.com/inatanayaxsk/rozgaar/blob/main/genai/main.py"
    click EP "https://github.com/inatanayaxsk/rozgaar/blob/main/genai/employer_portal.py"
    click LLM "https://github.com/inatanayaxsk/rozgaar/blob/main/genai/mew.py"
    click VOICE "https://github.com/inatanayaxsk/rozgaar/blob/main/genai/voice.py"
    click TPL "https://github.com/inatanayaxsk/rozgaar/blob/main/genai/templates/index.html"
    click TEST "https://github.com/inatanayaxsk/rozgaar/blob/main/genai/test.py"
    click REQ "https://github.com/inatanayaxsk/rozgaar/blob/main/genai/requirements.txt"
    click DOC "https://github.com/inatanayaxsk/rozgaar/blob/main/README.md"

    %% Styles
    classDef ui fill:#D0E6FF,stroke:#66A3FF,stroke-width:2px;
    classDef controller fill:#DFF7D8,stroke:#5CB85C,stroke-width:2px;
    classDef llm fill:#FFE0B2,stroke:#FF9800,stroke-width:2px;
    classDef voice fill:#E1D4F0,stroke:#9B59B6,stroke-width:2px;
    classDef data fill:#F0F0F0,stroke:#B3B3B3,stroke-width:2px;
    classDef tool fill:#FFF5CC,stroke:#FFCC00,stroke-width:1px,stroke-dasharray: 2 2;
```
