# hemanth-sharma/assessment_test architecture

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

- Interactive diagram: https://gitdiagram.com/hemanth-sharma/assessment_test
- Repository: https://github.com/hemanth-sharma/assessment_test

## Overview

Redarky is a social-listening and B2B lead-generation backend. Users configure projects, keywords, and monitored sources; scraped posts enter through ingestion, are processed asynchronously for keyword and semantic matches and lead intent, then become posts and leads that can be reviewed or sent to integrations. The README documents this broad pipeline; the sampled source index supports key API, worker, matching, and persistence links. Some scraper internals and unsampled product routes are shown as capabilities, but their wiring is not inferred.

Main entry points: [`redarky/api/app/main.py`](https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/main.py) (FastAPI app), [`redarky/api/app/database.py`](https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/database.py) (PostgreSQL), [`redarky/api/app/matching/service.py`](https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/matching/service.py) (Post matching), [`redarky/api/app/scraper/service.py`](https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/scraper/service.py) (Scraper API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and setup"]
  node_api["FastAPI app<br/>[main.py]"]
  node_auth["Authentication<br/>[router.py]"]
  node_projects["Projects<br/>[service.py]"]
  node_keywords["Keywords<br/>[service.py]"]
end

subgraph group_collection["Source collection"]
  node_sources["Source registry<br/>[service.py]"]
  node_scraper_api["Scraper API<br/>[service.py]"]
  node_go_scraper["Go scraper<br/>[handler.go]"]
  node_reddit["Reddit client<br/>[client.go]"]
  node_ingestion["Post ingestion<br/>[service.py]"]
end

subgraph group_processing["Matching pipeline"]
  node_queue["Celery tasks<br/>[matching_tasks.py]"]
  node_matching["Post matching<br/>[service.py]"]
  node_ai["AI analysis<br/>[lead_agent.py]"]
end

subgraph group_results["Lead management"]
  node_posts["Matched posts<br/>[service.py]"]
  node_leads["Lead management<br/>[service.py]"]
  node_integrations["Outbound integrations<br/>[service.py]"]
  node_feedback["Verified feedback<br/>[service.py]"]
end

subgraph group_platform["Runtime and persistence"]
  node_database[("PostgreSQL<br/>[database.py]")]
  node_models["Domain models<br/>[models.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_api
node_api -->|"registers routes"| node_auth
node_api -->|"registers routes"| node_projects
node_api -->|"registers routes"| node_keywords
node_api -->|"registers routes"| node_sources
node_api -->|"registers routes"| node_scraper_api
node_api -->|"registers routes"| node_ingestion
node_auth -->|"loads user"| node_database
node_projects -->|"reads and writes"| node_database
node_keywords -->|"reads and writes"| node_database
node_sources -->|"tracks subscriptions"| node_database
node_scraper_api -->|"loads active sources"| node_sources
node_scraper_api -->|"aligns keywords"| node_keywords
node_go_scraper -.-> node_reddit
node_go_scraper -.->|"sends scraped data"| node_ingestion
node_ingestion -->|"dispatches matching"| node_queue
node_queue -->|"runs matching"| node_matching
node_matching -->|"uses lead agent"| node_ai
node_matching -->|"loads LLM config"| node_integrations
node_matching -.->|"creates matched posts"| node_posts
node_matching -.->|"creates leads"| node_leads
node_leads -->|"notifies channels"| node_integrations
node_posts -->|"persists posts"| node_database
node_leads -->|"persists leads"| node_database
node_feedback -.->|"stores feedback"| node_database
node_models -->|"uses base"| node_database

click node_api "https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/main.py"
click node_auth "https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/auth/router.py"
click node_projects "https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/projects/service.py"
click node_keywords "https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/keywords/service.py"
click node_sources "https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/sources/service.py"
click node_scraper_api "https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/scraper/service.py"
click node_go_scraper "https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/scraper/internal/scraper/handler.go"
click node_reddit "https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/scraper/internal/reddit/client.go"
click node_ingestion "https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/ingestion/service.py"
click node_queue "https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/workers/matching_tasks.py"
click node_matching "https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/matching/service.py"
click node_ai "https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/ai/lead_agent.py"
click node_posts "https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/posts/service.py"
click node_leads "https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/leads/service.py"
click node_integrations "https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/integrations/service.py"
click node_feedback "https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/feedback/service.py"
click node_database "https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/database.py"
click node_models "https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/models.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,node_auth,node_projects,node_keywords,node_user toneBlue
class node_sources,node_scraper_api,node_go_scraper,node_reddit,node_ingestion toneAmber
class node_queue,node_matching,node_ai toneMint
class node_posts,node_leads,node_integrations,node_feedback toneRose
class node_database,node_models toneIndigo
```

## Components

### API and setup

- [FastAPI app](https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/main.py): `redarky/api/app/main.py`
- [Authentication](https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/auth/router.py): `redarky/api/app/auth/router.py`
- [Projects](https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/projects/service.py): `redarky/api/app/projects/service.py`
- [Keywords](https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/keywords/service.py): `redarky/api/app/keywords/service.py`

### Source collection

- [Source registry](https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/sources/service.py): `redarky/api/app/sources/service.py`
- [Scraper API](https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/scraper/service.py): `redarky/api/app/scraper/service.py`
- [Go scraper](https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/scraper/internal/scraper/handler.go): `redarky/scraper/internal/scraper/handler.go`
- [Reddit client](https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/scraper/internal/reddit/client.go): `redarky/scraper/internal/reddit/client.go`
- [Post ingestion](https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/ingestion/service.py): `redarky/api/app/ingestion/service.py`

### Matching pipeline

- [Celery tasks](https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/workers/matching_tasks.py): `redarky/api/app/workers/matching_tasks.py`
- [Post matching](https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/matching/service.py): `redarky/api/app/matching/service.py`
- [AI analysis](https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/ai/lead_agent.py): `redarky/api/app/ai/lead_agent.py`

### Lead management

- [Matched posts](https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/posts/service.py): `redarky/api/app/posts/service.py`
- [Lead management](https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/leads/service.py): `redarky/api/app/leads/service.py`
- [Outbound integrations](https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/integrations/service.py): `redarky/api/app/integrations/service.py`
- [Verified feedback](https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/feedback/service.py): `redarky/api/app/feedback/service.py`

### Runtime and persistence

- [PostgreSQL](https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/database.py): `redarky/api/app/database.py`
- [Domain models](https://github.com/hemanth-sharma/assessment_test/blob/main/redarky/api/app/models.py): `redarky/api/app/models.py`

### Other components

- **User**

## Connections

- User → FastAPI app: uses
- FastAPI app → Authentication: registers routes (evidence: `redarky/api/app/main.py`)
- FastAPI app → Projects: registers routes (evidence: `redarky/api/app/main.py`)
- FastAPI app → Keywords: registers routes (evidence: `redarky/api/app/main.py`)
- FastAPI app → Source registry: registers routes (evidence: `redarky/api/app/main.py`)
- FastAPI app → Scraper API: registers routes (evidence: `redarky/api/app/main.py`)
- FastAPI app → Post ingestion: registers routes (evidence: `redarky/api/app/main.py`)
- Authentication → PostgreSQL: loads user (evidence: `redarky/api/app/auth/router.py`)
- Projects → PostgreSQL: reads and writes (evidence: `redarky/api/app/projects/service.py`)
- Keywords → PostgreSQL: reads and writes (evidence: `redarky/api/app/keywords/service.py`)
- Source registry → PostgreSQL: tracks subscriptions (evidence: `redarky/api/app/sources/service.py`)
- Scraper API → Source registry: loads active sources (evidence: `redarky/api/app/scraper/service.py`)
- Scraper API → Keywords: aligns keywords (evidence: `redarky/api/app/scraper/service.py`)
- Go scraper → Reddit client
- Go scraper → Post ingestion: sends scraped data
- Post ingestion → Celery tasks: dispatches matching (evidence: `redarky/api/app/ingestion/router.py`)
- Celery tasks → Post matching: runs matching (evidence: `redarky/api/app/workers/matching_tasks.py`)
- Post matching → AI analysis: uses lead agent (evidence: `redarky/api/app/matching/service.py`)
- Post matching → Outbound integrations: loads LLM config (evidence: `redarky/api/app/matching/service.py`)
- Post matching → Matched posts: creates matched posts
- Post matching → Lead management: creates leads
- Lead management → Outbound integrations: notifies channels (evidence: `redarky/api/app/integrations/service.py`)
- Matched posts → PostgreSQL: persists posts (evidence: `redarky/api/app/posts/service.py`)
- Lead management → PostgreSQL: persists leads (evidence: `redarky/api/app/leads/service.py`)
- Verified feedback → PostgreSQL: stores feedback
- Domain models → PostgreSQL: uses base (evidence: `redarky/api/app/models.py`)
