# omkargarad78/alignify architecture

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

- Interactive diagram: https://gitdiagram.com/omkargarad78/alignify
- Repository: https://github.com/omkargarad78/alignify

## Overview

##### Main Components
- Frontend:
- Represented by the "templates" directory (with index.html) and "static" assets (main.js). This is the user interface that enables resume file uploads and job description input.
- Backend:
- Encapsulated in main.py, which contains the application’s routing, file handling, and NLP processing logic.
- Dependencies/External Libraries:
- Shown in requirements.txt (which likely includes libraries for PDF/DOCX parsing, TF-IDF vectorization, cosine similarity, etc.).
- Infrastructure:
- The runtime and deployment configuration is hinted by runtime.txt and the use of Git for version control (.gitignore).

##### Relationships and Interactions
- User Interaction:
- The user accesses the web application via a browser (pointing to http://localhost:8000), which loads the frontend components.
- Request Flow:
- The frontend sends the uploaded resume and provided job description data to the backend.
- Processing Flow:
- The backend (main.py) performs several tasks:
▫ Extraction of text from uploaded PDF/DOCX files.
▫ Keyword extraction using TF-IDF.
▫ Calculation of cosine similarity to compute match scores.
▫ Generation of personalized email and LinkedIn messages.
▫ Preparation of improvement suggestions.
- Response:
- The processed results are then rendered back via the frontend (using templates) for the user to view.

##### Architectural Patterns and Design Principles
- Model-View Separation:
- Although it isn’t a full-blown MVC framework, the project cleanly separates the presentation layer (HTML/JS) from the processing logic in main.py.
- Lightweight and Modular:
- The application is built to execute NLP tasks on the fly without reliance on external databases, implying a more streamlined, server-driven processing design.
- Clear Data Flow:
- Data moves from user input (browser) to the backend processing logic and back to the display interface.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Global Nodes
    UB["User Browser"]:::browser

    %% Frontend subgraph
    subgraph "Frontend (Web UI)"
        T["Templates (index.html)"]:::frontend
        S["Static Assets (main.js)"]:::frontend
    end

    %% Backend subgraph
    subgraph "Backend (Main Application)"
        M["main.py"]:::backend
        FU["File Upload Handler"]:::backend
        NLP["NLP Engine Module"]:::backend
        P["PDF/DOCX Text Extraction"]:::process
        TF["TF-IDF & Cosine Similarity"]:::process
        TG["Template & Message Generation"]:::process
        SA["Suggestion Analysis"]:::process
        DG["Display/Response Generation"]:::backend
    end

    %% External Dependencies
    ED["External Dependencies (requirements.txt)"]:::dependency

    %% Deployment/Configuration
    DC["Deployment/Configuration"]:::config

    %% Data Flow
    UB -->|"SubmitResume&JobDescription"| T
    UB -->|"SubmitResume&JobDescription"| S
    T ---|"Loads UI"| S

    T -->|"SendData"| M
    S -->|"SendData"| M

    M -->|"HandlesFileUpload"| FU
    FU -->|"PassFileTo"| NLP

    NLP --> P
    NLP --> TF
    NLP --> TG
    NLP --> SA

    P --- TF
    TF --- TG
    TG --- SA
    SA -->|"GenerateResults"| DG

    DG -->|"RenderResults"| T
    DG -->|"RenderResults"| S

    %% Dependencies Connections
    M --- ED

    %% Deployment Connections
    ED --- DC

    %% Click Events
    click T "https://github.com/omkargarad78/alignify/blob/main/templates/index.html"
    click S "https://github.com/omkargarad78/alignify/blob/main/static/main.js"
    click M "https://github.com/omkargarad78/alignify/blob/main/main.py"
    click ED "https://github.com/omkargarad78/alignify/blob/main/requirements.txt"
    click DC "https://github.com/omkargarad78/alignify/blob/main/runtime.txt"
    click DC "https://github.com/omkargarad78/alignify/blob/main/ .gitignore"

    %% Styles
    classDef browser fill:#f9d5bb,stroke:#bd5d38,stroke-width:2px;
    classDef frontend fill:#bbf7d0,stroke:#16a34a,stroke-width:2px;
    classDef backend fill:#bfdbfe,stroke:#2563eb,stroke-width:2px;
    classDef dependency fill:#fef3c7,stroke:#d97706,stroke-width:2px;
    classDef config fill:#e0e7ff,stroke:#4338ca,stroke-width:2px;
    classDef process fill:#fcd34d,stroke:#a16207,stroke-width:2px;
```
