# haddjs/verity architecture

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

- Interactive diagram: https://gitdiagram.com/haddjs/verity
- Repository: https://github.com/haddjs/verity

## Overview

Work Tracker lets a person track job applications and manage CVs, either with Google-backed sync after sign-in or browser-local guest storage. The main workflow is to enter and update applications, review their status, and upload, preview, download, or delete CVs. The README documents Sheets for applications and Drive for CV files; sampled API routes show authentication and dispatch to Google data modules. The main tracker wiring and Google storage implementations were not sampled, so those internal links are limited to documented relationships.

Main entry points: [`src/components/tracker/TrackerApp.tsx`](https://github.com/haddjs/verity/blob/main/src/components/tracker/TrackerApp.tsx) (Tracker app), [`src/lib/api/client.ts`](https://github.com/haddjs/verity/blob/main/src/lib/api/client.ts) (API client), [`src/auth.ts`](https://github.com/haddjs/verity/blob/main/src/auth.ts) (Auth.js), [`src/lib/google/jobs.ts`](https://github.com/haddjs/verity/blob/main/src/lib/google/jobs.ts) (Job data access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Tracker UI"]
  node_home["Tracker home<br/>[page.tsx]"]
  node_tracker["Tracker app<br/>[TrackerApp.tsx]"]
  node_jobform["Job form<br/>[JobForm.tsx]"]
  node_joblist["Job list<br/>[JobList.tsx]"]
  node_stats["Job stats<br/>[StatsBar.tsx]"]
  node_cvmanager["CV manager<br/>[CvManager.tsx]"]
  node_cvpreview["CV preview<br/>[CvPreview.tsx]"]
end

subgraph group_api["Application API"]
  node_jobapi["Job routes<br/>[route.ts]"]
  node_jobitemapi["Job item routes<br/>[route.ts]"]
  node_cvapi["CV routes<br/>[route.ts]"]
  node_cvitemapi["CV item routes<br/>[route.ts]"]
  node_apiclient["API client<br/>[client.ts]"]
end

subgraph group_data["Storage and Google"]
  node_localstore[("Browser storage<br/>[storage.ts]")]
  node_jobdata["Job data access<br/>[jobs.ts]"]
  node_cvdata["CV data access<br/>[cvs.ts]"]
  node_workspace["Workspace setup<br/>[workspace.ts]"]
  node_googleclient["Google clients<br/>[client.ts]"]
  node_sheets[("Google Sheets")]
  node_drive[("Google Drive")]
end

subgraph group_identity["Authentication"]
  node_auth["Auth.js<br/>[auth.ts]"]
  node_authroute["Auth routes<br/>[route.ts]"]
  node_session["Token access<br/>[session.ts]"]
end

node_person(("Person"))
node_oauth["Google OAuth"]

node_person -->|"opens"| node_home
node_home -->|"renders"| node_tracker
node_jobform -->|"submits to"| node_tracker
node_joblist -->|"displays"| node_tracker
node_stats -->|"summarizes"| node_tracker
node_cvmanager -->|"manages"| node_tracker
node_tracker -->|"requests data"| node_apiclient
node_tracker -->|"guest reads/writes"| node_localstore
node_cvpreview -->|"fetches CVs"| node_apiclient
node_cvpreview -->|"reads guest CVs"| node_localstore
node_apiclient -->|"calls"| node_jobapi
node_apiclient -->|"calls"| node_jobitemapi
node_apiclient -->|"calls"| node_cvapi
node_apiclient -->|"calls"| node_cvitemapi
node_jobapi -->|"checks session"| node_auth
node_jobitemapi -->|"checks session"| node_auth
node_cvapi -->|"checks session"| node_auth
node_cvitemapi -->|"checks session"| node_auth
node_jobapi -->|"lists/creates"| node_jobdata
node_jobitemapi -->|"updates/deletes"| node_jobdata
node_cvapi -->|"lists/uploads"| node_cvdata
node_cvitemapi -->|"downloads/deletes"| node_cvdata
node_jobdata -->|"gets Sheets client"| node_googleclient
node_cvdata -->|"gets Drive client"| node_googleclient
node_workspace -->|"uses Google clients"| node_googleclient
node_jobdata -->|"stores applications"| node_sheets
node_cvdata -->|"stores CV files"| node_drive
node_workspace -->|"creates workspace"| node_sheets
node_workspace -->|"creates folders"| node_drive
node_googleclient -->|"requires access token"| node_session
node_authroute -->|"dispatches"| node_auth
node_auth -->|"signs in / refreshes"| node_oauth

click node_home "https://github.com/haddjs/verity/blob/main/src/app/page.tsx"
click node_tracker "https://github.com/haddjs/verity/blob/main/src/components/tracker/TrackerApp.tsx"
click node_jobform "https://github.com/haddjs/verity/blob/main/src/components/jobs/JobForm.tsx"
click node_joblist "https://github.com/haddjs/verity/blob/main/src/components/jobs/JobList.tsx"
click node_stats "https://github.com/haddjs/verity/blob/main/src/components/jobs/StatsBar.tsx"
click node_cvmanager "https://github.com/haddjs/verity/blob/main/src/components/cvs/CvManager.tsx"
click node_cvpreview "https://github.com/haddjs/verity/blob/main/src/components/cvs/CvPreview.tsx"
click node_jobapi "https://github.com/haddjs/verity/blob/main/src/app/api/jobs/route.ts"
click node_jobitemapi "https://github.com/haddjs/verity/blob/main/src/app/api/jobs/%5Bid%5D/route.ts"
click node_cvapi "https://github.com/haddjs/verity/blob/main/src/app/api/cvs/route.ts"
click node_cvitemapi "https://github.com/haddjs/verity/blob/main/src/app/api/cvs/%5Bid%5D/route.ts"
click node_apiclient "https://github.com/haddjs/verity/blob/main/src/lib/api/client.ts"
click node_localstore "https://github.com/haddjs/verity/blob/main/src/lib/storage.ts"
click node_jobdata "https://github.com/haddjs/verity/blob/main/src/lib/google/jobs.ts"
click node_cvdata "https://github.com/haddjs/verity/blob/main/src/lib/google/cvs.ts"
click node_workspace "https://github.com/haddjs/verity/blob/main/src/lib/google/workspace.ts"
click node_googleclient "https://github.com/haddjs/verity/blob/main/src/lib/google/client.ts"
click node_auth "https://github.com/haddjs/verity/blob/main/src/auth.ts"
click node_authroute "https://github.com/haddjs/verity/blob/main/src/app/api/auth/%5B...nextauth%5D/route.ts"
click node_session "https://github.com/haddjs/verity/blob/main/src/lib/auth/session.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_home,node_tracker,node_jobform,node_joblist,node_stats,node_cvmanager,node_cvpreview toneBlue
class node_jobapi,node_jobitemapi,node_cvapi,node_cvitemapi,node_apiclient toneAmber
class node_localstore,node_jobdata,node_cvdata,node_workspace,node_googleclient,node_sheets,node_drive toneMint
class node_auth,node_authroute,node_session toneRose
class node_person,node_oauth toneIndigo
```

## Components

### Tracker UI

- [Tracker home](https://github.com/haddjs/verity/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Tracker app](https://github.com/haddjs/verity/blob/main/src/components/tracker/TrackerApp.tsx): `src/components/tracker/TrackerApp.tsx`
- [Job form](https://github.com/haddjs/verity/blob/main/src/components/jobs/JobForm.tsx): `src/components/jobs/JobForm.tsx`
- [Job list](https://github.com/haddjs/verity/blob/main/src/components/jobs/JobList.tsx): `src/components/jobs/JobList.tsx`
- [Job stats](https://github.com/haddjs/verity/blob/main/src/components/jobs/StatsBar.tsx): `src/components/jobs/StatsBar.tsx`
- [CV manager](https://github.com/haddjs/verity/blob/main/src/components/cvs/CvManager.tsx): `src/components/cvs/CvManager.tsx`
- [CV preview](https://github.com/haddjs/verity/blob/main/src/components/cvs/CvPreview.tsx): `src/components/cvs/CvPreview.tsx`

### Application API

- [Job routes](https://github.com/haddjs/verity/blob/main/src/app/api/jobs/route.ts): `src/app/api/jobs/route.ts`
- [Job item routes](https://github.com/haddjs/verity/blob/main/src/app/api/jobs/%5Bid%5D/route.ts): `src/app/api/jobs/[id]/route.ts`
- [CV routes](https://github.com/haddjs/verity/blob/main/src/app/api/cvs/route.ts): `src/app/api/cvs/route.ts`
- [CV item routes](https://github.com/haddjs/verity/blob/main/src/app/api/cvs/%5Bid%5D/route.ts): `src/app/api/cvs/[id]/route.ts`
- [API client](https://github.com/haddjs/verity/blob/main/src/lib/api/client.ts): `src/lib/api/client.ts`

### Storage and Google

- [Browser storage](https://github.com/haddjs/verity/blob/main/src/lib/storage.ts): `src/lib/storage.ts`
- [Job data access](https://github.com/haddjs/verity/blob/main/src/lib/google/jobs.ts): `src/lib/google/jobs.ts`
- [CV data access](https://github.com/haddjs/verity/blob/main/src/lib/google/cvs.ts): `src/lib/google/cvs.ts`
- [Workspace setup](https://github.com/haddjs/verity/blob/main/src/lib/google/workspace.ts): `src/lib/google/workspace.ts`
- [Google clients](https://github.com/haddjs/verity/blob/main/src/lib/google/client.ts): `src/lib/google/client.ts`
- **Google Sheets**
- **Google Drive**

### Authentication

- [Auth.js](https://github.com/haddjs/verity/blob/main/src/auth.ts): `src/auth.ts`
- [Auth routes](https://github.com/haddjs/verity/blob/main/src/app/api/auth/%5B...nextauth%5D/route.ts): `src/app/api/auth/[...nextauth]/route.ts`
- [Token access](https://github.com/haddjs/verity/blob/main/src/lib/auth/session.ts): `src/lib/auth/session.ts`

### Other components

- **Person**
- **Google OAuth**

## Connections

- Person → Tracker home: opens
- Tracker home → Tracker app: renders
- Job form → Tracker app: submits to
- Job list → Tracker app: displays
- Job stats → Tracker app: summarizes
- CV manager → Tracker app: manages
- Tracker app → API client: requests data
- Tracker app → Browser storage: guest reads/writes
- CV preview → API client: fetches CVs
- CV preview → Browser storage: reads guest CVs
- API client → Job routes: calls
- API client → Job item routes: calls
- API client → CV routes: calls
- API client → CV item routes: calls
- Job routes → Auth.js: checks session
- Job item routes → Auth.js: checks session
- CV routes → Auth.js: checks session
- CV item routes → Auth.js: checks session
- Job routes → Job data access: lists/creates
- Job item routes → Job data access: updates/deletes
- CV routes → CV data access: lists/uploads
- CV item routes → CV data access: downloads/deletes
- Job data access → Google clients: gets Sheets client
- CV data access → Google clients: gets Drive client
- Workspace setup → Google clients: uses Google clients
- Job data access → Google Sheets: stores applications
- CV data access → Google Drive: stores CV files
- Workspace setup → Google Sheets: creates workspace
- Workspace setup → Google Drive: creates folders
- Google clients → Token access: requires access token
- Auth routes → Auth.js: dispatches
- Auth.js → Google OAuth: signs in / refreshes
