# lakshaykarad/truthcv architecture

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

- Interactive diagram: https://gitdiagram.com/lakshaykarad/truthcv
- Repository: https://github.com/lakshaykarad/truthcv

## Overview

TruthCV is a web application for tailoring resumes to job descriptions. Its main workflow accepts a PDF resume, extracts structured facts, chunks and embeds them, then stores the resume and searchable evidence. Generation endpoints extract job requirements and use retrieval-backed generation for tailored resumes, cover letters, and question answers; a separate endpoint scores skill matches. The graph includes the documented API, persistence, and model-service boundaries. Several source excerpts are partial, and the README is empty, so unshown wiring is omitted or marked unverified.

Main entry points: [`app/main.py`](https://github.com/lakshaykarad/truthcv/blob/main/app/main.py) (FastAPI application), [`app/routers/resume.py`](https://github.com/lakshaykarad/truthcv/blob/main/app/routers/resume.py) (Resume endpoints), [`app/routers/generate.py`](https://github.com/lakshaykarad/truthcv/blob/main/app/routers/generate.py) (Generation endpoints), [`app/pipeline/generator.py`](https://github.com/lakshaykarad/truthcv/blob/main/app/pipeline/generator.py) (Content generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_frontend["Web interface<br/>[app.js]"]
  node_api["FastAPI application<br/>[main.py]"]
  node_resume_api["Resume endpoints<br/>[resume.py]"]
  node_generate_api["Generation endpoints<br/>[generate.py]"]
  node_download_api["Download endpoint<br/>[download.py]"]
  node_health_api["Health endpoint<br/>[health.py]"]
end

subgraph group_resume["Resume processing"]
  node_pdf_reader["PDF reader<br/>[pdf_reader.py]"]
  node_resume_extractor["Resume extractor<br/>[extractor.py]"]
  node_chunker["Resume chunker<br/>[chunker.py]"]
  node_embedder["Text embedder<br/>[embedder.py]"]
end

subgraph group_matching["Matching and generation"]
  node_jd_extractor["Job description extractor<br/>[extractor.py]"]
  node_retriever["Evidence retriever<br/>[retriever.py]"]
  node_scorer["Skill scorer<br/>[scorer.py]"]
  node_generator["Content generator<br/>[generator.py]"]
  node_pdf_writer["PDF writer<br/>[pdf_writer.py]"]
end

subgraph group_data["Persistence"]
  node_queries["Database queries<br/>[queries.py]"]
  node_models["Data models<br/>[models.py]"]
  node_session["Database session<br/>[session.py]"]
  node_database[("PostgreSQL with pgvector")]
  node_config["Application settings<br/>[config.py]"]
end

node_user(("User"))
node_ollama{{"Ollama service"}}
node_groq{{"Groq service"}}

node_user -->|"uses"| node_frontend
node_frontend -->|"served by"| node_api
node_api -->|"registers"| node_resume_api
node_api -->|"registers"| node_generate_api
node_api -->|"registers"| node_download_api
node_api -->|"registers"| node_health_api
node_resume_api -->|"reads PDF"| node_pdf_reader
node_resume_api -->|"extracts facts"| node_resume_extractor
node_resume_api -->|"chunks resume"| node_chunker
node_resume_api -->|"embeds chunks"| node_embedder
node_resume_api -->|"saves resume"| node_queries
node_generate_api -->|"extracts requirements"| node_jd_extractor
node_generate_api -->|"generates content"| node_generator
node_generate_api -->|"scores match"| node_scorer
node_generate_api -->|"renders PDF"| node_pdf_writer
node_generator -->|"retrieves evidence"| node_retriever
node_scorer -->|"finds evidence"| node_retriever
node_retriever -->|"embeds queries"| node_embedder
node_resume_extractor -->|"requests extraction"| node_ollama
node_jd_extractor -->|"requests extraction"| node_ollama
node_embedder -->|"requests embeddings"| node_ollama
node_generator -.->|"generates text"| node_groq
node_queries -->|"uses models"| node_models
node_queries -->|"reads and writes"| node_database
node_session -->|"loads settings"| node_config
node_session -->|"connects"| node_database
node_api -->|"creates tables"| node_models
node_api -->|"uses engine"| node_session
node_download_api -->|"uses output settings"| node_config

click node_frontend "https://github.com/lakshaykarad/truthcv/blob/main/frontend/app.js"
click node_api "https://github.com/lakshaykarad/truthcv/blob/main/app/main.py"
click node_resume_api "https://github.com/lakshaykarad/truthcv/blob/main/app/routers/resume.py"
click node_generate_api "https://github.com/lakshaykarad/truthcv/blob/main/app/routers/generate.py"
click node_download_api "https://github.com/lakshaykarad/truthcv/blob/main/app/routers/download.py"
click node_health_api "https://github.com/lakshaykarad/truthcv/blob/main/app/routers/health.py"
click node_pdf_reader "https://github.com/lakshaykarad/truthcv/blob/main/app/pipeline/pdf_reader.py"
click node_resume_extractor "https://github.com/lakshaykarad/truthcv/blob/main/app/pipeline/extractor.py"
click node_chunker "https://github.com/lakshaykarad/truthcv/blob/main/app/pipeline/chunker.py"
click node_embedder "https://github.com/lakshaykarad/truthcv/blob/main/app/pipeline/embedder.py"
click node_jd_extractor "https://github.com/lakshaykarad/truthcv/blob/main/app/pipeline/extractor.py"
click node_retriever "https://github.com/lakshaykarad/truthcv/blob/main/app/pipeline/retriever.py"
click node_scorer "https://github.com/lakshaykarad/truthcv/blob/main/app/pipeline/scorer.py"
click node_generator "https://github.com/lakshaykarad/truthcv/blob/main/app/pipeline/generator.py"
click node_pdf_writer "https://github.com/lakshaykarad/truthcv/blob/main/app/pipeline/pdf_writer.py"
click node_queries "https://github.com/lakshaykarad/truthcv/blob/main/app/db/queries.py"
click node_models "https://github.com/lakshaykarad/truthcv/blob/main/app/db/models.py"
click node_session "https://github.com/lakshaykarad/truthcv/blob/main/app/db/session.py"
click node_config "https://github.com/lakshaykarad/truthcv/blob/main/app/config.py"

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,node_api,node_resume_api,node_generate_api,node_download_api,node_health_api,node_user toneBlue
class node_pdf_reader,node_resume_extractor,node_chunker,node_embedder toneAmber
class node_jd_extractor,node_retriever,node_scorer,node_generator,node_pdf_writer toneMint
class node_queries,node_models,node_session,node_database,node_config toneRose
class node_ollama,node_groq toneIndigo
```

## Components

### Web application

- [Web interface](https://github.com/lakshaykarad/truthcv/blob/main/frontend/app.js): `frontend/app.js`
- [FastAPI application](https://github.com/lakshaykarad/truthcv/blob/main/app/main.py): `app/main.py`
- [Resume endpoints](https://github.com/lakshaykarad/truthcv/blob/main/app/routers/resume.py): `app/routers/resume.py`
- [Generation endpoints](https://github.com/lakshaykarad/truthcv/blob/main/app/routers/generate.py): `app/routers/generate.py`
- [Download endpoint](https://github.com/lakshaykarad/truthcv/blob/main/app/routers/download.py): `app/routers/download.py`
- [Health endpoint](https://github.com/lakshaykarad/truthcv/blob/main/app/routers/health.py): `app/routers/health.py`

### Resume processing

- [PDF reader](https://github.com/lakshaykarad/truthcv/blob/main/app/pipeline/pdf_reader.py): `app/pipeline/pdf_reader.py`
- [Resume extractor](https://github.com/lakshaykarad/truthcv/blob/main/app/pipeline/extractor.py): `app/pipeline/extractor.py`
- [Resume chunker](https://github.com/lakshaykarad/truthcv/blob/main/app/pipeline/chunker.py): `app/pipeline/chunker.py`
- [Text embedder](https://github.com/lakshaykarad/truthcv/blob/main/app/pipeline/embedder.py): `app/pipeline/embedder.py`

### Matching and generation

- [Job description extractor](https://github.com/lakshaykarad/truthcv/blob/main/app/pipeline/extractor.py): `app/pipeline/extractor.py`
- [Evidence retriever](https://github.com/lakshaykarad/truthcv/blob/main/app/pipeline/retriever.py): `app/pipeline/retriever.py`
- [Skill scorer](https://github.com/lakshaykarad/truthcv/blob/main/app/pipeline/scorer.py): `app/pipeline/scorer.py`
- [Content generator](https://github.com/lakshaykarad/truthcv/blob/main/app/pipeline/generator.py): `app/pipeline/generator.py`
- [PDF writer](https://github.com/lakshaykarad/truthcv/blob/main/app/pipeline/pdf_writer.py): `app/pipeline/pdf_writer.py`

### Persistence

- [Database queries](https://github.com/lakshaykarad/truthcv/blob/main/app/db/queries.py): `app/db/queries.py`
- [Data models](https://github.com/lakshaykarad/truthcv/blob/main/app/db/models.py): `app/db/models.py`
- [Database session](https://github.com/lakshaykarad/truthcv/blob/main/app/db/session.py): `app/db/session.py`
- **PostgreSQL with pgvector**
- [Application settings](https://github.com/lakshaykarad/truthcv/blob/main/app/config.py): `app/config.py`

### Other components

- **User**
- **Ollama service**
- **Groq service**

## Connections

- User → Web interface: uses
- Web interface → FastAPI application: served by (evidence: `app/main.py`)
- FastAPI application → Resume endpoints: registers (evidence: `app/main.py`)
- FastAPI application → Generation endpoints: registers (evidence: `app/main.py`)
- FastAPI application → Download endpoint: registers (evidence: `app/main.py`)
- FastAPI application → Health endpoint: registers (evidence: `app/main.py`)
- Resume endpoints → PDF reader: reads PDF (evidence: `app/routers/resume.py`)
- Resume endpoints → Resume extractor: extracts facts (evidence: `app/routers/resume.py`)
- Resume endpoints → Resume chunker: chunks resume (evidence: `app/routers/resume.py`)
- Resume endpoints → Text embedder: embeds chunks (evidence: `app/routers/resume.py`)
- Resume endpoints → Database queries: saves resume (evidence: `app/routers/resume.py`)
- Generation endpoints → Job description extractor: extracts requirements (evidence: `app/routers/generate.py`)
- Generation endpoints → Content generator: generates content (evidence: `app/routers/generate.py`)
- Generation endpoints → Skill scorer: scores match (evidence: `app/routers/generate.py`)
- Generation endpoints → PDF writer: renders PDF (evidence: `app/routers/generate.py`)
- Content generator → Evidence retriever: retrieves evidence (evidence: `app/pipeline/generator.py`)
- Skill scorer → Evidence retriever: finds evidence (evidence: `app/pipeline/scorer.py`)
- Evidence retriever → Text embedder: embeds queries (evidence: `app/pipeline/retriever.py`)
- Resume extractor → Ollama service: requests extraction (evidence: `app/pipeline/extractor.py`)
- Job description extractor → Ollama service: requests extraction (evidence: `app/pipeline/extractor.py`)
- Text embedder → Ollama service: requests embeddings (evidence: `app/pipeline/embedder.py`)
- Content generator → Groq service: generates text
- Database queries → Data models: uses models (evidence: `app/db/queries.py`)
- Database queries → PostgreSQL with pgvector: reads and writes (evidence: `app/db/queries.py`)
- Database session → Application settings: loads settings (evidence: `app/db/session.py`)
- Database session → PostgreSQL with pgvector: connects (evidence: `app/db/session.py`)
- FastAPI application → Data models: creates tables (evidence: `app/main.py`)
- FastAPI application → Database session: uses engine (evidence: `app/main.py`)
- Download endpoint → Application settings: uses output settings (evidence: `app/routers/download.py`)
