# raghavg189/flyrank-ai architecture

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

- Interactive diagram: https://gitdiagram.com/raghavg189/flyrank-ai
- Repository: https://github.com/raghavg189/flyrank-ai

## Overview

FlyRank-AI is a collection of internship projects, not one integrated product: an API for authentication, task management, and job classification; an asynchronous report service; and a standalone site-scraper project. The shown workflows run from API endpoints through their service or LLM logic to repositories or external providers, and from report submission through Inngest dispatch. The site scraper is present in the tree, but its behavior and connections are not evidenced by the provided excerpts.

Main entry points: [`api_endpoint_assignment/src/llm/client.py`](https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/llm/client.py) (LLM client), [`api_endpoint_assignment/src/main.py`](https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/main.py) (API application), [`api_endpoint_assignment/src/routes/auth_routes.py`](https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/routes/auth_routes.py) (Auth endpoints), [`background_job/src/routes/routes.py`](https://github.com/raghavg189/flyrank-ai/blob/main/background_job/src/routes/routes.py) (Report endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Assignment API"]
  node_api_app["API application<br/>[main.py]"]
  node_auth_routes["Auth endpoints<br/>[auth_routes.py]"]
  node_auth_service["Auth validation<br/>[auth_services.py]"]
  node_auth_repo["Auth repository"]
  node_supabase["Supabase Auth"]
  node_verification["Token verification<br/>[verification.py]"]
  node_tasks_routes["Task endpoints<br/>[tasks_routes.py]"]
  node_tasks_service["Task services<br/>[tasks_services.py]"]
  node_tasks_repo["Task repository"]
  node_tasks_db[("Tasks database")]
  node_llm_routes["Classification endpoint<br/>[llm_routes.py]"]
  node_llm_client["LLM client<br/>[client.py]"]
  node_llm_provider["LLM provider"]
  node_prompt["Classification prompt<br/>[your-job-v1.md]"]
  node_output_schema["Output schema<br/>[schema.py]"]
  node_parse_repair["Parse and repair<br/>[parse_repair.py]"]
  node_error_handler["Error handlers<br/>[error_handler.py]"]
end

subgraph group_reports["Background Reports"]
  node_report_app["Report application<br/>[main.py]"]
  node_report_routes["Report endpoints<br/>[routes.py]"]
  node_report_store[("Report store<br/>[report_store.py]")]
  node_inngest_client["Inngest client<br/>[inngest_client.py]"]
  node_inngest_service["Inngest"]
  node_report_functions["Report functions"]
end

subgraph group_scraping["Site Scraper"]
  node_scraper["Site scraper<br/>[main.py]"]
end

node_api_user(("API caller"))
node_report_user(("Report caller"))

node_api_user -->|"calls auth"| node_auth_routes
node_api_user -.->|"requests tasks"| node_tasks_routes
node_api_user -->|"submits description"| node_llm_routes
node_api_app -->|"registers"| node_auth_routes
node_api_app -->|"registers"| node_tasks_routes
node_api_app -->|"registers"| node_llm_routes
node_api_app -->|"registers handlers"| node_error_handler
node_auth_routes -->|"delegates to"| node_auth_service
node_auth_routes -->|"checks tokens"| node_verification
node_auth_service -->|"calls"| node_auth_repo
node_verification -->|"verifies token"| node_auth_repo
node_auth_repo -->|"uses auth"| node_supabase
node_tasks_routes -->|"delegates to"| node_tasks_service
node_tasks_service -->|"calls"| node_tasks_repo
node_tasks_repo -->|"reads and writes"| node_tasks_db
node_llm_routes -->|"calls"| node_llm_client
node_llm_client -->|"requests completion"| node_llm_provider
node_llm_client -->|"loads prompt"| node_prompt
node_llm_client -->|"parses output"| node_parse_repair
node_llm_client -->|"validates output"| node_output_schema
node_report_user -->|"requests report"| node_report_routes
node_report_app -->|"registers"| node_report_routes
node_report_app -->|"serves functions"| node_report_functions
node_report_routes -->|"gets and updates"| node_report_store
node_report_routes -->|"sends event"| node_inngest_client
node_inngest_client -->|"configures client"| node_inngest_service
node_report_functions -->|"uses client"| node_inngest_client
node_report_functions -->|"uses store"| node_report_store

click node_api_app "https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/main.py"
click node_auth_routes "https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/routes/auth_routes.py"
click node_auth_service "https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/services/auth_services.py"
click node_auth_repo "https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/repositories/auth_respository.py"
click node_verification "https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/middleware/verification.py"
click node_tasks_routes "https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/routes/tasks_routes.py"
click node_tasks_service "https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/services/tasks_services.py"
click node_tasks_repo "https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/repositories/tasks_repository.py"
click node_tasks_db "https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/repositories/tasks_repository.py"
click node_llm_routes "https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/routes/llm_routes.py"
click node_llm_client "https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/llm/client.py"
click node_prompt "https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/prompts/your-job-v1.md"
click node_output_schema "https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/llm/schema.py"
click node_parse_repair "https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/llm/parse_repair.py"
click node_error_handler "https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/middleware/error_handler.py"
click node_report_app "https://github.com/raghavg189/flyrank-ai/blob/main/background_job/src/main.py"
click node_report_routes "https://github.com/raghavg189/flyrank-ai/blob/main/background_job/src/routes/routes.py"
click node_report_store "https://github.com/raghavg189/flyrank-ai/blob/main/background_job/src/core/report_store.py"
click node_inngest_client "https://github.com/raghavg189/flyrank-ai/blob/main/background_job/src/core/inngest_client.py"
click node_report_functions "https://github.com/raghavg189/flyrank-ai/blob/main/background_job/src/functions/inngest_functions.py"
click node_scraper "https://github.com/raghavg189/flyrank-ai/blob/main/site_scraper/src/main.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_api_app,node_auth_routes,node_auth_service,node_auth_repo,node_supabase,node_verification,node_tasks_routes,node_tasks_service,node_tasks_repo,node_tasks_db,node_llm_routes,node_llm_client,node_llm_provider,node_prompt,node_output_schema,node_parse_repair,node_error_handler toneBlue
class node_report_app,node_report_routes,node_report_store,node_inngest_client,node_inngest_service,node_report_functions toneAmber
class node_scraper,node_api_user toneMint
class node_report_user toneIndigo
```

## Components

### Assignment API

- [API application](https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/main.py): `api_endpoint_assignment/src/main.py`
- [Auth endpoints](https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/routes/auth_routes.py): `api_endpoint_assignment/src/routes/auth_routes.py`
- [Auth validation](https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/services/auth_services.py): `api_endpoint_assignment/src/services/auth_services.py`
- [Auth repository](https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/repositories/auth_respository.py): `api_endpoint_assignment/src/repositories/auth_respository.py`
- **Supabase Auth**
- [Token verification](https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/middleware/verification.py): `api_endpoint_assignment/src/middleware/verification.py`
- [Task endpoints](https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/routes/tasks_routes.py): `api_endpoint_assignment/src/routes/tasks_routes.py`
- [Task services](https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/services/tasks_services.py): `api_endpoint_assignment/src/services/tasks_services.py`
- [Task repository](https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/repositories/tasks_repository.py): `api_endpoint_assignment/src/repositories/tasks_repository.py`
- [Tasks database](https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/repositories/tasks_repository.py): `api_endpoint_assignment/src/repositories/tasks_repository.py`
- [Classification endpoint](https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/routes/llm_routes.py): `api_endpoint_assignment/src/routes/llm_routes.py`
- [LLM client](https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/llm/client.py): `api_endpoint_assignment/src/llm/client.py`
- **LLM provider**
- [Classification prompt](https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/prompts/your-job-v1.md): `api_endpoint_assignment/prompts/your-job-v1.md`
- [Output schema](https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/llm/schema.py): `api_endpoint_assignment/src/llm/schema.py`
- [Parse and repair](https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/llm/parse_repair.py): `api_endpoint_assignment/src/llm/parse_repair.py`
- [Error handlers](https://github.com/raghavg189/flyrank-ai/blob/main/api_endpoint_assignment/src/middleware/error_handler.py): `api_endpoint_assignment/src/middleware/error_handler.py`

### Background Reports

- [Report application](https://github.com/raghavg189/flyrank-ai/blob/main/background_job/src/main.py): `background_job/src/main.py`
- [Report endpoints](https://github.com/raghavg189/flyrank-ai/blob/main/background_job/src/routes/routes.py): `background_job/src/routes/routes.py`
- [Report store](https://github.com/raghavg189/flyrank-ai/blob/main/background_job/src/core/report_store.py): `background_job/src/core/report_store.py`
- [Inngest client](https://github.com/raghavg189/flyrank-ai/blob/main/background_job/src/core/inngest_client.py): `background_job/src/core/inngest_client.py`
- **Inngest**
- [Report functions](https://github.com/raghavg189/flyrank-ai/blob/main/background_job/src/functions/inngest_functions.py): `background_job/src/functions/inngest_functions.py`

### Site Scraper

- [Site scraper](https://github.com/raghavg189/flyrank-ai/blob/main/site_scraper/src/main.py): `site_scraper/src/main.py`

### Other components

- **API caller**
- **Report caller**

## Connections

- API caller → Auth endpoints: calls auth (evidence: `api_endpoint_assignment/src/routes/auth_routes.py`)
- API caller → Task endpoints: requests tasks
- API caller → Classification endpoint: submits description (evidence: `api_endpoint_assignment/src/routes/llm_routes.py`)
- API application → Auth endpoints: registers (evidence: `api_endpoint_assignment/src/main.py`)
- API application → Task endpoints: registers (evidence: `api_endpoint_assignment/src/main.py`)
- API application → Classification endpoint: registers (evidence: `api_endpoint_assignment/src/main.py`)
- API application → Error handlers: registers handlers (evidence: `api_endpoint_assignment/src/main.py`)
- Auth endpoints → Auth validation: delegates to (evidence: `api_endpoint_assignment/src/routes/auth_routes.py`)
- Auth endpoints → Token verification: checks tokens (evidence: `api_endpoint_assignment/src/routes/auth_routes.py`)
- Auth validation → Auth repository: calls (evidence: `api_endpoint_assignment/src/services/auth_services.py`)
- Token verification → Auth repository: verifies token (evidence: `api_endpoint_assignment/src/middleware/verification.py`)
- Auth repository → Supabase Auth: uses auth (evidence: `api_endpoint_assignment/src/repositories/auth_respository.py`)
- Task endpoints → Task services: delegates to (evidence: `api_endpoint_assignment/src/routes/tasks_routes.py`)
- Task services → Task repository: calls (evidence: `api_endpoint_assignment/src/services/tasks_services.py`)
- Task repository → Tasks database: reads and writes (evidence: `api_endpoint_assignment/src/repositories/tasks_repository.py`)
- Classification endpoint → LLM client: calls (evidence: `api_endpoint_assignment/src/routes/llm_routes.py`)
- LLM client → LLM provider: requests completion (evidence: `api_endpoint_assignment/src/llm/client.py`)
- LLM client → Classification prompt: loads prompt (evidence: `api_endpoint_assignment/src/llm/client.py`)
- LLM client → Parse and repair: parses output (evidence: `api_endpoint_assignment/src/llm/client.py`)
- LLM client → Output schema: validates output (evidence: `api_endpoint_assignment/src/llm/client.py`)
- Report caller → Report endpoints: requests report (evidence: `background_job/src/routes/routes.py`)
- Report application → Report endpoints: registers (evidence: `background_job/src/main.py`)
- Report application → Report functions: serves functions (evidence: `background_job/src/main.py`)
- Report endpoints → Report store: gets and updates (evidence: `background_job/src/routes/routes.py`)
- Report endpoints → Inngest client: sends event (evidence: `background_job/src/routes/routes.py`)
- Inngest client → Inngest: configures client (evidence: `background_job/src/core/inngest_client.py`)
- Report functions → Inngest client: uses client (evidence: `background_job/src/functions/inngest_functions.py`)
- Report functions → Report store: uses store (evidence: `background_job/src/functions/inngest_functions.py`)
