# dutta-sujoy/ai-resume-analyzer architecture

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

- Interactive diagram: https://gitdiagram.com/dutta-sujoy/ai-resume-analyzer
- Repository: https://github.com/dutta-sujoy/ai-resume-analyzer

## Overview

##### Project type and purpose
- This is a single-page, full-stack web application built with Streamlit (frontend/UI) and Python (backend/orchestrator).
- Purpose: let users upload resumes (PDFs), parse them, call Google Generative AI for analysis and matching against job descriptions, then display actionable feedback.

##### File structure
- Top-level files only:
- .env – stores API key for Google Generative AI
- README.md – project overview and tech stack
- app.py – the Streamlit app that ties everything together (UI + backend logic)
- requirements.txt – lists dependencies (Streamlit, pdfplumber, pytesseract, google-generative-ai client, etc.)
- resume_analyzer.ipynb – Jupyter notebook used for prototyping parsing/AI calls
- No separate “frontend” and “backend” directories: it’s a monolithic Python process that handles both UI and orchestration.

##### README for technical insights
- Tech Stack confirms:
- Frontend/UI – Streamlit
- Backend logic – plain Python in app.py
- AI service – Google Generative AI (Gemini) via API
- PDF parsing – pdfplumber, fallback OCR with pytesseract
- Config – .env for securing API keys
- Workflow steps called out: parse → AI analysis → match with job description → feedback.

##### Main components and their interactions
a. Components
1. User’s browser (renders Streamlit UI)
2. Streamlit app (app.py)
– UI layer: file-upload widget, text inputs, result display
– Controller layer: orchestrates parse/analysis/matching
3. PDF Parser module
– pdfplumber for direct text extraction
– pytesseract fallback for scanned images
4. AI Service (external)
– Google Generative AI (Gemini) API endpoint
5. Environment/Config
– .env holds API_KEY, loaded at startup
6. (Optional) Notebook/Prototyping (resume_analyzer.ipynb) – not in production, but useful for design discussion
b. Relationships & Data Flow
1. User → Streamlit UI: uploads PDF, pastes job description
2. Streamlit app → Parser module: extract raw text
3. Parser module → Streamlit app: returns resume text
4. Streamlit app → Google Generative AI API (with API key from .env):
– Summarization and evaluation calls
– Matching calls for job-description alignment
5. AI API → Streamlit app: JSON responses with scores, suggestions
6. Streamlit UI → User: formatted results (tables, charts, course links)
c. Architectural patterns & design principles
- Monolithic serverless-style process running in a single container/host
- Clear separation of concerns: UI controls vs. parsing logic vs. external AI calls
- Externalize secrets via .env, avoid hard-coding keys
- Fallback pattern: try pdfplumber first, then OCR
d. Key technologies & libraries
- Streamlit for rapid UI
- pdfplumber + pytesseract for parsing
- google-generative-ai client for AI interactions
- python-dotenv or built-in os.environ for config

## Diagram (Mermaid)

```mermaid
flowchart TB
    User["User"]:::user
    subgraph "Monolithic Application"
        direction TB
        Streamlit["Streamlit App\n(UI + Controller)"]:::internal
        subgraph "Parser Module"
            direction TB
            PDFplumber["pdfplumber\n(Direct Extraction)"]:::internal
            OCR["pytesseract\n(OCR Fallback)"]:::internal
        end
        AIClient["AI Service Client\n(google-generative-ai)"]:::internal
    end
    Config[".env\n(Environment Config)"]:::config
    ExternalAI["Google Generative AI API"]:::external
    Notebook["resume_analyzer.ipynb\n(Prototyping Notebook)"]:::notebook
    Requirements["requirements.txt\n(Dependencies)"]:::config
    Readme["README.md\n(Project Overview & Tech Stack)"]:::config

    User -->|"1: Upload PDF & Job Description"| Streamlit
    Streamlit -->|"2: Extract Text"| PDFplumber
    PDFplumber -->|"If no text found (fallback)"| OCR
    PDFplumber -->|"Raw Text"| Streamlit
    OCR -->|"Extracted Text"| Streamlit
    Streamlit -->|"3: Call AI Client"| AIClient
    AIClient -->|"4: API Request"| ExternalAI
    ExternalAI -->|"5: JSON Response"| AIClient
    AIClient -->|"6: Return Analysis"| Streamlit
    Streamlit -->|"7: Display Results"| User

    Config -->|"Loaded at Startup"| Streamlit
    Requirements -.->|"Dependencies"| Streamlit
    Readme -.->|"Documentation"| Streamlit
    Notebook -.->|"Prototyping Only"| Streamlit

    click Streamlit "https://github.com/dutta-sujoy/ai-resume-analyzer/blob/main/app.py"
    click PDFplumber "https://github.com/dutta-sujoy/ai-resume-analyzer/blob/main/app.py"
    click OCR "https://github.com/dutta-sujoy/ai-resume-analyzer/blob/main/app.py"
    click AIClient "https://github.com/dutta-sujoy/ai-resume-analyzer/blob/main/app.py"
    click Config "https://github.com/dutta-sujoy/ai-resume-analyzer/blob/main/.env"
    click Notebook "https://github.com/dutta-sujoy/ai-resume-analyzer/blob/main/resume_analyzer.ipynb"
    click Requirements "https://github.com/dutta-sujoy/ai-resume-analyzer/blob/main/requirements.txt"
    click Readme "https://github.com/dutta-sujoy/ai-resume-analyzer/blob/main/README.md"

    classDef user fill:#a2f5a2,stroke:#333,stroke-width:1px
    classDef internal fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef external fill:#ffe5b4,stroke:#333,stroke-width:1px
    classDef config fill:#e0e0e0,stroke:#333,stroke-width:1px
    classDef notebook fill:#e5ccff,stroke:#333,stroke-width:1px
```
