# ibrahim-string/rankmyresume architecture

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

- Interactive diagram: https://gitdiagram.com/ibrahim-string/rankmyresume
- Repository: https://github.com/ibrahim-string/rankmyresume

## Overview

##### Main Components
- Module Entry Point – The RankMyResume class is the core entry point. This class encapsulates the logic to rank resumes.
- File Handling Component – Uses the os library to manage file navigation (e.g., reading resumes from a directory).
- Resume Parsing – A component that uses pdfminer to extract textual data from PDF resumes. In future updates, this component will extend support to DOC/DOCX formats.
- Similarity Engine – Likely implemented with scikit-learn, which compares the processed text data to rank resumes based on similarity.
- Output Formatter – Utilizes pandas to organize the rankings into a DataFrame for presentation.

##### Relationships and Interactions
- The user provides input (job description and path to resume directory) to the RankMyResume API.
- The API then calls the File Handling component to locate and manage resume files.
- Each resume is routed to the Resume Parsing component to extract text.
- Extracted text is passed to the Text Processing/Feature Extraction module.
- The Similarity Engine uses the prepared representations (e.g., via vectorizers) to compute similarities against the job description.
- Finally, results are aggregated and formatted using pandas, which are then returned/displayed to the user.

##### Architectural Patterns and Design Principles
- Modular Design – The entire system is modular so that components (parsing, processing, similarity computation) are loosely coupled.
- Extensibility – The design should allow adding new parsers (for DOC/DOCX) and potentially integrating additional similarity metrics in the future.
- Data Flow – A clear sequential process for input -> parsing -> processing -> ranking -> output.

##### Relevant Technologies and Libraries
- pdfminer (for handling and parsing PDF files)
- scikit-learn (for vectorizing text data and computing similarity)
- pandas (for creating and handling DataFrames for output)
- Python’s os module for file and path operations

##### Essential Elements
- Clear labels such as “User Input,” “RankMyResume API,” “Resume File Loader,” “PDF Parser (pdfminer),” “Text Processing & Feature Extraction (scikit-learn),” “Similarity Engine,” and “Output Formatter (pandas).”
- Annotations for each component explaining its role.

## Diagram (Mermaid)

```mermaid
flowchart TD
    UI["User Input"]:::user
    RAPI["RankMyResume API"]:::api
    RFL["Resume File Loader"]:::pipeline
    PP["PDF Parser (pdfminer)"]:::pipeline
    TP["Text Processing & Feature Extraction (scikit-learn)"]:::pipeline
    SE["Similarity Engine"]:::pipeline
    OF["Output Formatter (pandas)"]:::pipeline
    UO["User Output"]:::user

    UI -->|"providesInput"| RAPI
    RAPI -->|"callsFileLoader"| RFL
    RFL -->|"locatesFiles"| PP
    PP -->|"extractsText"| TP
    TP -->|"generatesFeatures"| SE
    SE -->|"computesSimilarity"| OF
    OF -->|"formatsResults"| UO

    click RAPI "https://github.com/ibrahim-string/rankmyresume/blob/master/RankMyResume/RankMyResume.py"
    click RFL "https://github.com/ibrahim-string/rankmyresume/blob/master/RankMyResume/RankMyResume.py"
    click PP "https://github.com/ibrahim-string/rankmyresume/blob/master/RankMyResume/RankMyResume.py"
    click TP "https://github.com/ibrahim-string/rankmyresume/blob/master/RankMyResume/RankMyResume.py"
    click SE "https://github.com/ibrahim-string/rankmyresume/blob/master/RankMyResume/RankMyResume.py"
    click OF "https://github.com/ibrahim-string/rankmyresume/blob/master/RankMyResume/RankMyResume.py"

    classDef user fill:#FAD7A0,stroke:#333,stroke-width:2px;
    classDef api fill:#F1948A,stroke:#333,stroke-width:2px;
    classDef pipeline fill:#AED6F1,stroke:#333,stroke-width:2px;
```
