# kanukuntla-r/rotto-backend-task-ruthvik architecture

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

- Interactive diagram: https://gitdiagram.com/kanukuntla-r/rotto-backend-task-ruthvik
- Repository: https://github.com/kanukuntla-r/rotto-backend-task-ruthvik

## Overview

Rotto is a Python/PostgreSQL job crawler for Reed and LinkedIn, with an Indeed public-access diagnostic rather than Indeed ingestion. The main workflow discovers listings, selects new or refresh-due details, parses and validates them, then reconciles observations into persistent records; it also tracks request/run activity and exports jobs and a run report. Reed’s multi-scope discovery, LinkedIn’s rate-limit-aware detail batches, conservative duplicate linking, and evidence-based removals are distinct product capabilities. Some orchestration details are only documented or indexed, so the graph omits uncertain call relationships.

Main entry points: [`src/main.py`](https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/main.py) (Crawl orchestrator), [`src/http_client.py`](https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/http_client.py) (HTTP client), [`src/persistence.py`](https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/persistence.py) (Job persistence), [`src/crawlers/linkedin.py`](https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/crawlers/linkedin.py) (LinkedIn discovery and parser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_crawl["Crawling"]
  node_runner["Crawl orchestrator<br/>[main.py]"]
  node_reed_discovery["Reed discovery<br/>[reed_discovery.py]"]
  node_reed_parser["Reed detail parser<br/>[reed.py]"]
  node_linkedin["LinkedIn discovery and parser<br/>[linkedin.py]"]
  node_linkedin_workflow["LinkedIn detail workflow"]
  node_indeed["Indeed access check<br/>[indeed.py]"]
  node_http["HTTP client<br/>[http_client.py]"]
  node_proxy["Proxy configuration<br/>[proxy.py]"]
end

subgraph group_ingest["Ingestion"]
  node_validation["Job validation<br/>[validation.py]"]
  node_refresh["Refresh selection<br/>[refresh.py]"]
end

subgraph group_state["Storage and lifecycle"]
  node_reconciliation["Observation reconciliation<br/>[reconciliation.py]"]
  node_persistence["Job persistence<br/>[persistence.py]"]
  node_dedup["Cross-board linking<br/>[deduplication.py]"]
  node_database[("PostgreSQL records<br/>[schema.sql]")]
end

subgraph group_ops["Monitoring and outputs"]
  node_cost["Proxy cost estimate<br/>[cost.py]"]
  node_export["Jobs export<br/>[export.py]"]
  node_report["Run report<br/>[main.py]"]
  node_request_log[("Request log<br/>[schema.sql]")]
end

node_operator(("Operator"))

node_operator -->|"starts crawl"| node_runner
node_runner -->|"discovers listings"| node_reed_discovery
node_runner -->|"fetches details"| node_reed_parser
node_runner -->|"discovers listings"| node_linkedin
node_runner -->|"selects due"| node_refresh
node_runner -->|"batches details"| node_linkedin_workflow
node_runner -->|"checks access"| node_indeed
node_reed_discovery -->|"requests pages"| node_http
node_reed_parser -->|"requests details"| node_http
node_linkedin -->|"requests pages"| node_http
node_linkedin_workflow -.->|"fetches details"| node_linkedin
node_runner -->|"validates jobs"| node_validation
node_runner -->|"reconciles observations"| node_reconciliation
node_reconciliation -->|"upserts and removes"| node_persistence
node_persistence -->|"checks fields"| node_validation
node_runner -->|"links duplicates"| node_dedup
node_persistence -->|"writes jobs"| node_database
node_refresh -->|"reads refresh times"| node_database
node_dedup -->|"links records"| node_database
node_http -->|"logs attempts"| node_request_log
node_http -.->|"configures proxy"| node_proxy
node_runner -->|"estimates cost"| node_cost
node_runner -->|"exports records"| node_export
node_runner -->|"writes summary"| node_report

click node_runner "https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/main.py"
click node_reed_discovery "https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/crawlers/reed_discovery.py"
click node_reed_parser "https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/crawlers/reed.py"
click node_linkedin "https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/crawlers/linkedin.py"
click node_linkedin_workflow "https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/linkedin_workflow.py"
click node_indeed "https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/crawlers/indeed.py"
click node_http "https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/http_client.py"
click node_proxy "https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/proxy.py"
click node_cost "https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/cost.py"
click node_validation "https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/validation.py"
click node_refresh "https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/refresh.py"
click node_reconciliation "https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/reconciliation.py"
click node_persistence "https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/persistence.py"
click node_dedup "https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/deduplication.py"
click node_database "https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/schema.sql"
click node_export "https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/export.py"
click node_report "https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/main.py"
click node_request_log "https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/schema.sql"

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_runner,node_reed_discovery,node_reed_parser,node_linkedin,node_linkedin_workflow,node_indeed,node_http,node_proxy toneBlue
class node_validation,node_refresh toneAmber
class node_reconciliation,node_persistence,node_dedup,node_database toneMint
class node_cost,node_export,node_report,node_request_log toneRose
class node_operator toneIndigo
```

## Components

### Crawling

- [Crawl orchestrator](https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/main.py): `src/main.py`
- [Reed discovery](https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/crawlers/reed_discovery.py): `src/crawlers/reed_discovery.py`
- [Reed detail parser](https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/crawlers/reed.py): `src/crawlers/reed.py`
- [LinkedIn discovery and parser](https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/crawlers/linkedin.py): `src/crawlers/linkedin.py`
- [LinkedIn detail workflow](https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/linkedin_workflow.py): `src/linkedin_workflow.py`
- [Indeed access check](https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/crawlers/indeed.py): `src/crawlers/indeed.py`
- [HTTP client](https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/http_client.py): `src/http_client.py`
- [Proxy configuration](https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/proxy.py): `src/proxy.py`

### Ingestion

- [Job validation](https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/validation.py): `src/validation.py`
- [Refresh selection](https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/refresh.py): `src/refresh.py`

### Storage and lifecycle

- [Observation reconciliation](https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/reconciliation.py): `src/reconciliation.py`
- [Job persistence](https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/persistence.py): `src/persistence.py`
- [Cross-board linking](https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/deduplication.py): `src/deduplication.py`
- [PostgreSQL records](https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/schema.sql): `src/schema.sql`

### Monitoring and outputs

- [Proxy cost estimate](https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/cost.py): `src/cost.py`
- [Jobs export](https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/export.py): `src/export.py`
- [Run report](https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/main.py): `src/main.py`
- [Request log](https://github.com/kanukuntla-r/rotto-backend-task-ruthvik/blob/main/src/schema.sql): `src/schema.sql`

### Other components

- **Operator**

## Connections

- Operator → Crawl orchestrator: starts crawl (evidence: `README.md`)
- Crawl orchestrator → Reed discovery: discovers listings (evidence: `README.md`)
- Crawl orchestrator → Reed detail parser: fetches details (evidence: `README.md`)
- Crawl orchestrator → LinkedIn discovery and parser: discovers listings (evidence: `README.md`)
- Crawl orchestrator → Refresh selection: selects due (evidence: `README.md`)
- Crawl orchestrator → LinkedIn detail workflow: batches details (evidence: `README.md`)
- Crawl orchestrator → Indeed access check: checks access (evidence: `README.md`)
- Reed discovery → HTTP client: requests pages (evidence: `src/crawlers/reed_discovery.py`)
- Reed detail parser → HTTP client: requests details (evidence: `src/crawlers/reed.py`)
- LinkedIn discovery and parser → HTTP client: requests pages (evidence: `src/crawlers/linkedin.py`)
- LinkedIn detail workflow → LinkedIn discovery and parser: fetches details
- Crawl orchestrator → Job validation: validates jobs (evidence: `README.md`)
- Crawl orchestrator → Observation reconciliation: reconciles observations (evidence: `README.md`)
- Observation reconciliation → Job persistence: upserts and removes (evidence: `src/reconciliation.py`)
- Job persistence → Job validation: checks fields (evidence: `src/persistence.py`)
- Crawl orchestrator → Cross-board linking: links duplicates (evidence: `README.md`)
- Job persistence → PostgreSQL records: writes jobs (evidence: `README.md`)
- Refresh selection → PostgreSQL records: reads refresh times (evidence: `README.md`)
- Cross-board linking → PostgreSQL records: links records (evidence: `README.md`)
- HTTP client → Request log: logs attempts (evidence: `src/http_client.py`)
- HTTP client → Proxy configuration: configures proxy
- Crawl orchestrator → Proxy cost estimate: estimates cost (evidence: `README.md`)
- Crawl orchestrator → Jobs export: exports records (evidence: `README.md`)
- Crawl orchestrator → Run report: writes summary (evidence: `README.md`)
