# sai121663/job-tracker architecture

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

- Interactive diagram: https://gitdiagram.com/sai121663/job-tracker
- Repository: https://github.com/sai121663/job-tracker

## Overview

Job Application Tracker reads a user’s Gmail, finds likely job-related messages, classifies and stores them, then presents them in an editable kanban-style board. The sync API orchestrates fetching, filtering, optional AI-assisted classification, and persistence; users can correct fields, star cards, and dismiss unstarred items. Gmail authorization is a distinct setup path. The README also documents scheduled sync and deployment, but those are external operating arrangements rather than core runtime components. Source excerpts support the principal calls; unsampled frontend details are represented only where documented.

Main entry points: [`backend/app.py`](https://github.com/sai121663/job-tracker/blob/main/backend/app.py) (Sync and REST API), [`backend/llm.py`](https://github.com/sai121663/job-tracker/blob/main/backend/llm.py) (AI summary option), [`backend/authorize.py`](https://github.com/sai121663/job-tracker/blob/main/backend/authorize.py) (Gmail authorization), [`backend/gmail_client.py`](https://github.com/sai121663/job-tracker/blob/main/backend/gmail_client.py) (Message fetching)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mail["Gmail intake"]
  node_authorize["Gmail authorization<br/>[authorize.py]"]
  node_fetch["Message fetching<br/>[gmail_client.py]"]
end

subgraph group_processing["Classification"]
  node_filter["Job relevance filter<br/>[classifier.py]"]
  node_classify["Status classification<br/>[classifier.py]"]
  node_summarize["AI summary option<br/>[llm.py]"]
end

subgraph group_backend["API and storage"]
  node_api["Sync and REST API<br/>[app.py]"]
  node_store[("Application database<br/>[db.py]")]
end

subgraph group_frontend["Board interface"]
  node_app["Board UI<br/>[App.jsx]"]
end

node_user(("Inbox owner"))
node_gmail["Gmail API"]
node_postgres[("Postgres")]
node_browser(("Browser user"))
node_groq["Groq API"]
node_scheduler["Scheduled sync trigger"]

node_user -->|"authorizes Gmail"| node_authorize
node_authorize -->|"obtains access"| node_gmail
node_api -->|"fetches messages"| node_fetch
node_fetch -->|"searches and reads"| node_gmail
node_api -->|"filters candidates"| node_filter
node_api -->|"classifies messages"| node_classify
node_api -->|"requests classification"| node_summarize
node_summarize -->|"falls back to"| node_classify
node_summarize -->|"requests summary"| node_groq
node_api -->|"reads and writes"| node_store
node_store -->|"persists records"| node_postgres
node_browser -->|"views and edits"| node_app
node_app -->|"calls REST endpoints"| node_api
node_scheduler -->|"triggers sync"| node_api

click node_authorize "https://github.com/sai121663/job-tracker/blob/main/backend/authorize.py"
click node_fetch "https://github.com/sai121663/job-tracker/blob/main/backend/gmail_client.py"
click node_api "https://github.com/sai121663/job-tracker/blob/main/backend/app.py"
click node_filter "https://github.com/sai121663/job-tracker/blob/main/backend/classifier.py"
click node_classify "https://github.com/sai121663/job-tracker/blob/main/backend/classifier.py"
click node_summarize "https://github.com/sai121663/job-tracker/blob/main/backend/llm.py"
click node_store "https://github.com/sai121663/job-tracker/blob/main/backend/db.py"
click node_app "https://github.com/sai121663/job-tracker/blob/main/frontend/src/App.jsx"

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_authorize,node_fetch,node_browser toneBlue
class node_filter,node_classify,node_summarize,node_postgres toneAmber
class node_api,node_store,node_gmail,node_groq toneMint
class node_app toneRose
class node_user,node_scheduler toneIndigo
```

## Components

### Gmail intake

- [Gmail authorization](https://github.com/sai121663/job-tracker/blob/main/backend/authorize.py): `backend/authorize.py`
- [Message fetching](https://github.com/sai121663/job-tracker/blob/main/backend/gmail_client.py): `backend/gmail_client.py`

### Classification

- [Job relevance filter](https://github.com/sai121663/job-tracker/blob/main/backend/classifier.py): `backend/classifier.py`
- [Status classification](https://github.com/sai121663/job-tracker/blob/main/backend/classifier.py): `backend/classifier.py`
- [AI summary option](https://github.com/sai121663/job-tracker/blob/main/backend/llm.py): `backend/llm.py`

### API and storage

- [Sync and REST API](https://github.com/sai121663/job-tracker/blob/main/backend/app.py): `backend/app.py`
- [Application database](https://github.com/sai121663/job-tracker/blob/main/backend/db.py): `backend/db.py`

### Board interface

- [Board UI](https://github.com/sai121663/job-tracker/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`

### Other components

- **Inbox owner**
- **Gmail API**
- **Postgres**
- **Browser user**
- **Groq API**
- **Scheduled sync trigger**

## Connections

- Inbox owner → Gmail authorization: authorizes Gmail (evidence: `README.md`)
- Gmail authorization → Gmail API: obtains access (evidence: `backend/authorize.py`)
- Sync and REST API → Message fetching: fetches messages (evidence: `backend/app.py`)
- Message fetching → Gmail API: searches and reads (evidence: `backend/gmail_client.py`)
- Sync and REST API → Job relevance filter: filters candidates (evidence: `backend/app.py`)
- Sync and REST API → Status classification: classifies messages (evidence: `backend/app.py`)
- Sync and REST API → AI summary option: requests classification (evidence: `backend/app.py`)
- AI summary option → Status classification: falls back to (evidence: `backend/llm.py`)
- AI summary option → Groq API: requests summary (evidence: `backend/llm.py`)
- Sync and REST API → Application database: reads and writes (evidence: `backend/app.py`)
- Application database → Postgres: persists records (evidence: `backend/db.py`)
- Browser user → Board UI: views and edits (evidence: `README.md`)
- Board UI → Sync and REST API: calls REST endpoints (evidence: `frontend/src/App.jsx`)
- Scheduled sync trigger → Sync and REST API: triggers sync (evidence: `README.md`)
