# abhinavsaxena2308/ai-resume-builder architecture

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

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

## Overview

1. **Overall shape**
   - This repo is a two-tier application: a **React + Vite frontend** in the repository root and a separate **Node/Express backend** in `backend/`.
   - The frontend is the user-facing resume builder and content site; the backend is the API boundary for AI generation, resume data, and admin/protected operations.

2. **Frontend shell**
   - `src/main.jsx`, `src/App.jsx`, and `src/pages/` define the app runtime and route-level screens.
   - The page set includes the core product flows (`Builder`, `Dashboard`, `Auth`, `Admin`) plus informational pages (`AboutUs`, `CareerTips`, `InterviewTips`, `ResumeTips`, `ViewExamples`, legal pages, and `NotFound`).

3. **Resume-building UI**
   - The resume editor experience is composed from `EnhancedResumeForm`, `ResumePreview`, `TemplateSelector`, and the three template components under `src/components/ResumeTemplates/`.
   - This is the main interactive workflow: collect resume content, choose a visual template, and preview the output live in the browser.

4. **AI assistance path**
   - AI help is surfaced through `useGeminiSuggestions`, `AiSuggestionsPopup`, and the backend `geminiSuggestions` route.
   - The browser sends user input to the backend, the backend calls Google’s Generative Language API, and the suggestion text comes back as JSON for display in the UI.

5. **Frontend service boundary**
   - `src/services/api.js` is the frontend’s HTTP abstraction for backend calls.
   - This is the main boundary between the React app and Express API, keeping UI components from knowing backend details.

6. **Backend API structure**
   - `backend/server.js` is the Express entry point and mounts the route modules in `backend/routes/`.
   - The backend is split into three feature areas:
     - `routes/resumes.js` for resume CRUD or resume-related data operations
     - `routes/geminiSuggestions.js` for AI generation
     - `routes/admin.js` for protected/admin workflows

7. **Security and identity**
   - `backend/middleware/auth.js` is the main authorization gate for protected routes.
   - The frontend also has a Firebase integration client in `src/integrations/firebase/client.js`, indicating the app uses Firebase on the client side for identity/session-related concerns.

8. **Persistence and environment abstraction**
   - `backend/config/firebase.js` and `backend/config/mockFirestore.js` show a storage abstraction: the backend can talk to Firebase/Firestore in one mode and use a local mock in another.
   - That makes persistence and testing easier without changing higher-level route code.

9. **Rendering and presentation assets**
   - The backend includes `backend/templates/*.ejs` with ATS, classic, and modern variants, suggesting server-side templating or document rendering support.
   - The frontend mirrors this with template components, so the visual system is duplicated intentionally across browser preview and backend-rendered formats.

10. **Operational scripts and quality checks**
   - `backend/scripts/verify-connection.js`, `monitor.js`, and `archive.js` are maintenance utilities rather than user features.
   - `backend/tests/api.test.js` provides API-level verification, and the root `vercel.json` plus separate frontend/backend package files suggest deployment is configured as distinct runtime targets.

11. **Cross-cutting UI concerns**
   - `ThemeContext`, `ThemeToggle`, `BackgroundEffects`, `VideoBackground`, and the various UI primitives under `src/components/ui/` form the shared presentation layer.
   - Theme persistence is client-side via local storage, so it does not affect backend state or API contracts.

Main entry points: [`backend/server.js`](https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/backend/server.js) (Express server), [`src/pages/index.jsx`](https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/src/pages/index.jsx) (Pages), [`src/components/EnhancedResumeForm.jsx`](https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/src/components/EnhancedResumeForm.jsx) (Resume builder), [`backend/routes/admin.js`](https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/backend/routes/admin.js) (Admin API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_frontend_shell["App shell<br/>react runtime<br/>[main.jsx]"]
  node_frontend_routes["Pages<br/>route screens<br/>[index.jsx]"]
  node_resume_builder["Resume builder<br/>editor flow"]
  node_template_system["Templates<br/>presentation system"]
  node_ai_ui["AI assist<br/>suggestion UI"]
  node_frontend_api["API client<br/>http boundary<br/>[api.js]"]
  node_theme_ui["Theme UI<br/>shared UI<br/>[ThemeContext.jsx]"]
  node_firebase_client["Firebase client<br/>identity client<br/>[client.js]"]
end

subgraph group_backend["Backend"]
  node_backend_server["Express server<br/>api runtime<br/>[server.js]"]
  node_resumes_route["Resumes API<br/>resource routes<br/>[resumes.js]"]
  node_gemini_route["Gemini API<br/>ai route"]
  node_admin_route["Admin API<br/>protected routes<br/>[admin.js]"]
  node_auth_gate["Auth gate<br/>middleware<br/>[auth.js]"]
  node_storage_config[("Storage config<br/>persistence abstraction<br/>[firebase.js]")]
  node_template_assets["EJS templates<br/>rendering assets<br/>[modern.ejs]"]
  node_ops_scripts["Ops scripts<br/>maintenance tools<br/>[monitor.js]"]
  node_api_tests["API tests<br/>test suite<br/>[api.test.js]"]
end

node_frontend_shell -->|"renders"| node_frontend_routes
node_frontend_routes -->|"includes"| node_resume_builder
node_resume_builder -->|"chooses"| node_template_system
node_resume_builder -->|"requests help"| node_ai_ui
node_ai_ui -->|"calls"| node_frontend_api
node_frontend_routes -->|"shares UI"| node_theme_ui
node_frontend_routes -->|"uses identity"| node_firebase_client
node_frontend_api -->|"requests"| node_backend_server
node_backend_server -->|"mounts"| node_resumes_route
node_backend_server -->|"mounts"| node_gemini_route
node_backend_server -->|"mounts"| node_admin_route
node_admin_route -->|"protects"| node_auth_gate
node_resumes_route -->|"persists via"| node_storage_config
node_admin_route -->|"persists via"| node_storage_config
node_gemini_route -->|"reads config"| node_storage_config
node_template_assets -->|"mirrors"| node_template_system
node_ops_scripts -.->|"maintain"| node_backend_server
node_api_tests -.->|"verifies"| node_backend_server

click node_frontend_shell "https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/src/main.jsx"
click node_frontend_routes "https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/src/pages/index.jsx"
click node_resume_builder "https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/src/components/EnhancedResumeForm.jsx"
click node_template_system "https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/src/components/ResumeTemplates/TemplateSelector.jsx"
click node_ai_ui "https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/src/hooks/useGeminiSuggestions.js"
click node_frontend_api "https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/src/services/api.js"
click node_theme_ui "https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/src/contexts/ThemeContext.jsx"
click node_firebase_client "https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/src/integrations/firebase/client.js"
click node_backend_server "https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/backend/server.js"
click node_resumes_route "https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/backend/routes/resumes.js"
click node_gemini_route "https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/backend/routes/geminiSuggestions.js"
click node_admin_route "https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/backend/routes/admin.js"
click node_auth_gate "https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/backend/middleware/auth.js"
click node_storage_config "https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/backend/config/firebase.js"
click node_template_assets "https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/backend/templates/modern.ejs"
click node_ops_scripts "https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/backend/scripts/monitor.js"
click node_api_tests "https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/backend/tests/api.test.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_frontend_shell,node_frontend_routes,node_resume_builder,node_template_system,node_ai_ui,node_frontend_api,node_theme_ui,node_firebase_client toneBlue
class node_backend_server,node_resumes_route,node_gemini_route,node_admin_route,node_auth_gate,node_storage_config,node_template_assets,node_ops_scripts,node_api_tests toneAmber
```

## Components

### Frontend

React + Vite app in the repo root

- [App shell](https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/src/main.jsx): react runtime · Bootstraps the SPA and route-level navigation · `src/main.jsx`
- [Pages](https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/src/pages/index.jsx): route screens · Product and content pages for the app · `src/pages/index.jsx`
- [Resume builder](https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/src/components/EnhancedResumeForm.jsx): editor flow · Core resume creation and live preview workflow · `src/components/EnhancedResumeForm.jsx`
- [Templates](https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/src/components/ResumeTemplates/TemplateSelector.jsx): presentation system · Resume template selection and visual variants · `src/components/ResumeTemplates/TemplateSelector.jsx`
- [AI assist](https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/src/hooks/useGeminiSuggestions.js): suggestion UI · Browser-side Gemini suggestion trigger and popup display · `src/hooks/useGeminiSuggestions.js`
- [API client](https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/src/services/api.js): http boundary · Frontend abstraction for backend requests · `src/services/api.js`
- [Theme UI](https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/src/contexts/ThemeContext.jsx): shared UI · Global theming and reusable presentation components · `src/contexts/ThemeContext.jsx`
- [Firebase client](https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/src/integrations/firebase/client.js): identity client · Client-side Firebase integration for session or identity concerns · `src/integrations/firebase/client.js`

### Backend

Express API and supporting server-side assets

- [Express server](https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/backend/server.js): api runtime · Backend entry point that mounts feature routes · `backend/server.js`
- [Resumes API](https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/backend/routes/resumes.js): resource routes · Resume CRUD and resume-related data operations · `backend/routes/resumes.js`
- [Gemini API](https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/backend/routes/geminiSuggestions.js): ai route · Backend endpoint that calls the Generative Language API · `backend/routes/geminiSuggestions.js`
- [Admin API](https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/backend/routes/admin.js): protected routes · Admin and privileged backend workflows · `backend/routes/admin.js`
- [Auth gate](https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/backend/middleware/auth.js): middleware · Authorization middleware for protected routes · `backend/middleware/auth.js`
- [Storage config](https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/backend/config/firebase.js): persistence abstraction · Switches between Firebase/Firestore and local mock persistence · `backend/config/firebase.js`
- [EJS templates](https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/backend/templates/modern.ejs): rendering assets · Server-side ATS, classic, and modern template variants · `backend/templates/modern.ejs`
- [Ops scripts](https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/backend/scripts/monitor.js): maintenance tools · Verification, monitoring, and archive utilities · `backend/scripts/monitor.js`
- [API tests](https://github.com/abhinavsaxena2308/ai-resume-builder/blob/master/backend/tests/api.test.js): test suite · Backend API-level verification · `backend/tests/api.test.js`

## Connections

- App shell → Pages: renders · The app shell hosts the route-level screens
- Pages → Resume builder: includes · Builder pages surface the core editing workflow
- Resume builder → Templates: chooses · Editor flow selects a visual template
- Resume builder → AI assist: requests help · The editor can open AI suggestions for the current content
- AI assist → API client: calls · Suggestion requests go through the shared API client
- Pages → Theme UI: shares UI · Pages use common theme and presentation components
- Pages → Firebase client: uses identity · Client-side Firebase supports auth/session concerns
- API client → Express server: requests · Frontend HTTP calls terminate at the Express API
- Express server → Resumes API: mounts · Server exposes resume-related endpoints
- Express server → Gemini API: mounts · Server exposes AI suggestion endpoints
- Express server → Admin API: mounts · Server exposes protected admin endpoints
- Admin API → Auth gate: protects · Admin workflows are guarded by authorization middleware
- Resumes API → Storage config: persists via · Resume data flows through the storage abstraction
- Admin API → Storage config: persists via · Admin workflows also rely on the same persistence layer
- Gemini API → Storage config: reads config · AI route shares the backend environment and storage setup
- EJS templates → Templates: mirrors · Server-rendered and browser-rendered templates stay aligned
- Ops scripts → Express server: maintain · Utility scripts support backend operations
- API tests → Express server: verifies · Tests exercise the API surface
