# itzv07/ats-resume-engine architecture

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

- Interactive diagram: https://gitdiagram.com/itzv07/ats-resume-engine
- Repository: https://github.com/itzv07/ats-resume-engine

## Overview

#### Purpose and Entry Points
This is a full-stack ATS resume analyzer and JD-specific resume builder. React mounts from `src/main.tsx` into the application coordinator in `src/App.tsx`. The Node/Express backend is `server.ts`, serving REST endpoints for document extraction, analysis, and optimized-resume generation.

#### Client Application Orchestration
`src/App.tsx` owns the user workflow and transitions between intake, analysis, editing/preview, comparison, and dashboard views. Shared contracts for resume profiles, ATS analysis, templates, and generation results belong in `src/types.ts`. UI is a browser SPA built with React, TypeScript, and Vite (`vite.config.ts`).

#### Resume and JD Intake
`src/components/ResumeUploader.tsx` accepts or displays source resume/JD content before requests are made. `src/components/CandidateForm.tsx` represents the structured candidate profile used for generation and user correction. Uploaded documents cross the browser/server boundary through the extraction API implemented in `server.ts`; extracted text becomes the canonical analysis input.

#### AI Analysis and Truthfulness Boundary
`server.ts` mediates all Gemini calls, keeping `GEMINI_API_KEY` server-side. Its analysis endpoint receives resume text plus a job description and returns structured ATS scoring, match breakdowns, missing requirements, keyword strategy, recommendations, and an extracted candidate profile. The fallback path in `src/lib/fallbackAnalyzer.ts` provides client-side/non-AI analysis behavior when needed. AI outputs are advisory and must remain grounded in candidate-provided facts.

#### Resume Generation Pipeline
Generation combines the candidate profile, original resume context, target JD, prior analysis, and a selected template. `server.ts` returns an optimized structured profile plus before/after scores, rationale, and highlighted changes. `src/components/TemplateSelector.tsx` chooses among definitions in `src/data/templates.ts`; `src/components/ResumePreview.tsx` renders the resulting editable, ATS-oriented document.

#### Review and Comparison Surfaces
`src/components/AnalysisView.tsx` presents compatibility and recommendations, supported by `src/components/AtsScoreGauge.tsx` for score visualization and `src/components/ResumeKeywordInspector.tsx` for keyword-focused review. `src/components/ResumeDiffView.tsx` compares original and generated resume outcomes, forming the user verification step before export.

#### Persistence, Identity, and Export
Session/history behavior is primarily browser-local, surfaced through `src/components/DashboardView.tsx`. Firebase is additionally wired through `src/context/AuthContext.tsx`, `src/lib/firebase.ts`, and `src/lib/firestoreService.ts`, with Firestore rules in `firestore.rules`; these form an optional authentication/cloud-data boundary rather than the core AI pipeline. `src/utils/exportResume.ts` turns the previewed resume into PDF/DOCX using client-side export libraries.

#### Runtime and External Services
Development and production are Node.js/Express plus Vite/React, configured through `package.json`, `vite.config.ts`, and `server.ts`. Google Gemini is the material external AI service. Firebase/Firestore configuration (`firebase-applet-config.json`, `firebase-blueprint.json`) supports auth/data integration. Environment setup is defined by `.env.example`, notably `GEMINI_API_KEY` and optional `APP_URL`.

Main entry points: [`src/App.tsx`](https://github.com/itzv07/ats-resume-engine/blob/main/src/App.tsx) (Application workflow), [`server.ts`](https://github.com/itzv07/ats-resume-engine/blob/main/server.ts) (Extraction, analysis & generation API), [`src/components/ResumePreview.tsx`](https://github.com/itzv07/ats-resume-engine/blob/main/src/components/ResumePreview.tsx) (Editable resume preview), [`src/components/ResumeUploader.tsx`](https://github.com/itzv07/ats-resume-engine/blob/main/src/components/ResumeUploader.tsx) (Resume & JD intake)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser SPA"]
  node_react_entry["React entry<br/>Vite entry<br/>[main.tsx]"]
  node_app["Application workflow<br/>React coordinator<br/>[App.tsx]"]
  node_contracts["Shared contracts<br/>TypeScript types<br/>[types.ts]"]
  node_intake["Resume &amp; JD intake<br/>React component<br/>[ResumeUploader.tsx]"]
  node_candidate_form["Candidate profile editor<br/>React component<br/>[CandidateForm.tsx]"]
  node_analysis_ui["Analysis review<br/>React views<br/>[AnalysisView.tsx]"]
  node_fallback["Fallback analyzer<br/>client analysis"]
  node_templates["Resume templates<br/>template definitions<br/>[templates.ts]"]
  node_template_selector["Template selector<br/>React component"]
  node_preview["Editable resume preview<br/>React renderer<br/>[ResumePreview.tsx]"]
  node_comparison["Outcome comparison<br/>React component<br/>[ResumeDiffView.tsx]"]
  node_dashboard["Session history dashboard<br/>React component<br/>[DashboardView.tsx]"]
  node_export["PDF/DOCX export<br/>client exporter<br/>[exportResume.ts]"]
end

subgraph group_backend["Node API"]
  node_api{{"Extraction, analysis &amp; generation API<br/>Express server<br/>[server.ts]"}}
end

subgraph group_cloud["Optional Cloud Services"]
  node_auth["Firebase auth context<br/>identity integration<br/>[AuthContext.tsx]"]
  node_firestore[("Firestore service<br/>cloud persistence")]
end

node_gemini{{"Google Gemini<br/>external AI service"}}

node_react_entry -->|"mounts"| node_app
node_app -->|"uses"| node_contracts
node_app -->|"intake flow"| node_intake
node_app -->|"corrects profile"| node_candidate_form
node_app -->|"shows analysis"| node_analysis_ui
node_app -->|"selects template"| node_template_selector
node_app -->|"edits and previews"| node_preview
node_app -->|"verifies result"| node_comparison
node_app -->|"shows history"| node_dashboard
node_intake -->|"uploads documents"| node_api
node_api -->|"extracted text and analysis"| node_app
node_app -.->|"fallback when needed"| node_fallback
node_analysis_ui -->|"informs revisions"| node_preview
node_template_selector -->|"loads definitions"| node_templates
node_candidate_form -->|"generation input"| node_api
node_templates -->|"selected template context"| node_api
node_api -->|"analysis and optimization"| node_gemini
node_preview -->|"generated resume"| node_comparison
node_preview -->|"exports document"| node_export
node_app -.->|"optional identity"| node_auth
node_auth -.->|"optional cloud data"| node_firestore

click node_react_entry "https://github.com/itzv07/ats-resume-engine/blob/main/src/main.tsx"
click node_app "https://github.com/itzv07/ats-resume-engine/blob/main/src/App.tsx"
click node_contracts "https://github.com/itzv07/ats-resume-engine/blob/main/src/types.ts"
click node_intake "https://github.com/itzv07/ats-resume-engine/blob/main/src/components/ResumeUploader.tsx"
click node_candidate_form "https://github.com/itzv07/ats-resume-engine/blob/main/src/components/CandidateForm.tsx"
click node_analysis_ui "https://github.com/itzv07/ats-resume-engine/blob/main/src/components/AnalysisView.tsx"
click node_fallback "https://github.com/itzv07/ats-resume-engine/blob/main/src/lib/fallbackAnalyzer.ts"
click node_templates "https://github.com/itzv07/ats-resume-engine/blob/main/src/data/templates.ts"
click node_template_selector "https://github.com/itzv07/ats-resume-engine/blob/main/src/components/TemplateSelector.tsx"
click node_preview "https://github.com/itzv07/ats-resume-engine/blob/main/src/components/ResumePreview.tsx"
click node_comparison "https://github.com/itzv07/ats-resume-engine/blob/main/src/components/ResumeDiffView.tsx"
click node_dashboard "https://github.com/itzv07/ats-resume-engine/blob/main/src/components/DashboardView.tsx"
click node_export "https://github.com/itzv07/ats-resume-engine/blob/main/src/utils/exportResume.ts"
click node_api "https://github.com/itzv07/ats-resume-engine/blob/main/server.ts"
click node_auth "https://github.com/itzv07/ats-resume-engine/blob/main/src/context/AuthContext.tsx"
click node_firestore "https://github.com/itzv07/ats-resume-engine/blob/main/src/lib/firestoreService.ts"

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_react_entry,node_app,node_contracts,node_intake,node_candidate_form,node_analysis_ui,node_fallback,node_templates,node_template_selector,node_preview,node_comparison,node_dashboard,node_export toneBlue
class node_api toneAmber
class node_auth,node_firestore toneMint
class node_gemini toneNeutral
```

## Components

### Browser SPA

React workflow, review, and export surfaces.

- [React entry](https://github.com/itzv07/ats-resume-engine/blob/main/src/main.tsx): Vite entry · `src/main.tsx`
- [Application workflow](https://github.com/itzv07/ats-resume-engine/blob/main/src/App.tsx): React coordinator · Owns intake, analysis, editing, comparison, and dashboard transitions. · `src/App.tsx`
- [Shared contracts](https://github.com/itzv07/ats-resume-engine/blob/main/src/types.ts): TypeScript types · `src/types.ts`
- [Resume & JD intake](https://github.com/itzv07/ats-resume-engine/blob/main/src/components/ResumeUploader.tsx): React component · `src/components/ResumeUploader.tsx`
- [Candidate profile editor](https://github.com/itzv07/ats-resume-engine/blob/main/src/components/CandidateForm.tsx): React component · `src/components/CandidateForm.tsx`
- [Analysis review](https://github.com/itzv07/ats-resume-engine/blob/main/src/components/AnalysisView.tsx): React views · Presents score, recommendations, and keyword review. · `src/components/AnalysisView.tsx`
- [Fallback analyzer](https://github.com/itzv07/ats-resume-engine/blob/main/src/lib/fallbackAnalyzer.ts): client analysis · Non-AI analysis behavior when needed. · `src/lib/fallbackAnalyzer.ts`
- [Resume templates](https://github.com/itzv07/ats-resume-engine/blob/main/src/data/templates.ts): template definitions · `src/data/templates.ts`
- [Template selector](https://github.com/itzv07/ats-resume-engine/blob/main/src/components/TemplateSelector.tsx): React component · `src/components/TemplateSelector.tsx`
- [Editable resume preview](https://github.com/itzv07/ats-resume-engine/blob/main/src/components/ResumePreview.tsx): React renderer · Renders the ATS-oriented generated document. · `src/components/ResumePreview.tsx`
- [Outcome comparison](https://github.com/itzv07/ats-resume-engine/blob/main/src/components/ResumeDiffView.tsx): React component · Verification before export. · `src/components/ResumeDiffView.tsx`
- [Session history dashboard](https://github.com/itzv07/ats-resume-engine/blob/main/src/components/DashboardView.tsx): React component · Primarily browser-local session and history behavior. · `src/components/DashboardView.tsx`
- [PDF/DOCX export](https://github.com/itzv07/ats-resume-engine/blob/main/src/utils/exportResume.ts): client exporter · `src/utils/exportResume.ts`

### Node API

Document, analysis, and generation boundary.

- [Extraction, analysis & generation API](https://github.com/itzv07/ats-resume-engine/blob/main/server.ts): Express server · Keeps Gemini credentials server-side and grounds AI output in candidate facts. · `server.ts`

### Optional Cloud Services

Authentication and cloud persistence integration.

- [Firebase auth context](https://github.com/itzv07/ats-resume-engine/blob/main/src/context/AuthContext.tsx): identity integration · `src/context/AuthContext.tsx`
- [Firestore service](https://github.com/itzv07/ats-resume-engine/blob/main/src/lib/firestoreService.ts): cloud persistence · Optional cloud-data boundary. · `src/lib/firestoreService.ts`

### Other components

- **Google Gemini**: external AI service

## Connections

- React entry → Application workflow: mounts
- Application workflow → Shared contracts: uses
- Application workflow → Resume & JD intake: intake flow
- Application workflow → Candidate profile editor: corrects profile
- Application workflow → Analysis review: shows analysis
- Application workflow → Template selector: selects template
- Application workflow → Editable resume preview: edits and previews
- Application workflow → Outcome comparison: verifies result
- Application workflow → Session history dashboard: shows history
- Resume & JD intake → Extraction, analysis & generation API: uploads documents
- Extraction, analysis & generation API → Application workflow: extracted text and analysis
- Application workflow → Fallback analyzer: fallback when needed
- Analysis review → Editable resume preview: informs revisions
- Template selector → Resume templates: loads definitions
- Candidate profile editor → Extraction, analysis & generation API: generation input
- Resume templates → Extraction, analysis & generation API: selected template context
- Extraction, analysis & generation API → Google Gemini: analysis and optimization
- Editable resume preview → Outcome comparison: generated resume
- Editable resume preview → PDF/DOCX export: exports document
- Application workflow → Firebase auth context: optional identity
- Firebase auth context → Firestore service: optional cloud data
