# tq-ngo/job-prep-app architecture

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

- Interactive diagram: https://gitdiagram.com/tq-ngo/job-prep-app
- Repository: https://github.com/tq-ngo/job-prep-app

## Overview

JobPrep helps software engineers discover internship postings and technology news. The main workflow is curated-source crawling, posting cleanup and deduplication, optional Gemini enrichment, persistence, and delivery through searchable feeds and live SSE updates; users can also submit articles and create accounts. The graph preserves the documented frontend and worker capabilities. Some routes and worker internals were not sampled, so their connections are included only where the README or source index supports them.

Main entry points: [`backend/app/main.py`](https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/main.py) (FastAPI app), [`backend/app/tasks/job_tasks.py`](https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/tasks/job_tasks.py) (Job crawl tasks), [`backend/app/tasks/news_tasks.py`](https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/tasks/news_tasks.py) (News tasks), [`backend/app/ai/gemini_client.py`](https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/ai/gemini_client.py) (Gemini enrichment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web experience"]
  node_jobui["Job feed<br/>[JobFeed.tsx]"]
  node_newsui["News feed<br/>[NewsFeed.tsx]"]
  node_authui["Sign-in forms<br/>[LoginForm.tsx]"]
end

subgraph group_api["API and accounts"]
  node_apiapp["FastAPI app<br/>[main.py]"]
  node_authapi["Account routes<br/>[auth.py]"]
  node_jobapi["Job routes<br/>[jobs.py]"]
  node_searchapi["Semantic search<br/>[search.py]"]
  node_sseapi["Live event stream<br/>[sse.py]"]
  node_newsapi["News routes<br/>[news.py]"]
  node_taskapi["Task tracking<br/>[tasks.py]"]
end

subgraph group_jobs["Job discovery"]
  node_jobworker["Job crawl tasks<br/>[job_tasks.py]"]
  node_jobcrawl["Source crawlers<br/>[github.py]"]
  node_description["Description extraction<br/>[jd_extractor.py]"]
end

subgraph group_news["News radar"]
  node_newsworker["News tasks<br/>[news_tasks.py]"]
  node_newsparse["Article parser<br/>[news_parser.py]"]
end

subgraph group_platform["Shared services"]
  node_ai["Gemini enrichment<br/>[gemini_client.py]"]
  node_embeddings["Embedding generation<br/>[embedder.py]"]
  node_database[("PostgreSQL<br/>[database.py]")]
  node_redis[("Redis services<br/>[redis.py]")]
  node_celery["Celery runtime<br/>[celery_app.py]"]
end

node_browser(("Browser user"))
node_sources["Job sources"]
node_articleweb["News websites"]
node_google["Google services"]

node_browser -->|"views jobs"| node_jobui
node_browser -->|"views news"| node_newsui
node_browser -->|"signs in"| node_authui
node_jobui -.->|"requests listings"| node_jobapi
node_jobui -.->|"receives updates"| node_sseapi
node_newsui -.->|"requests articles"| node_newsapi
node_authui -.->|"submits credentials"| node_authapi
node_apiapp -->|"routes to"| node_authapi
node_apiapp -->|"routes to"| node_jobapi
node_apiapp -->|"routes to"| node_searchapi
node_apiapp -->|"routes to"| node_sseapi
node_apiapp -->|"routes to"| node_newsapi
node_apiapp -->|"routes to"| node_taskapi
node_jobapi -.->|"queries jobs"| node_database
node_searchapi -->|"creates query vectors"| node_embeddings
node_searchapi -->|"embeds queries"| node_ai
node_searchapi -->|"searches listings"| node_database
node_authapi -->|"reads users"| node_database
node_authapi -.->|"uses OAuth"| node_google
node_jobworker -->|"runs crawlers"| node_jobcrawl
node_jobworker -->|"fetches descriptions"| node_description
node_jobworker -->|"enriches listings"| node_ai
node_jobworker -->|"updates listings"| node_database
node_jobworker -.->|"publishes updates"| node_redis
node_sources -.->|"provides postings"| node_jobcrawl
node_jobcrawl -.->|"fetches postings"| node_sources
node_newsworker -->|"parses articles"| node_newsparse
node_newsworker -->|"summarizes articles"| node_ai
node_newsworker -.->|"stores articles"| node_database
node_newsworker -.->|"scrapes headlines"| node_articleweb
node_newsparse -->|"generates summaries"| node_ai
node_articleweb -.->|"provides content"| node_newsparse
node_ai -->|"calls Gemini"| node_google
node_jobworker -.->|"registers tasks"| node_celery
node_newsworker -.->|"registers tasks"| node_celery
node_sseapi -.->|"streams events"| node_redis
node_taskapi -->|"reads task state"| node_celery

click node_jobui "https://github.com/tq-ngo/job-prep-app/blob/main/frontend/src/app/(app)/jobs/JobFeed.tsx"
click node_newsui "https://github.com/tq-ngo/job-prep-app/blob/main/frontend/src/app/(app)/news/NewsFeed.tsx"
click node_authui "https://github.com/tq-ngo/job-prep-app/blob/main/frontend/src/app/(auth)/login/LoginForm.tsx"
click node_apiapp "https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/main.py"
click node_authapi "https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/api/v1/auth.py"
click node_jobapi "https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/api/v1/jobs.py"
click node_searchapi "https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/api/v1/search.py"
click node_sseapi "https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/api/v1/sse.py"
click node_newsapi "https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/api/v1/news.py"
click node_taskapi "https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/api/v1/tasks.py"
click node_jobworker "https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/tasks/job_tasks.py"
click node_jobcrawl "https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/scraping/parsers/github.py"
click node_description "https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/scraping/jd_extractor.py"
click node_newsworker "https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/tasks/news_tasks.py"
click node_newsparse "https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/scraping/news_parser.py"
click node_ai "https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/ai/gemini_client.py"
click node_embeddings "https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/ai/embedder.py"
click node_database "https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/core/database.py"
click node_redis "https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/core/redis.py"
click node_celery "https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/tasks/celery_app.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_jobui,node_newsui,node_authui,node_browser toneBlue
class node_apiapp,node_authapi,node_jobapi,node_searchapi,node_sseapi,node_newsapi,node_taskapi toneAmber
class node_jobworker,node_jobcrawl,node_description toneMint
class node_newsworker,node_newsparse toneRose
class node_ai,node_embeddings,node_database,node_redis,node_celery,node_sources,node_articleweb,node_google toneIndigo
```

## Components

### Web experience

- [Job feed](https://github.com/tq-ngo/job-prep-app/blob/main/frontend/src/app/(app)/jobs/JobFeed.tsx): `frontend/src/app/(app)/jobs/JobFeed.tsx`
- [News feed](https://github.com/tq-ngo/job-prep-app/blob/main/frontend/src/app/(app)/news/NewsFeed.tsx): `frontend/src/app/(app)/news/NewsFeed.tsx`
- [Sign-in forms](https://github.com/tq-ngo/job-prep-app/blob/main/frontend/src/app/(auth)/login/LoginForm.tsx): `frontend/src/app/(auth)/login/LoginForm.tsx`

### API and accounts

- [FastAPI app](https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/main.py): `backend/app/main.py`
- [Account routes](https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/api/v1/auth.py): `backend/app/api/v1/auth.py`
- [Job routes](https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/api/v1/jobs.py): `backend/app/api/v1/jobs.py`
- [Semantic search](https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/api/v1/search.py): `backend/app/api/v1/search.py`
- [Live event stream](https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/api/v1/sse.py): `backend/app/api/v1/sse.py`
- [News routes](https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/api/v1/news.py): `backend/app/api/v1/news.py`
- [Task tracking](https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/api/v1/tasks.py): `backend/app/api/v1/tasks.py`

### Job discovery

- [Job crawl tasks](https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/tasks/job_tasks.py): `backend/app/tasks/job_tasks.py`
- [Source crawlers](https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/scraping/parsers/github.py): `backend/app/scraping/parsers/github.py`
- [Description extraction](https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/scraping/jd_extractor.py): `backend/app/scraping/jd_extractor.py`

### News radar

- [News tasks](https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/tasks/news_tasks.py): `backend/app/tasks/news_tasks.py`
- [Article parser](https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/scraping/news_parser.py): `backend/app/scraping/news_parser.py`

### Shared services

- [Gemini enrichment](https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/ai/gemini_client.py): `backend/app/ai/gemini_client.py`
- [Embedding generation](https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/ai/embedder.py): `backend/app/ai/embedder.py`
- [PostgreSQL](https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/core/database.py): `backend/app/core/database.py`
- [Redis services](https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/core/redis.py): `backend/app/core/redis.py`
- [Celery runtime](https://github.com/tq-ngo/job-prep-app/blob/main/backend/app/tasks/celery_app.py): `backend/app/tasks/celery_app.py`

### Other components

- **Browser user**
- **Job sources**
- **News websites**
- **Google services**

## Connections

- Browser user → Job feed: views jobs
- Browser user → News feed: views news
- Browser user → Sign-in forms: signs in
- Job feed → Job routes: requests listings
- Job feed → Live event stream: receives updates
- News feed → News routes: requests articles
- Sign-in forms → Account routes: submits credentials
- FastAPI app → Account routes: routes to (evidence: `backend/app/main.py`)
- FastAPI app → Job routes: routes to (evidence: `backend/app/main.py`)
- FastAPI app → Semantic search: routes to (evidence: `backend/app/main.py`)
- FastAPI app → Live event stream: routes to (evidence: `backend/app/main.py`)
- FastAPI app → News routes: routes to (evidence: `backend/app/main.py`)
- FastAPI app → Task tracking: routes to (evidence: `backend/app/main.py`)
- Job routes → PostgreSQL: queries jobs
- Semantic search → Embedding generation: creates query vectors (evidence: `backend/app/api/v1/search.py`)
- Semantic search → Gemini enrichment: embeds queries (evidence: `backend/app/api/v1/search.py`)
- Semantic search → PostgreSQL: searches listings (evidence: `backend/app/api/v1/search.py`)
- Account routes → PostgreSQL: reads users (evidence: `backend/app/api/v1/auth.py`)
- Account routes → Google services: uses OAuth
- Job crawl tasks → Source crawlers: runs crawlers (evidence: `backend/app/tasks/job_tasks.py`)
- Job crawl tasks → Description extraction: fetches descriptions (evidence: `backend/app/tasks/job_tasks.py`)
- Job crawl tasks → Gemini enrichment: enriches listings (evidence: `backend/app/tasks/job_tasks.py`)
- Job crawl tasks → PostgreSQL: updates listings (evidence: `backend/app/tasks/job_tasks.py`)
- Job crawl tasks → Redis services: publishes updates (evidence: `backend/app/tasks/job_tasks.py`)
- Job sources → Source crawlers: provides postings
- Source crawlers → Job sources: fetches postings
- News tasks → Article parser: parses articles (evidence: `backend/app/tasks/news_tasks.py`)
- News tasks → Gemini enrichment: summarizes articles (evidence: `backend/app/tasks/news_tasks.py`)
- News tasks → PostgreSQL: stores articles (evidence: `backend/app/tasks/news_tasks.py`)
- News tasks → News websites: scrapes headlines
- Article parser → Gemini enrichment: generates summaries (evidence: `backend/app/scraping/news_parser.py`)
- News websites → Article parser: provides content
- Gemini enrichment → Google services: calls Gemini
- Job crawl tasks → Celery runtime: registers tasks (evidence: `backend/app/tasks/celery_app.py`)
- News tasks → Celery runtime: registers tasks (evidence: `backend/app/tasks/celery_app.py`)
- Live event stream → Redis services: streams events
- Task tracking → Celery runtime: reads task state (evidence: `backend/app/api/v1/tasks.py`)
