# iamamanporwal/resume-ranker architecture

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

- Interactive diagram: https://gitdiagram.com/iamamanporwal/resume-ranker
- Repository: https://github.com/iamamanporwal/resume-ranker

## Overview

##### Main Components
- Web Frontend: Represented by the HTML templates (templates/index.html) and static assets (static/styles.css). This is the user-facing interface where HR professionals interact with the app.
- Flask Application (app.py): Acts as the primary web server that handles routing, rendering the templates, and managing user requests.
- Resume Processing & Ranking Logic: Handled in the separate module (resume_ranker.py) which likely contains functions to extract text from PDF resumes, compute similarity scores against the job description, and generate the ranking.
- Data Storage and I/O:
- Temporary file storage for uploaded resumes (the README indicates an “uploads” directory even if it’s not present in the file tree).
- Generated output file (ranked_resumes.csv) for storing the final ranked results.
- Dependencies & Configuration:
- requirements.txt provides external libraries and modules.
- Additional configuration files (such as .gitignore and possibly implicit config in the Flask app) to support deployment and development workflows.

##### Inter-Component Relationships
- The user accesses the app via a web browser, which loads the UI components served by Flask.
- The user uploads a job description and resumes (the resumes in PDF form are either preloaded or uploaded dynamically).
- The Flask application (app.py) receives these inputs, then invokes functions in resume_ranker.py to process the resumes:
- Extracting relevant details (names, emails, content).
- Calculating similarity metrics between the resumes and the job description.
- Once processed, the results are displayed on the UI and also saved as a ranked CSV file (ranked_resumes.csv).
- The static assets (CSS) style and enhance the visual presentation of the web interface.

##### Architectural Patterns and Technologies
- MVC-like Architecture:
- View: HTML templates and static files.
- Controller: Flask application (app.py) managing routes and user interaction.
- Model/Processing: resume_ranker.py handling business logic and data processing.
- The project uses natural language processing techniques (although the specific libraries aren’t named in the file tree, they’re implied in the README description).
- Separation between the user interface and the business logic, ensuring that data processing is modular (highlight the use of a separate module for ranking).

##### Final Elements
- Each module/component should have a clear, descriptive label.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Components
    subgraph "Frontend"
        client["Web Browser / Client"]:::clientStyle
        templates["HTML Templates"]:::frontend
        static["Static Assets"]:::frontend
    end

    %% Backend Components
    subgraph "Backend"
        flask["Flask Server (app.py)"]:::server
        ranker["Resume Ranking Module (resume_ranker.py)"]:::server
        config["Dependencies & Config (requirements.txt)"]:::config
    end

    %% Data Storage Components
    subgraph "Data Storage"
        csv["CSV Output (ranked_resumes.csv)"]:::storage
        uploads["Uploads Folder"]:::storage
    end

    %% Relationships / Data Flow
    client -->|"requests"| templates
    client -->|"requests"| static
    client -->|"submitsData"| flask
    flask -->|"callsRanking"| ranker
    ranker -->|"producesRanking"| csv
    flask -->|"storesResult"| csv
    flask -->|"handlesUploads"| uploads
    flask -->|"loadsDeps"| config

    %% Click Events
    click templates "https://github.com/iamamanporwal/resume-ranker/blob/main/templates/index.html"
    click static "https://github.com/iamamanporwal/resume-ranker/blob/main/static/styles.css"
    click flask "https://github.com/iamamanporwal/resume-ranker/blob/main/app.py"
    click ranker "https://github.com/iamamanporwal/resume-ranker/blob/main/resume_ranker.py"
    click csv "https://github.com/iamamanporwal/resume-ranker/blob/main/ranked_resumes.csv"
    click config "https://github.com/iamamanporwal/resume-ranker/blob/main/requirements.txt"

    %% Style Definitions
    classDef clientStyle fill:#f9c,stroke:#333,stroke-width:2px;
    classDef frontend fill:#ccf,stroke:#333,stroke-width:2px;
    classDef server fill:#cfc,stroke:#333,stroke-width:2px;
    classDef storage fill:#ffc,stroke:#333,stroke-width:2px;
    classDef config fill:#fc9,stroke:#333,stroke-width:2px;
```
