# imchandanmohan/smart-resume-builder architecture

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

- Interactive diagram: https://gitdiagram.com/imchandanmohan/smart-resume-builder
- Repository: https://github.com/imchandanmohan/smart-resume-builder

## Overview

##### Project Type & Purpose
- This is a full-stack, AI-driven, voice-enabled resume builder (“Resume Genius”).
- Frontend: Streamlit web app (voice/text input, interactive editing).
- Backend: Python pipeline that ingests job descriptions, runs NLP & ML models (NER, keyword extraction, similarity), scores for ATS, renders a PDF resume, and sends it via email.

##### Main Architectural Components
a. Frontend Layer
- Streamlit app (`Web/app.py` + `Web/pages/Resume_Builder.py`)
- Voice interface module (`SpeechRecognition` / Whisper)
b. Orchestration & Business Logic
- Pipeline entry points (`src/analyse_pipeline.py`, `src/analyze_jd_focus.py`)
- ATS scoring (`src/ats_score.py`)
- Resume rendering (`src/render_resume.py`)
- Email sending (`email_sender.py` or Flask-Mail / SendGrid)
c. Extractor & NLP Services
- Job-description extractor (`src/extractors/jd_llm_extractor.py`)
- Resume extractor (`src/extractors/resume_llm_extractor.py`)
- NER service & predictor (`src/ner/ner_service.py`, `src/ner/ner_predictor.py`)
- Text cleaning & common utilities (`utils/text_cleaner.py`, `utils/common_functions.py`, `utils/llm_client.py`)
d. Model & Template Artifacts
- Pretrained NER models (`artifacts/ner_model/checkpoint-*`)
- Resume LaTeX template (`artifacts/resume/resume_template.tex.j2`)
e. Configuration & Infrastructure
- Config files (`config/paths_config.py`, `config/highlight_config.py`, `config/KPI_config.py`)
- Logging (`logs/`)
- Dependency management (`requirements.txt`, `setup.sh`)

##### Component Interactions & Data Flow
- User → Frontend: submits job description (text or voice).
- Frontend → Orchestrator: calls pipeline APIs.
- Orchestrator → Extractors: invokes JD extractor & resume extractor (via LLM client).
- Extractors → NER Service: tags entities in resume & JD.
- Pipeline → ATS Scorer: computes ATS-compliance score (TF-IDF, cosine similarity, rule-based).
- Pipeline → Renderer: fills Jinja2 LaTeX template → generates PDF (pdfkit/python-docx).
- Pipeline → Email Sender: posts final PDF to SMTP/SendGrid.
- Throughout: configuration lookup & logging.

##### Architectural Patterns & Principles
- Layered architecture: UI / Orchestration / NLP services / Persistence (models/templates) / External services.
- Pipeline pattern: discrete stages (extract → tag → score → render → send).
- Single-Responsibility: each module focuses on one task (e.g., `ner_service.py` only handles NER inference).
- Modular config & utilities: share common functions & client wrappers.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client Layer"
        direction TB
        Client["User Browser/Microphone"]:::external
    end

    %% Frontend Layer
    subgraph "Frontend Layer"
        direction TB
        StreamlitApp["Streamlit App"]:::frontend
        ResumeBuilder["Resume Builder Page"]:::frontend
        VoiceInterface["Voice Interface (Whisper)"]:::frontend
    end

    %% Backend Orchestration Layer
    subgraph "Backend Orchestration Layer"
        direction TB
        AnalysePipeline["Pipeline Entry Point"]:::backend
        JDFocusPipeline["JD Focus Pipeline"]:::backend
        ATSScorer["ATS Scorer"]:::backend
        ResumeRenderer["Resume Renderer"]:::backend
        EmailSender["Email Sender"]:::backend
    end

    %% NLP Services Layer
    subgraph "NLP Services Layer"
        direction TB
        JDExtractor["Job-Description LLM Extractor"]:::service
        ResumeExtractor["Resume LLM Extractor"]:::service
        NERService["NER Service"]:::service
        NERPredictor["NER Predictor"]:::service
    end

    %% Storage & Artifacts Layer
    subgraph "Model & Template Artifacts"
        direction TB
        PretrainedModels["Pretrained NER Models"]:::storage
        ResumeTemplate["LaTeX Resume Template"]:::storage
    end

    subgraph "Configuration & Logs"
        direction TB
        ConfigFiles["Config Files"]:::config
        LogsDir["Logs Directory"]:::storage
        Requirements["requirements.txt"]:::config
        SetupScript["setup.sh"]:::config
    end

    %% External Services Layer
    subgraph "External Services"
        direction TB
        LLMAPI["LLM API (OpenAI)"]:::external
        EmailSvc["SMTP/SendGrid"]:::external
    end

    %% Output Document
    PDFOutput["Generated PDF Resume"]:::doc

    %% Data Flow
    Client -->|"voice/text input"| StreamlitApp
    StreamlitApp -->|calls API| AnalysePipeline
    StreamlitApp -->|calls API| JDFocusPipeline
    JDFocusPipeline -->|"invokes"| JDExtractor
    JDFocusPipeline -->|"invokes"| ResumeExtractor
    JDExtractor -->|async HTTP| LLMAPI
    ResumeExtractor -->|async HTTP| LLMAPI
    JDExtractor -->|"tags entities"| NERService
    ResumeExtractor -->|"tags entities"| NERService
    NERService -->|"predict"| NERPredictor
    NERService -->|"returns tags"| AnalysePipeline
    AnalysePipeline -->|"score JD vs Resume"| ATSScorer
    ATSScorer -->|returns score| AnalysePipeline
    AnalysePipeline -->|"render resume"| ResumeRenderer
    ResumeRenderer -->|"generates"| PDFOutput
    AnalysePipeline -->|"send email"| EmailSender
    EmailSender -->|"SMTP"| EmailSvc

    %% Config & Logging flows
    AnalysePipeline -->|reads| ConfigFiles
    ResumeRenderer -->|reads| ConfigFiles
    AnalysePipeline -->|writes| LogsDir

    %% Click Events
    click StreamlitApp "https://github.com/imchandanmohan/smart-resume-builder/blob/dev/Web/app.py"
    click ResumeBuilder "https://github.com/imchandanmohan/smart-resume-builder/blob/dev/Web/pages/Resume_Builder.py"
    click AnalysePipeline "https://github.com/imchandanmohan/smart-resume-builder/blob/dev/src/analyse_pipeline.py"
    click JDFocusPipeline "https://github.com/imchandanmohan/smart-resume-builder/blob/dev/src/analyze_jd_focus.py"
    click ATSScorer "https://github.com/imchandanmohan/smart-resume-builder/blob/dev/src/ats_score.py"
    click ResumeRenderer "https://github.com/imchandanmohan/smart-resume-builder/blob/dev/src/render_resume.py"
    click JDExtractor "https://github.com/imchandanmohan/smart-resume-builder/blob/dev/src/extractors/jd_llm_extractor.py"
    click ResumeExtractor "https://github.com/imchandanmohan/smart-resume-builder/blob/dev/src/extractors/resume_llm_extractor.py"
    click NERService "https://github.com/imchandanmohan/smart-resume-builder/blob/dev/src/ner/ner_service.py"
    click NERPredictor "https://github.com/imchandanmohan/smart-resume-builder/blob/dev/src/ner/ner_predictor.py"
    click PretrainedModels "https://github.com/imchandanmohan/smart-resume-builder/tree/dev/artifacts/ner_model/checkpoint-4284"
    click ResumeTemplate "https://github.com/imchandanmohan/smart-resume-builder/blob/dev/artifacts/resume/resume_template.tex.j2"
    click Requirements "https://github.com/imchandanmohan/smart-resume-builder/blob/dev/requirements.txt"
    click SetupScript "https://github.com/imchandanmohan/smart-resume-builder/blob/dev/setup.sh"

    %% Styles
    classDef frontend fill:#AED6F1,stroke:#2980B9,color:#1B2631
    classDef backend fill:#ABEBC6,stroke:#27AE60,color:#1B2631
    classDef service fill:#F9E79F,stroke:#D68910,color:#1B2631
    classDef storage fill:#FADBD8,stroke:#C0392B,color:#1B2631
    classDef config fill:#D7BDE2,stroke:#8E44AD,color:#1B2631
    classDef external fill:#D5D8DC,stroke:#566573,color:#1B2631
    classDef doc fill:#F5CBA7,stroke:#AF601A,color:#1B2631
```
