# visheshrao17/resume_builder- architecture

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

- Interactive diagram: https://gitdiagram.com/visheshrao17/resume_builder-
- Repository: https://github.com/visheshrao17/resume_builder-

## Overview

1. **Two-tier architecture**
   - The repo is split into a **React/Vite client** and an **Express/MongoDB server**.
   - The client owns the resume-building UI, local draft state, client-side scoring, and PDF preview/export.
   - The server owns persistence, authentication, and AI-assisted resume rewriting.

2. **Frontend shell and navigation**
   - `client/src/App.jsx`, `main.jsx`, and `pages/` define the app entry and page-level boundaries.
   - The main user flows are represented by `Home`, `Login`, `Dashboard`, `ResumeBuilder`, `Preview`, and `Layout`.
   - This suggests a routed SPA with a marketing entry point plus an authenticated workspace.

3. **State management split**
   - The client uses **Zustand** stores for transient UI/auth concerns: `useAuthStore` and `useUIStore`.
   - **TanStack Query** is used for server-synced resume data through `useResumes` and `queryClient`.
   - Draft resume data can be stored locally via `useLocalDraft`, enabling offline/anonymous editing before syncing.

4. **Resume editor as a composed form system**
   - The builder is broken into section-specific components: personal info, summary, education, experience, projects, and skills.
   - `TemplateSelector` and `ColorPicker` control presentation rather than content.
   - This indicates a structured resume object assembled from independent form slices.

5. **Template-driven preview layer**
   - `ResumePreview` renders the selected design using template components in `components/templates/`.
   - The available templates include `Classic`, `Modern`, `Minimal`, and `MinimalImage`.
   - The preview layer is separate from the form layer, so content editing and visual styling are decoupled.

6. **PDF generation/export boundary**
   - The PDF subsystem lives under `components/pdf/` and likely uses `@react-pdf/renderer` as described in the README.
   - `PDFDocument`, `PDFStyles`, and `DownloadButton` form the export pipeline.
   - This is a distinct rendering path from the on-screen preview, which matters for ATS-safe vector output.

7. **ATS simulation and scoring UI**
   - The `components/ats/` area contains `ATSPreview` and `ATSScoreCard`, and `components/scoring/MatchScorePanel` handles resume-vs-job-description scoring.
   - The README says the match scoring is powered client-side by a **BM25** retrieval algorithm in `lib/bm25.js`.
   - This keeps the scoring/diagnostics experience local to the browser rather than dependent on the API.

8. **Client-side algorithmic module**
   - `client/src/lib/bm25.js` is a focused utility with its own test file, `bm25.test.js`.
   - That makes the scoring logic an isolated computational subsystem with test coverage in Vitest.
   - The architecture therefore includes both UI-driven and algorithm-driven client logic.

9. **Marketing/home experience**
   - The `components/home/` folder contains the landing-page composition: hero, banner, features, testimonials, CTA, title, and footer.
   - This is a separate public-facing surface from the authenticated builder flow.
   - It likely acts as the acquisition layer feeding into login or resume creation.

10. **Backend API surface**
   - The server exposes three route groups: `user.routes.js`, `resume.routes.js`, and `ai.routes.js`.
   - Controllers under `controllers/` map those routes to user management, resume persistence, and AI operations.
   - `middleware/auth.middleware.js` suggests protected endpoints for authenticated resume access.

11. **Persistence and external services**
   - MongoDB is the primary database, with `models/user.model.js` and `models/resume.model.js` defining stored entities.
   - `configs/db.js` manages the database connection.
   - `configs/ai.js` integrates OpenAI for the bullet-rewriting feature described in the README.
   - `configs/imageKit.js` and `configs/multer.js` imply media upload/hosting support, likely for profile images or resume assets.

12. **Data flow through the system**
   - A user edits resume sections in the client, with drafts optionally saved locally first.
   - When authenticated, resume state is synchronized to the backend through query-based fetch/mutation flows.
   - The same resume data can then be rendered into a visual template, exported as PDF, or analyzed for ATS/match scoring.
   - AI-assisted content rewriting flows from the builder UI to the server’s OpenAI-backed endpoint and returns improved bullet text.

13. **Operational/tooling boundary**
   - The repo includes **Vitest** for algorithm tests and **Playwright** for browser-level E2E checks.
   - `.github/workflows/ci.yml` indicates CI gating on build/test health.
   - This is a repository with both UI correctness and algorithm correctness enforced in automation.

14. **Overall architecture summary**
   - The system is best diagrammed as: **public marketing site + authenticated resume builder + client-side scoring/export engine + API server + MongoDB/OpenAI integrations**.
   - The key architectural boundary is that content editing, template rendering, ATS scoring, and PDF generation are primarily client-side, while persistence and AI assistance are server-side.

Main entry points: [`client/src/pages/ResumeBuilder.jsx`](https://github.com/visheshrao17/resume_builder-/blob/main/client/src/pages/ResumeBuilder.jsx) (Builder), [`client/src/pages`](https://github.com/visheshrao17/resume_builder-/tree/main/client/src/pages) (Pages), [`client/src/pages/Preview.jsx`](https://github.com/visheshrao17/resume_builder-/blob/main/client/src/pages/Preview.jsx) (Preview page), [`server/controllers`](https://github.com/visheshrao17/resume_builder-/tree/main/server/controllers) (Controllers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client"]
  node_client_app["App shell<br/>SPA entry<br/>[App.jsx]"]
  node_client_pages["Pages<br/>routes"]
  node_client_home["Home view<br/>marketing page<br/>[Home.jsx]"]
  node_client_builder["Builder<br/>editor page<br/>[ResumeBuilder.jsx]"]
  node_client_preview_page["Preview page<br/>[Preview.jsx]"]
  node_client_dashboard["Dashboard<br/>workspace page<br/>[Dashboard.jsx]"]
  node_client_layout["Layout<br/>shell component<br/>[Layout.jsx]"]
  node_client_stores[("UI stores<br/>state")]
  node_client_queries[("Resume queries<br/>data sync<br/>[useResumes.js]")]
  node_client_draft[("Local draft<br/>offline state<br/>[useLocalDraft.js]")]
  node_client_forms["Editor forms<br/>form system"]
  node_client_template["Templates<br/>rendering"]
  node_client_pdf["PDF export<br/>export pipeline"]
  node_client_ats["ATS tools<br/>analysis UI"]
  node_client_bm25["BM25 scorer<br/>algorithm<br/>[bm25.js]"]
  node_client_home_components["Home modules<br/>marketing UI"]
end

subgraph group_server["Server"]
  node_server_app["Server entry<br/>API host<br/>[server.js]"]
  node_server_routes["Routes"]
  node_server_controllers["Controllers<br/>request handlers"]
  node_server_models[("Models<br/>persistence schema")]
  node_server_configs["Services<br/>integrations"]
  node_server_auth["Auth middleware<br/>guard<br/>[auth.middleware.js]"]
end

subgraph group_tooling["Tooling"]
  node_tool_ci["CI workflow<br/>automation<br/>[ci.yml]"]
  node_tool_e2e["E2E spec<br/>browser test"]
  node_tool_bm25_test["BM25 test<br/>unit test<br/>[bm25.test.js]"]
end

node_client_app -->|"routes"| node_client_pages
node_client_pages -->|"public"| node_client_home
node_client_pages -->|"workspace"| node_client_builder
node_client_pages -->|"preview"| node_client_preview_page
node_client_pages -->|"dashboard"| node_client_dashboard
node_client_pages -->|"wraps"| node_client_layout
node_client_builder -->|"edits"| node_client_forms
node_client_builder -->|"ui state"| node_client_stores
node_client_builder -->|"syncs"| node_client_queries
node_client_builder -->|"drafts"| node_client_draft
node_client_builder -->|"styles"| node_client_template
node_client_template -->|"renders"| node_client_preview_page
node_client_preview_page -->|"exports"| node_client_pdf
node_client_preview_page -->|"analyzes"| node_client_ats
node_client_ats -->|"scores"| node_client_bm25
node_client_home -->|"composes"| node_client_home_components
node_client_queries -->|"api"| node_server_app
node_client_stores -->|"auth"| node_server_app
node_client_forms -->|"feeds"| node_client_template
node_client_pdf -->|"source"| node_client_template
node_server_app -->|"mounts"| node_server_routes
node_server_routes -->|"delegates"| node_server_controllers
node_server_controllers -->|"persists"| node_server_models
node_server_controllers -->|"integrates"| node_server_configs
node_server_routes -->|"protects"| node_server_auth
node_server_configs -->|"db"| node_server_models
node_server_configs -->|"ai"| node_server_controllers
node_tool_ci -->|"checks"| node_client_app
node_tool_ci -->|"checks"| node_server_app
node_tool_e2e -->|"covers"| node_client_builder
node_tool_bm25_test -->|"covers"| node_client_bm25

click node_client_app "https://github.com/visheshrao17/resume_builder-/blob/main/client/src/App.jsx"
click node_client_pages "https://github.com/visheshrao17/resume_builder-/tree/main/client/src/pages"
click node_client_home "https://github.com/visheshrao17/resume_builder-/blob/main/client/src/pages/Home.jsx"
click node_client_builder "https://github.com/visheshrao17/resume_builder-/blob/main/client/src/pages/ResumeBuilder.jsx"
click node_client_preview_page "https://github.com/visheshrao17/resume_builder-/blob/main/client/src/pages/Preview.jsx"
click node_client_dashboard "https://github.com/visheshrao17/resume_builder-/blob/main/client/src/pages/Dashboard.jsx"
click node_client_layout "https://github.com/visheshrao17/resume_builder-/blob/main/client/src/pages/Layout.jsx"
click node_client_stores "https://github.com/visheshrao17/resume_builder-/tree/main/client/src/stores"
click node_client_queries "https://github.com/visheshrao17/resume_builder-/blob/main/client/src/hooks/useResumes.js"
click node_client_draft "https://github.com/visheshrao17/resume_builder-/blob/main/client/src/hooks/useLocalDraft.js"
click node_client_forms "https://github.com/visheshrao17/resume_builder-/tree/main/client/src/components"
click node_client_template "https://github.com/visheshrao17/resume_builder-/tree/main/client/src/components/templates"
click node_client_pdf "https://github.com/visheshrao17/resume_builder-/tree/main/client/src/components/pdf"
click node_client_ats "https://github.com/visheshrao17/resume_builder-/tree/main/client/src/components/ats"
click node_client_bm25 "https://github.com/visheshrao17/resume_builder-/blob/main/client/src/lib/bm25.js"
click node_client_home_components "https://github.com/visheshrao17/resume_builder-/tree/main/client/src/components/home"
click node_server_app "https://github.com/visheshrao17/resume_builder-/blob/main/server/server.js"
click node_server_routes "https://github.com/visheshrao17/resume_builder-/tree/main/server/routes"
click node_server_controllers "https://github.com/visheshrao17/resume_builder-/tree/main/server/controllers"
click node_server_models "https://github.com/visheshrao17/resume_builder-/tree/main/server/models"
click node_server_configs "https://github.com/visheshrao17/resume_builder-/tree/main/server/configs"
click node_server_auth "https://github.com/visheshrao17/resume_builder-/blob/main/server/middleware/auth.middleware.js"
click node_tool_ci "https://github.com/visheshrao17/resume_builder-/blob/main/.github/workflows/ci.yml"
click node_tool_e2e "https://github.com/visheshrao17/resume_builder-/blob/main/e2e/resume-builder.spec.js"
click node_tool_bm25_test "https://github.com/visheshrao17/resume_builder-/blob/main/client/src/lib/bm25.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_client_app,node_client_pages,node_client_home,node_client_builder,node_client_preview_page,node_client_dashboard,node_client_layout,node_client_stores,node_client_queries,node_client_draft,node_client_forms,node_client_template,node_client_pdf,node_client_ats,node_client_bm25,node_client_home_components toneBlue
class node_server_app,node_server_routes,node_server_controllers,node_server_models,node_server_configs,node_server_auth toneAmber
class node_tool_ci,node_tool_e2e,node_tool_bm25_test toneMint
```

## Components

### Client

React/Vite SPA for resume creation, preview, scoring, and export.

- [App shell](https://github.com/visheshrao17/resume_builder-/blob/main/client/src/App.jsx): SPA entry · React entry and routed application shell. · `client/src/App.jsx`
- [Pages](https://github.com/visheshrao17/resume_builder-/tree/main/client/src/pages): routes · Public and authenticated page-level boundaries. · `client/src/pages`
- [Home view](https://github.com/visheshrao17/resume_builder-/blob/main/client/src/pages/Home.jsx): marketing page · Public landing experience and acquisition flow. · `client/src/pages/Home.jsx`
- [Builder](https://github.com/visheshrao17/resume_builder-/blob/main/client/src/pages/ResumeBuilder.jsx): editor page · Authenticated resume editing workspace. · `client/src/pages/ResumeBuilder.jsx`
- [Preview page](https://github.com/visheshrao17/resume_builder-/blob/main/client/src/pages/Preview.jsx): preview page · Dedicated resume preview and export surface. · `client/src/pages/Preview.jsx`
- [Dashboard](https://github.com/visheshrao17/resume_builder-/blob/main/client/src/pages/Dashboard.jsx): workspace page · Authenticated overview and resume management view. · `client/src/pages/Dashboard.jsx`
- [Layout](https://github.com/visheshrao17/resume_builder-/blob/main/client/src/pages/Layout.jsx): shell component · Shared page chrome and navigation wrapper. · `client/src/pages/Layout.jsx`
- [UI stores](https://github.com/visheshrao17/resume_builder-/tree/main/client/src/stores): state · Client state for auth and UI concerns. · `client/src/stores`
- [Resume queries](https://github.com/visheshrao17/resume_builder-/blob/main/client/src/hooks/useResumes.js): data sync · TanStack Query hooks for resume fetch and mutation. · `client/src/hooks/useResumes.js`
- [Local draft](https://github.com/visheshrao17/resume_builder-/blob/main/client/src/hooks/useLocalDraft.js): offline state · Browser-side draft persistence before sync. · `client/src/hooks/useLocalDraft.js`
- [Editor forms](https://github.com/visheshrao17/resume_builder-/tree/main/client/src/components): form system · Sectioned resume inputs for content assembly. · `client/src/components`
- [Templates](https://github.com/visheshrao17/resume_builder-/tree/main/client/src/components/templates): rendering · Template selection and preview rendering layer. · `client/src/components/templates`
- [PDF export](https://github.com/visheshrao17/resume_builder-/tree/main/client/src/components/pdf): export pipeline · On-demand PDF document rendering and download. · `client/src/components/pdf`
- [ATS tools](https://github.com/visheshrao17/resume_builder-/tree/main/client/src/components/ats): analysis UI · ATS preview, score card, and match scoring panel. · `client/src/components/ats`
- [BM25 scorer](https://github.com/visheshrao17/resume_builder-/blob/main/client/src/lib/bm25.js): algorithm · Client-side retrieval scoring for job-match analysis. · `client/src/lib/bm25.js`
- [Home modules](https://github.com/visheshrao17/resume_builder-/tree/main/client/src/components/home): marketing UI · Hero, features, testimonials, and CTA composition. · `client/src/components/home`

### Server

Express API for auth, persistence, and AI-assisted rewriting.

- [Server entry](https://github.com/visheshrao17/resume_builder-/blob/main/server/server.js): API host · Express application bootstrap and middleware wiring. · `server/server.js`
- [Routes](https://github.com/visheshrao17/resume_builder-/tree/main/server/routes): api routes · User, resume, and AI route groups. · `server/routes`
- [Controllers](https://github.com/visheshrao17/resume_builder-/tree/main/server/controllers): request handlers · Route handlers for auth, persistence, and AI actions. · `server/controllers`
- [Models](https://github.com/visheshrao17/resume_builder-/tree/main/server/models): persistence schema · MongoDB user and resume data models. · `server/models`
- [Services](https://github.com/visheshrao17/resume_builder-/tree/main/server/configs): integrations · Database, OpenAI, upload, and media configuration. · `server/configs`
- [Auth middleware](https://github.com/visheshrao17/resume_builder-/blob/main/server/middleware/auth.middleware.js): guard · Protected route enforcement for authenticated access. · `server/middleware/auth.middleware.js`

### Tooling

Tests and CI around client, server, and end-to-end flows.

- [CI workflow](https://github.com/visheshrao17/resume_builder-/blob/main/.github/workflows/ci.yml): automation · Repository CI gating for build and test health. · `.github/workflows/ci.yml`
- [E2E spec](https://github.com/visheshrao17/resume_builder-/blob/main/e2e/resume-builder.spec.js): browser test · Playwright coverage for the resume builder flow. · `e2e/resume-builder.spec.js`
- [BM25 test](https://github.com/visheshrao17/resume_builder-/blob/main/client/src/lib/bm25.test.js): unit test · Vitest coverage for the scoring algorithm. · `client/src/lib/bm25.test.js`

## Connections

- App shell → Pages: routes · App shell defines page-level navigation.
- Pages → Home view: public · Landing page surface.
- Pages → Builder: workspace · Authenticated editor flow.
- Pages → Preview page: preview · Dedicated preview/export page.
- Pages → Dashboard: dashboard · Resume management surface.
- Pages → Layout: wraps · Shared shell around pages.
- Builder → Editor forms: edits · Structured section forms assemble resume content.
- Builder → UI stores: ui state · Auth and UI state management.
- Builder → Resume queries: syncs · Server-backed resume data flow.
- Builder → Local draft: drafts · Local first editing before sync.
- Builder → Templates: styles · Template selection and visual composition.
- Templates → Preview page: renders · Preview uses template components.
- Preview page → PDF export: exports · PDF rendering boundary for download.
- Preview page → ATS tools: analyzes · ATS diagnostics and match scoring surface.
- ATS tools → BM25 scorer: scores · Client-side BM25 ranking logic.
- Home view → Home modules: composes · Landing page UI modules.
- Resume queries → Server entry: api · Data sync calls into backend endpoints.
- UI stores → Server entry: auth · Client auth state supports protected API use.
- Editor forms → Templates: feeds · Edited content flows into rendering.
- PDF export → Templates: source · PDF export uses resume content and layout decisions.
- Server entry → Routes: mounts · Express entry wires route groups.
- Routes → Controllers: delegates · Routes hand off request handling.
- Controllers → Models: persists · Controllers read and write MongoDB entities.
- Controllers → Services: integrates · Controllers use AI and infrastructure services.
- Routes → Auth middleware: protects · Auth middleware secures private endpoints.
- Services → Models: db · Database connection underpins persistence.
- Services → Controllers: ai · OpenAI-backed rewriting supports resume assistance.
- CI workflow → App shell: checks · CI validates client build and tests.
- CI workflow → Server entry: checks · CI validates server build and tests.
- E2E spec → Builder: covers · End-to-end coverage for editor flow.
- BM25 test → BM25 scorer: covers · Algorithm test coverage for scoring logic.
