# sigmaharsh/job-resume-analyzer architecture

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

- Interactive diagram: https://gitdiagram.com/sigmaharsh/job-resume-analyzer
- Repository: https://github.com/sigmaharsh/job-resume-analyzer

## Overview

##### Project Type and Purpose
- This is a full-stack web application (“Resume-Job Matcher”) that lets users upload resumes and job descriptions, parses them, and uses AI to compute match percentages, identify matched/missing skills, and suggest improvements.

##### File Structure Analysis
- Top-level files:
- server.js – Node.js + Express server, defines API endpoints and serves the frontend.
- README.md – project documentation.
- .gitignore – VCS ignore rules.
- Directories:
- public/index.html – static frontend interface (HTML, Tailwind CSS, Alpine.js).
- uploads/ (documented in README, though not shown in file tree) – temporary file store for resume/job uploads.
- Config:
- .env (holds GEMINI_API_KEY, PORT)
- package.json – dependencies (Express, pdf-parse, mammoth, @google-ai libraries, etc.)

##### Key Architecture Insights from README
- Frontend: static assets served by Express.
- Backend: Express routes: GET “/” for UI, POST “/analyze” for processing.
- Document Parsing: pdf-parse + mammoth.
- AI Analysis: external Google Gemini Flash 2.0 API.
- No persistent database; uses ephemeral “uploads/” folder.

##### Main Components
a. Frontend Client (Browser)
- Renders public/index.html, handles file selection and “Analyze Match” button.
- Tech: HTML + Tailwind + Alpine.js.
b. Web Server (Express.js)
- Serves static assets.
- Receives multipart/form-data at POST /analyze.
c. File Storage (uploads/)
- Temp storage of resume.docx, jobDesc.pdf.
d. Parsing Layer
- pdf-parse for PDFs, mammoth for DOC/DOCX.
- Outputs plain text for each document.
e. AI Analysis Service (External)
- Google Gemini API: takes parsed text pair, returns analysis JSON (match %, skills lists, tips).
f. Response Formatter
- Server formats AI response and sends JSON back to client.
g. Client UI Renderer
- JavaScript interprets JSON, displays match percentage, highlights skills, improvement tips.

##### Architectural Patterns and Principles
- Separation of Concerns: static UI vs. API logic vs. parsing vs. AI calls.
- Single Responsibility: each module handles one task (file I/O, parsing, AI, formatting).
- Layered Architecture: Presentation (Browser), API layer (Express), Business Logic (parsing + AI), External Services.

##### Essential Elements
- Annotations: Ports (e.g., 3001), API endpoints (/analyze).
- Environment: note .env for API key.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Browser Layer
    Browser["Browser UI Renderer<br/>(HTML, Tailwind, Alpine.js)"]:::appModule
    click Browser "https://github.com/sigmaharsh/job-resume-analyzer/blob/main/public/index.html"

    %% Server Layer
    subgraph "Express Server (server.js)" 
        direction TB
        ServerCore["Express.js Server"]:::appModule
        click ServerCore "https://github.com/sigmaharsh/job-resume-analyzer/blob/main/server.js"

        Storage((uploads/ folder)):::storage
        Parsing["Parsing Module<br/>(pdf-parse & mammoth)"]:::appModule
        click Parsing "https://github.com/sigmaharsh/job-resume-analyzer/blob/main/server.js"
        AIService["Google Gemini API"]:::external
        click AIService "https://github.com/sigmaharsh/job-resume-analyzer/blob/main/server.js"
        Formatter["Response Formatter"]:::appModule
        click Formatter "https://github.com/sigmaharsh/job-resume-analyzer/blob/main/server.js"
    end

    %% Documentation
    Docs["Documentation<br/>(README.md, .gitignore)"]:::docs
    click Docs "https://github.com/sigmaharsh/job-resume-analyzer/blob/main/README.md"
    click Docs "https://github.com/sigmaharsh/job-resume-analyzer/blob/main/.gitignore"

    %% Data Flows
    Browser -->|"GET /"| ServerCore
    ServerCore -->|"serves index.html"| Browser

    Browser -->|"POST /analyze<br/>(multipart/form-data)"| ServerCore
    ServerCore -->|"writes files"| Storage

    ServerCore -->|"parse documents"| Parsing
    Parsing -->|"plain text"| ServerCore

    ServerCore -->|"AI request<br/>(JSON)"| AIService
    AIService -->|"analysis JSON"| ServerCore

    ServerCore -->|"formats JSON"| Formatter
    Formatter -->|"JSON response"| Browser

    %% Styles
    classDef appModule fill:#cce5ff,stroke:#004085;
    classDef external fill:#d4edda,stroke:#155724;
    classDef storage fill:#fff3cd,stroke:#856404,stroke-dasharray: 5 5;
    classDef docs fill:#e2e3e5,stroke:#6c757d;
```
