# abhisheksahoo15/ai-resume-builder architecture

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

- Interactive diagram: https://gitdiagram.com/abhisheksahoo15/ai-resume-builder
- Repository: https://github.com/abhisheksahoo15/ai-resume-builder

## Overview

##### Project type and purpose
- This is a full-stack web application (“AI Resume Builder”) combining a Python API backend, a machine-learning model for ATS scoring, web scrapers for job discovery, and a browser-based frontend.
- From the README: users create resumes, check ATS scores, and discover jobs. The API backend is implemented in FastAPI (and mentions Django, though code structure centers on FastAPI in `main.py`).

##### File structure
- Top-level:
- `.github/workflows/`: CI/CD definitions (`main_ai-resume-builder.yml`, `main_hirefireai.yml`)
- `main.py`: FastAPI application entrypoint
- `requirements.txt`: Python dependencies
- `ml_model/ats_model.pkl`: pickled ML model for ATS scoring
- `scrapers/`: modules to scrape job boards (Google, Indeed, LinkedIn)
- `utils/`: helper modules (`save_to_csv.py`, `save_to_json.py`)
- `static/` and `templates/`: frontend assets (HTML templates, CSS, JS)
- `test/`: unit/UI tests (`test_main.py`, `test.html`)
- `docs/`: design guidelines and onboarding docs

##### README for additional insights
- Tech stack: FastAPI, (Django), PostgreSQL, Python ML, GitHub Actions, Terraform, Azure Web App
- CI/CD pipeline: feature-branch → test suite → GitHub Actions deploy via Terraform to Azure
- DevSecOps: OWASP, static code analysis, security scans in pipeline, IaC

- Client browser (UI) – HTML/CSS/JS in `templates/` + `static/`
- API Gateway / Web Server – FastAPI app defined in `main.py`
- Business-logic modules
– Resume creation service (template rendering, PDF generation)
– ATS scoring service (loads `ml_model/ats_model.pkl`)
– Job-finder service (invokes `scrapers/*.py`)
- Data layer – PostgreSQL database (for user profiles, resumes, job caches)
- Utilities – CSV/JSON exporters (`utils/`)
- External services
– Indeed, Google Jobs, LinkedIn APIs (via scrapers)
- CI/CD & Infrastructure
– GitHub Actions workflows (.github/workflows/)
– Terraform IaC (manages Azure Web App & PostgreSQL)

b. Relationships & data flows
1. User → HTTP requests ← Browser
2. FastAPI routes
- `/create_resume` → template renderer → returns generated resume
- `/ats_score` → loads ML model → returns score
- `/job_find` → calls scraper modules → aggregates job listings
3. API ↔ PostgreSQL (read/write user data, resumes, logs)
4. Scrapers → External job boards → returns job data → API
5. CI/CD: Developer push → GitHub Actions → run tests (in `test/`) → Terraform applies → deploy to Azure

c. Architectural patterns & principles
- Layered architecture: Presentation (templates/static), API/Controller (FastAPI), Service layer (resume, scoring, scraping), Data layer (DB)
- Separation of concerns: distinct modules for ML, scraping, persistence
- Infrastructure as Code: Terraform-managed deployment
- Automated pipelines: GitHub Actions for testing, security scanning, deployment

d. Key technologies & frameworks
- FastAPI (Python) as web framework
- PostgreSQL as RDBMS
- pickle-based model (`ml_model/ats_model.pkl`) for ML inference
- Python scrapers for third-party integrations
- GitHub Actions + Terraform for CI/CD & IaC
- Azure Web App as hosting platform

##### Detail
- Individual backend subcomponents (Resume Service, ML Inference, Scraper modules).
- Security scan step in pipeline.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Frontend Layer
    subgraph "Frontend (Client Browser)" 
        direction TB
        Browser["Client Browser"]:::frontend
        Templates["Templates/"]:::frontend
        StaticAssets["Static Assets/"]:::frontend
    end

    %% Backend Layer
    subgraph "Backend API (FastAPI)" 
        direction TB
        API["FastAPI App\n(main.py)"]:::backend
        ResumeService["Resume Creation Service"]:::backend
        ATSService["ATS Scoring Service"]:::backend
        JobFinder["Job Finder Service"]:::backend
        Utils["Utilities"]:::backend
    end

    %% Data Layer
    subgraph "Database Layer"
        direction TB
        DB[(PostgreSQL)]:::db
    end

    %% External Services
    subgraph "External Services"
        direction TB
        GoogleJobs["Google Jobs API"]:::external
        Indeed["Indeed API"]:::external
        LinkedIn["LinkedIn API"]:::external
    end

    %% DevOps Pipeline
    subgraph "CI/CD & Infrastructure" 
        direction TB
        Dev["Developer"]:::devops
        GHActions["GitHub Actions"]:::devops
        Tests["Test Suite"]:::devops
        Terraform["Terraform IaC"]:::devops
        Azure["Azure Web App\n& PostgreSQL"]:::devops
    end

    %% Documentation & Config
    Docs["Documentation & Onboarding"]:::devops
    Config["requirements.txt\nREADME.md"]:::devops

    %% Connections
    Browser -->|HTTP Requests| API
    API -->|calls| ResumeService
    API -->|calls| ATSService
    API -->|calls| JobFinder
    API -->|uses| Utils
    API -->|read/write| DB

    JobFinder -->|scrapes| GoogleJobs
    JobFinder -->|scrapes| Indeed
    JobFinder -->|scrapes| LinkedIn

    Dev -->|push code| GHActions
    GHActions -->|run| Tests
    Tests -->|on success| Terraform
    Terraform -->|deploy| Azure
    Azure -->|hosts| API
    Azure -->|hosts| DB

    %% Click Events - Frontend
    click Templates "https://github.com/abhisheksahoo15/ai-resume-builder/tree/main/templates/"
    click StaticAssets "https://github.com/abhisheksahoo15/ai-resume-builder/tree/main/static/"
    click Browser "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/templates/index.html"
    click Browser "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/templates/create_resume.html"
    click Browser "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/templates/Ats_score_check.html"
    click Browser "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/templates/job_find.html"
    click Browser "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/templates/about.html"
    click Browser "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/templates/contact.html"
    click StaticAssets "https://github.com/abhisheksahoo15/ai-resume-builder/tree/main/static/css/"
    click StaticAssets "https://github.com/abhisheksahoo15/ai-resume-builder/tree/main/static/js/"
    click StaticAssets "https://github.com/abhisheksahoo15/ai-resume-builder/tree/main/static/images/"

    %% Click Events - Backend
    click API "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/main.py"
    click ResumeService "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/main.py"
    click ResumeService "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/templates/create_resume.html"
    click ResumeService "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/static/js/create_resume.js"
    click ResumeService "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/static/css/create_resume.css"
    click ATSService "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/ml_model/ats_model.pkl"
    click ATSService "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/main.py"
    click ATSService "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/templates/Ats_score_check.html"
    click ATSService "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/static/css/Ats_score_check.css"
    click ATSService "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/static/js/script.js"
    click JobFinder "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/scrapers/google_jobs_scraper.py"
    click JobFinder "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/scrapers/indeed_scraper.py"
    click JobFinder "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/scrapers/linkedin_scraper.py"
    click JobFinder "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/main.py"
    click JobFinder "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/templates/job_find.html"
    click JobFinder "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/static/css/job_find.css"
    click JobFinder "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/static/js/job_find.js"
    click Utils "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/utils/save_to_csv.py"
    click Utils "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/utils/save_to_json.py"

    %% Click Events - CI/CD & Tests & Docs & Config
    click GHActions "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/.github/workflows/main_ai-resume-builder.yml"
    click GHActions "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/.github/workflows/main_hirefireai.yml"
    click Tests "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/test/test_main.py"
    click Tests "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/test/test.html"
    click Docs "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/docs/guideline.docx"
    click Docs "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/docs/index.txt"
    click Docs "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/docs/intro to tech for project.docx"
    click Docs "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/docs/setup branch rule.docx"
    click Config "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/requirements.txt"
    click Config "https://github.com/abhisheksahoo15/ai-resume-builder/blob/main/README.md"

    %% Styles
    classDef frontend fill:#E0F7FA,stroke:#0288D1,color:#01579B;
    classDef backend fill:#E8F5E9,stroke:#43A047,color:#1B5E20;
    classDef db fill:#FFF3E0,stroke:#FB8C00,color:#E65100;
    classDef external fill:#EDE7F6,stroke:#7E57C2,color:#4A148C;
    classDef devops fill:#ECEFF1,stroke:#607D8B,color:#263238;
```
