# stephenthangaraja/resume-builder architecture

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

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

## Overview

##### Project type and purpose
- This is a full-stack web application: a Resume Builder with ATS (Applicant Tracking System) and relevance-scoring features, AI-driven suggestions, and cover-letter generation.
- Frontend: React + Vite + Tailwind CSS SPA.
- Backend: Node.js + Express server.
- Persistence & hosting: Firebase (Auth, Firestore, Storage, Hosting).
- AI: Fine-tuned Gemini 1.5 Flash for suggestions and scoring.

##### File structure
- Top-level “frontend” and “backend” directories.
- Frontend substructure: “public/”, “src/” with “pages/”, “components/”, “contexts/”, “assets/”, “lib/”. This is a component-based SPA using Context API for state.
- Backend: single Express entrypoint (server.js), package.json, an uploads folder for file storage.
- Config files: Vite (frontend), Tailwind, ESLint, PostCSS, jsconfig, dotenv (for backend).
- Firebase config lives alongside src; the React app likely uses the Firebase SDK directly for Auth and Firestore.

##### Extract architecture insights from the README
- Frontend communicates with Firebase SDK for authentication, Firestore reads/writes, and Storage for file assets.
- Backend exposes RESTful endpoints for ATS score evaluation, relevance scoring, cover-letter generation, file uploads, and possibly for AI model integration.
- Backend must also coordinate calls to the Gemini 1.5 AI model (via API).
- Hosting: static build on Firebase Hosting or similar; Node server deployed separately (e.g. on Heroku, GCP, or Firebase Functions).

a. Main components
- Client (Browser) running the React SPA
- Firebase Services
- Authentication
- Firestore Database
- Storage
- (Optionally) Hosting
- Express Backend API
- AI Model Service (Gemini 1.5 Flash)
- Static Assets / File Upload (uploads folder)
b. Relationships and interactions
1. User → React SPA (UI pages, forms, resume templates)
2. React SPA ↔ Firebase Auth (signup, login)
3. React SPA ↔ Firestore (CRUD resume data)
4. React SPA ↔ Firebase Storage (upload/download resumes, cover letters)
5. React SPA → Backend API (HTTP REST calls) for:
- ATS scoring
- Relevance scoring
- AI-powered suggestions
- Cover-letter generation
6. Backend API → Gemini 1.5 AI Service (RPC or HTTP)
7. Backend API → Firestore/Storage (optionally store analysis results)
c. Architectural patterns & principles
- Component-based UI (React) with Context API for global state.
- SPA served statically; API layer separated from UI.
- RESTful service design in Express.
- Eventual consistency: UI fetches async results (analysis, scores).
- Single-responsibility principle: Backend handles compute-heavy AI tasks, frontend handles UX.
d. Key technologies
- Frontend: React, Vite, Tailwind CSS, Firebase JS SDK
- Backend: Node.js, Express, Firebase Admin SDK (optional), dotenv
- Database & Storage: Firebase Firestore, Firebase Storage
- AI Service: Gemini 1.5 Flash (external API)

##### Detail
- Asynchronous flows (e.g., user triggers analysis → API processes → UI refreshes).
- Error-handling or retry paths if relevant (e.g., failed AI call).

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "Client (Browser/React SPA)"
        direction TB
        Index["Index HTML"]:::frontend
        Main["SPA Entry (main.jsx)"]:::frontend
        Context["ResumeContext"]:::frontend
        subgraph "Pages"
            direction TB
            ATSCheck["ATSCheck.jsx"]:::frontend
            ChooseTemplate["ChooseTemplate.jsx"]:::frontend
            Forms["Forms.jsx"]:::frontend
            PromptSelect["PromptSelect.jsx"]:::frontend
            Write["Write.jsx"]:::frontend
            Login["Login.jsx"]:::frontend
            Signup["Signup.jsx"]:::frontend
            ResumeUploadPage["ResumeUploadPage.jsx"]:::frontend
            Print["Print.jsx"]:::frontend
            Examples["Examples.jsx"]:::frontend
            Guides["Guides.jsx"]:::frontend
            SplashPage["SplashPage.jsx"]:::frontend
            TextInputPage["TextInputPage.jsx"]:::frontend
        end
        subgraph "Components"
            direction TB
            Components["UI Components"]:::frontend
            ResumeUIPrimitives["Resume UI Primitives"]:::frontend
            UILib["Shared UI Library"]:::frontend
        end
        FirebaseSDK["Firebase SDK Integration"]:::frontend
        Utils["Utility Functions"]:::frontend
        ViteConfig["Vite Config"]:::frontend
        TailwindConfig["Tailwind Config"]:::frontend
        PostCSSConfig["PostCSS Config"]:::frontend
        ESLintConfig["ESLint Config"]:::frontend
        JSConfig1["jsconfig.json"]:::frontend
        JSConfig2["jsconfig.app.json"]:::frontend
    end

    subgraph "Firebase Services"
        direction TB
        Auth["Authentication"]:::external
        Firestore["Firestore Database"]:::database
        Storage["Storage"]:::external
        Hosting["Hosting"]:::external
    end

    subgraph "Backend API (Express)"
        direction TB
        ExpressAPI["Express API (server.js)"]:::backend
        PackageJSON["package.json"]:::backend
        Gitignore[".gitignore"]:::backend
    end

    subgraph "External AI Service"
        direction TB
        AI["Gemini 1.5 Flash"]:::external
    end

    %% Connections
    Index --> Main
    Main --> Context
    Main --> Components
    Main --> FirebaseSDK
    Main --> Utils

    Main -->|renders| ATSCheck
    Main -->|renders| ChooseTemplate
    Main -->|renders| Forms
    Main -->|renders| PromptSelect
    Main -->|renders| Write
    Main -->|renders| Login
    Main -->|renders| Signup
    Main -->|renders| ResumeUploadPage
    Main -->|renders| Print
    Main -->|renders| Examples
    Main -->|renders| Guides
    Main -->|renders| SplashPage
    Main -->|renders| TextInputPage

    Main --> ViteConfig
    Main --> TailwindConfig
    Main --> PostCSSConfig
    Main --> ESLintConfig
    Main --> JSConfig1
    Main --> JSConfig2

    Main -->|Auth API calls| Auth
    Main -->|Firestore read/write| Firestore
    Main -->|Storage upload/download| Storage

    Main -->|REST calls| ExpressAPI

    ExpressAPI -->|AI requests| AI
    ExpressAPI -->|optional store| Firestore
    ExpressAPI -->|optional store files| Storage

    %% Click Events
    click Main "https://github.com/stephenthangaraja/resume-builder/blob/main/frontend/src/main.jsx"
    click Index "https://github.com/stephenthangaraja/resume-builder/blob/main/frontend/index.html"
    click Context "https://github.com/stephenthangaraja/resume-builder/blob/main/frontend/src/contexts/ResumeContext.jsx"
    click ATSCheck "https://github.com/stephenthangaraja/resume-builder/blob/main/frontend/src/pages/ATSCheck.jsx"
    click ChooseTemplate "https://github.com/stephenthangaraja/resume-builder/blob/main/frontend/src/pages/ChooseTemplate.jsx"
    click Forms "https://github.com/stephenthangaraja/resume-builder/blob/main/frontend/src/pages/Forms.jsx"
    click PromptSelect "https://github.com/stephenthangaraja/resume-builder/blob/main/frontend/src/pages/PromptSelect.jsx"
    click Write "https://github.com/stephenthangaraja/resume-builder/blob/main/frontend/src/pages/Write.jsx"
    click Login "https://github.com/stephenthangaraja/resume-builder/blob/main/frontend/src/pages/Login.jsx"
    click Signup "https://github.com/stephenthangaraja/resume-builder/blob/main/frontend/src/pages/Signup.jsx"
    click ResumeUploadPage "https://github.com/stephenthangaraja/resume-builder/blob/main/frontend/src/pages/ResumeUploadPage.jsx"
    click Print "https://github.com/stephenthangaraja/resume-builder/blob/main/frontend/src/pages/Print.jsx"
    click Examples "https://github.com/stephenthangaraja/resume-builder/blob/main/frontend/src/pages/Examples.jsx"
    click Guides "https://github.com/stephenthangaraja/resume-builder/blob/main/frontend/src/pages/Guides.jsx"
    click SplashPage "https://github.com/stephenthangaraja/resume-builder/blob/main/frontend/src/pages/SplashPage.jsx"
    click TextInputPage "https://github.com/stephenthangaraja/resume-builder/blob/main/frontend/src/pages/TextInputPage.jsx"
    click Components "https://github.com/stephenthangaraja/resume-builder/tree/main/frontend/src/components/"
    click ResumeUIPrimitives "https://github.com/stephenthangaraja/resume-builder/tree/main/frontend/src/components/resume-ui/"
    click UILib "https://github.com/stephenthangaraja/resume-builder/tree/main/frontend/src/components/ui/"
    click FirebaseSDK "https://github.com/stephenthangaraja/resume-builder/blob/main/frontend/src/components/firebase.js"
    click Utils "https://github.com/stephenthangaraja/resume-builder/blob/main/frontend/src/lib/utils.js"
    click ViteConfig "https://github.com/stephenthangaraja/resume-builder/blob/main/frontend/vite.config.js"
    click TailwindConfig "https://github.com/stephenthangaraja/resume-builder/blob/main/frontend/tailwind.config.js"
    click PostCSSConfig "https://github.com/stephenthangaraja/resume-builder/blob/main/frontend/postcss.config.js"
    click ESLintConfig "https://github.com/stephenthangaraja/resume-builder/blob/main/frontend/eslint.config.js"
    click JSConfig1 "https://github.com/stephenthangaraja/resume-builder/blob/main/frontend/jsconfig.json"
    click JSConfig2 "https://github.com/stephenthangaraja/resume-builder/blob/main/frontend/jsconfig.app.json"
    click ExpressAPI "https://github.com/stephenthangaraja/resume-builder/blob/main/backend/server.js"
    click PackageJSON "https://github.com/stephenthangaraja/resume-builder/blob/main/backend/package.json"
    click Gitignore "https://github.com/stephenthangaraja/resume-builder/blob/main/backend/.gitignore"

    %% Styles
    classDef frontend fill:#E0F7FA,stroke:#0288D1,stroke-width:1px
    classDef backend fill:#E8F5E9,stroke:#388E3C,stroke-width:1px
    classDef external fill:#FFF3E0,stroke:#F57C00,stroke-width:1px
    classDef database fill:#FFEB3B,stroke:#FBC02D,stroke-width:1px,stroke-dasharray: 5 5
```
