# prakharverma057/resume-analyzer architecture

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

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

## Overview

##### Project type and purpose
- From the README and file tree, PathoraCV is a front-end web application (built with React, React Router/Vite, and Tailwind CSS) that lets users upload a resume, preview it, and get AI-driven analysis/feedback.
- There is no separate backend code in the repository; all logic (PDF conversion, analysis hooks) lives in the client, which calls out to an external AI service.

##### File structure
- Top-level config & build files: package.json, vite.config.ts, tsconfig*.json, Dockerfile.
- app/ directory:
- components/ – all reusable UI pieces (Navbar, FileUploader, ResumeAnalyzer, ResumeCard, ScoreBadge, etc.)
- hooks/ – custom hooks (useFileUpload).
- lib/ – client-side utility & service modules (pdf2img, reportDownloader, resumeAnalysis, Puter wrapper).
- root.tsx & routes.ts – application entrypoint & route definitions.
- routes/ – page components (home, upload, resume).
- constants/ – shared configuration values.

##### README for additional insights
- Confirms: Next.js-style app folder was adapted to Vite/react-router.
- Tech stack: React, Tailwind CSS, Vite, TypeScript.
- Feature callouts: resume upload & preview, AI analysis feedback, responsive layout.

##### Main components & interactions
a. Components:
- User (Browser)
- Static Hosting/CDN (serves index.html, JS bundles, public assets)
- Client Application:
– UI Layer (React components)
– Routing Layer (react-router, routes.ts)
– State/Context Layer (PuterProvider)
– Service Layer (hooks + lib modules: pdf2img, resumeAnalysis, reportDownloader)
- External AI Service API (calls from resumeAnalysis via Puter module)
- Optional Storage/Analytics (e.g., Vercel/Netlify analytics or file usage metrics)
b. Relationships/Data Flows:
1. User opens browser → requests static assets from Hosting/CDN.
2. Browser loads JS bundle → React app initializes (root.tsx & PuterProvider).
3. User navigates pages via react-router → UI components render.
4. FileUploader component & useFileUpload hook handle resume file → pdf2img converts PDF to images.
5. ResumeAnalyzer invokes resumeAnalysis lib → sends text or image data to External AI API → receives structured feedback.
6. UI components (ScoreBadge, Summary, Details) render analysis side-by-side with the preview.
7. reportDownloader exports results for user download.
c. Architectural patterns/design principles:
- Client-side rendering (CSR) SPA with code splitting via Vite.
- Context/provider pattern (PuterProvider) for managing AI API configuration & auth.
- Hook-based service layer decouples UI from business logic.
- Utility libraries (in app/lib) isolate PDF conversion, API calls, downloading.
d. Key technologies/frameworks:
- React & React Router for UI & routing
- Vite for bundling
- TypeScript for type safety
- Tailwind CSS for styling
- Puter (custom) for AI API abstraction
- pdf2img for PDF→image conversion

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Entities
    User["User Browser"]:::external
    Static["Static Hosting / CDN"]:::storage
    PublicAssets["Public Assets"]:::storage
    ExternalAI["External AI Service"]:::cloud

    User -->|"GET index.html, JS bundles"| Static
    Static --> PublicAssets
    Static -->|"Serves app"| ReactApp

    subgraph "React App"
        direction TB
        Root["root.tsx"]:::entry
        PuterProvider["PuterProvider"]:::context
        subgraph "Routing Layer"
            direction TB
            Routes["routes.ts"]:::routing
            Home["home.tsx"]:::routing
            Upload["upload.tsx"]:::routing
            ResumeRoute["resume.tsx"]:::routing
        end
        subgraph "UI Components"
            direction TB
            Navbar["Navbar"]:::ui
            FileUploader["FileUploader"]:::ui
            ResumeAnalyzer["ResumeAnalyzer"]:::ui
            ResumeCard["ResumeCard"]:::ui
            ScoreBadge["ScoreBadge"]:::ui
            ScoreCircle["ScoreCircle"]:::ui
            ScoreGauge["ScoreGauge"]:::ui
            Summary["Summary"]:::ui
            Details["Details"]:::ui
            ATS["ATS"]:::ui
            Accordion["Accordion"]:::ui
            ClientOnly["ClientOnly"]:::ui
            Footer["Footer"]:::ui
        end
        subgraph "Service Layer"
            direction TB
            useFileUpload["useFileUpload"]:::service
            pdf2img["pdf2img"]:::service
            resumeAnalysis["resumeAnalysis"]:::service
            reportDownloader["reportDownloader"]:::service
            utils["utils"]:::service
            puterLib["puter.ts"]:::service
        end
    end

    %% Flows within React App
    ReactApp --> Root
    Root --> PuterProvider
    PuterProvider --> Routes
    Routes --> Home
    Routes --> Upload
    Routes --> ResumeRoute
    Upload -->|"Navigates"| FileUploader
    FileUploader --> useFileUpload
    useFileUpload --> pdf2img
    pdf2img -->|"PDF→images"| ResumeAnalyzer
    ResumeAnalyzer --> resumeAnalysis
    resumeAnalysis -->|"POST resume data"| ExternalAI
    ExternalAI -->|"JSON analysis"| resumeAnalysis
    resumeAnalysis --> ResumeAnalyzer
    ResumeAnalyzer --> ScoreBadge
    ResumeAnalyzer --> Summary
    ResumeAnalyzer --> Details
    ResumeAnalyzer --> ResumeCard
    ResumeAnalyzer --> ScoreCircle
    ResumeAnalyzer --> ScoreGauge
    reportDownloader -->|"Download report"| User

    %% Click Events
    click PublicAssets "https://github.com/prakharverma057/resume-analyzer/tree/master/public/"
    click Root "https://github.com/prakharverma057/resume-analyzer/blob/master/app/root.tsx"
    click Routes "https://github.com/prakharverma057/resume-analyzer/blob/master/app/routes.ts"
    click Home "https://github.com/prakharverma057/resume-analyzer/blob/master/app/routes/home.tsx"
    click Upload "https://github.com/prakharverma057/resume-analyzer/blob/master/app/routes/upload.tsx"
    click ResumeRoute "https://github.com/prakharverma057/resume-analyzer/blob/master/app/routes/resume.tsx"
    click Navbar "https://github.com/prakharverma057/resume-analyzer/blob/master/app/components/Navbar.tsx"
    click FileUploader "https://github.com/prakharverma057/resume-analyzer/blob/master/app/components/FileUploader.tsx"
    click ResumeAnalyzer "https://github.com/prakharverma057/resume-analyzer/blob/master/app/components/ResumeAnalyzer.tsx"
    click ResumeCard "https://github.com/prakharverma057/resume-analyzer/blob/master/app/components/ResumeCard.tsx"
    click ScoreBadge "https://github.com/prakharverma057/resume-analyzer/blob/master/app/components/ScoreBadge.tsx"
    click ScoreCircle "https://github.com/prakharverma057/resume-analyzer/blob/master/app/components/ScoreCircle.tsx"
    click ScoreGauge "https://github.com/prakharverma057/resume-analyzer/blob/master/app/components/ScoreGauge.tsx"
    click Summary "https://github.com/prakharverma057/resume-analyzer/blob/master/app/components/Summary.tsx"
    click Details "https://github.com/prakharverma057/resume-analyzer/blob/master/app/components/Details.tsx"
    click ATS "https://github.com/prakharverma057/resume-analyzer/blob/master/app/components/ATS.tsx"
    click Accordion "https://github.com/prakharverma057/resume-analyzer/blob/master/app/components/Accordion.tsx"
    click ClientOnly "https://github.com/prakharverma057/resume-analyzer/blob/master/app/components/ClientOnly.tsx"
    click Footer "https://github.com/prakharverma057/resume-analyzer/blob/master/app/components/Footer.tsx"
    click useFileUpload "https://github.com/prakharverma057/resume-analyzer/blob/master/app/hooks/useFileUpload.ts"
    click pdf2img "https://github.com/prakharverma057/resume-analyzer/blob/master/app/lib/pdf2img.ts"
    click resumeAnalysis "https://github.com/prakharverma057/resume-analyzer/blob/master/app/lib/resumeAnalysis.ts"
    click reportDownloader "https://github.com/prakharverma057/resume-analyzer/blob/master/app/lib/reportDownloader.ts"
    click utils "https://github.com/prakharverma057/resume-analyzer/blob/master/app/lib/utils.ts"
    click puterLib "https://github.com/prakharverma057/resume-analyzer/blob/master/app/lib/puter.ts"

    %% Styles
    classDef external fill:#f9f,stroke:#333,stroke-width:1px
    classDef storage fill:#9f9,stroke:#333,stroke-width:1px
    classDef cloud fill:#fcf,stroke:#333,stroke-width:1px
    classDef frontend fill:#bbf,stroke:#333,stroke-width:1px
    classDef entry fill:#eef,stroke:#333,stroke-width:1px
    classDef context fill:#cdf,stroke:#333,stroke-width:1px
    classDef routing fill:#bdf,stroke:#333,stroke-width:1px
    classDef ui fill:#ddf,stroke:#333,stroke-width:1px
    classDef service fill:#ffd,stroke:#333,stroke-width:1px
    class ReactApp frontend
```
