# srisailesh3320/resai architecture

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

- Interactive diagram: https://gitdiagram.com/srisailesh3320/resai
- Repository: https://github.com/srisailesh3320/resai

## Overview

##### Project type and purpose
- This is a single‐page, full‐stack (monolithic) Python application with a Streamlit “frontend” that drives a simple “backend” pipeline.
- Purpose: Automate resume screening by extracting text, invoking an LLM to identify skills, matching those skills to a job description, ranking candidates, and displaying results in a web UI.

##### File structure
- Top level:
- main.py         → Streamlit app (UI + orchestration)
- text_extractor.py  → PDF & image OCR/text‐parsing logic
- skill_extractor.py → LLM API calls for skill identification
- resume_analyzer.py → Skill‐matching and ranking logic
- config.py       → Paths, environment variables, API key management
- requirements.txt / .env / .gitignore / .devcontainer → setup & config
- No separate “frontend” or “backend” folders, but logical separation by module.

##### README for additional insights
- Frontend: Streamlit (main.py)
- LLM backend: OpenRouter.ai, Qwen‐3.1b
- Text extraction: PyPDF, pytesseract, EasyOCR, Pillow
- Data processing: pandas, scikit‐learn
- The pipeline is: Upload → Extract text → Call LLM → Compare skills → Display results

##### Final recommendations
- Every module, even if small, to communicate the precise pipeline.
- Don’t omit config.py and the .env → these are critical for API key management.
- Review with stakeholders to confirm nothing is missing before finalizing.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User
    User["User Browser"]:::user

    %% Internal Modules
    subgraph "Internal Modules"
        Main["Streamlit UI\n(main.py)"]:::internal
        TextExt["Text Extraction Module\n(text_extractor.py)"]:::internal
        SkillExt["Skill Extraction Module\n(skill_extractor.py)"]:::internal
        Analyzer["Resume Analysis Module\n(resume_analyzer.py)"]:::internal
        Config["Configuration & Env Management\n(config.py + .env)"]:::config
    end

    %% External Dependencies
    subgraph "External Services & Libraries"
        OCR["OCR Engines\n(Tesseract, EasyOCR, Pillow)"]:::external
        PDF["PDF Parser\n(PyPDF)"]:::external
        LLM["OpenRouter API\n(Qwen-3.1b)"]:::external
        DataLibs["Data Libraries\n(pandas, scikit-learn)"]:::external
    end

    %% Data Structures
    RawText{{"Raw Text"}}:::data
    SkillList{{"Skill List"}}:::data
    RankedDF{{"Ranked DataFrame"}}:::data

    %% Flow
    User -->|"uploads resumes\n& job description"| Main
    Main -->|"calls text_extractor()"| TextExt
    TextExt -->|"uses OCR"| OCR
    TextExt -->|"uses PDF Parser"| PDF
    TextExt -->|"outputs raw text"| RawText
    Main -->|"passes raw text"| SkillExt
    SkillExt -->|"HTTP request"| LLM
    SkillExt -->|"receives skills"| SkillList
    Main -->|"passes SkillList + Job Skills"| Analyzer
    Analyzer -->|"uses pandas & sklearn"| DataLibs
    Analyzer -->|"outputs ranked DataFrame"| RankedDF
    RankedDF -->|"renders table"| Main

    %% Config injections
    Config -.->|provides API keys & paths| TextExt
    Config -.->|provides API keys| SkillExt
    Config -.->|provides config| Analyzer
    Config -.->|provides config| Main

    %% Documentation & Setup
    README["Project Documentation\n(README.md)"]:::doc
    Req["Dependency Declaration\n(requirements.txt)"]:::doc
    DevCont["Development Container\n(.devcontainer/devcontainer.json)"]:::doc

    Main -.-> README
    Main -.-> Req
    Main -.-> DevCont

    %% Click Events
    click Main "https://github.com/srisailesh3320/resai/blob/master/main.py"
    click TextExt "https://github.com/srisailesh3320/resai/blob/master/text_extraction.py"
    click SkillExt "https://github.com/srisailesh3320/resai/blob/master/skill_extractor.py"
    click Analyzer "https://github.com/srisailesh3320/resai/blob/master/resume_analyzer.py"
    click Config "https://github.com/srisailesh3320/resai/blob/master/config.py"
    click README "https://github.com/srisailesh3320/resai/blob/master/README.md"
    click Req "https://github.com/srisailesh3320/resai/blob/master/requirements.txt"
    click DevCont "https://github.com/srisailesh3320/resai/blob/master/.devcontainer/devcontainer.json"

    %% Styles
    classDef internal fill:#D0E8FF,stroke:#004E89
    classDef external fill:#DFF2BF,stroke:#4F8A10
    classDef data fill:#FFE0B2,stroke:#FB8C00
    classDef config fill:#FFF3E0,stroke:#FFB300
    classDef doc fill:#F0F0F0,stroke:#999
    classDef user fill:#F5F5F5,stroke:#666,stroke-dasharray: 2 2
```
