# abdullah00ashraf/hares architecture

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

- Interactive diagram: https://gitdiagram.com/abdullah00ashraf/hares
- Repository: https://github.com/abdullah00ashraf/hares

## Overview

Project Hares is a UAE-focused fraud and threat-triage platform with a citizen verification portal, WhatsApp intake, audio deepfake analysis, and a municipal threat-intelligence workbench. Citizens submit suspicious messages or voice notes; the backend processes WhatsApp jobs and returns verdicts, while analysts explore threat and model information in the portal. The README documents additional capabilities such as STIX feeds, homograph analysis, and escalation. Some backend modules and route wiring are unsampled, so uncertain connections are omitted.

Main entry points: [`frontend/src/app/page.tsx`](https://github.com/abdullah00ashraf/hares/blob/main/frontend/src/app/page.tsx) (SOC Workbench), [`src/hares/workers/tasks.py`](https://github.com/abdullah00ashraf/hares/blob/main/src/hares/workers/tasks.py) (Triage Worker), [`src/hares/api/v1/webhook.py`](https://github.com/abdullah00ashraf/hares/blob/main/src/hares/api/v1/webhook.py) (Webhook Intake), [`src/hares/services/whatsapp_client.py`](https://github.com/abdullah00ashraf/hares/blob/main/src/hares/services/whatsapp_client.py) (WhatsApp Reply)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User Entry"]
  node_web_portal["Citizen Portal"]
  node_app["API Application<br/>[main.py]"]
  node_webhook["Webhook Intake<br/>[webhook.py]"]
end

subgraph group_processing["Triage Processing"]
  node_jobs["Triage Worker<br/>[tasks.py]"]
  node_audio["Audio Analysis<br/>[audio_pipeline.py]"]
  node_verdict["Verdict Engine<br/>[verdict.py]"]
  node_wa_reply["WhatsApp Reply<br/>[whatsapp_client.py]"]
end

subgraph group_intelligence["Threat Intelligence"]
  node_threat_repo[("Threat Repository<br/>[threat_repo.py]")]
end

subgraph group_portal["Web Portal"]
  node_soc["SOC Workbench<br/>[page.tsx]"]
  node_campaigns["Campaign Analysis"]
  node_iocs["IoC Analysis<br/>[IocWorkbench.tsx]"]
  node_homographs["Homograph Analysis"]
  node_audio_ui["Audio Forensics"]
  node_metrics["Model Metrics"]
  node_overview["SOC Overview"]
  node_stix["STIX Campaign Graph"]
  node_telemetry["Live Telemetry"]
end

node_citizen(("Citizen"))
node_analyst(("Municipal Analyst"))
node_whatsapp(("WhatsApp Client"))

node_citizen -->|"submits evidence"| node_web_portal
node_whatsapp -->|"sends messages"| node_webhook
node_webhook -->|"enqueues job"| node_jobs
node_app -->|"registers route"| node_webhook
node_jobs -->|"analyzes audio"| node_audio
node_jobs -->|"builds verdict"| node_verdict
node_jobs -->|"sends verdict"| node_wa_reply
node_jobs -->|"persists indicators"| node_threat_repo
node_wa_reply -->|"delivers reply"| node_whatsapp
node_analyst -->|"opens workbench"| node_soc
node_soc -->|"selects view"| node_overview
node_soc -->|"selects view"| node_campaigns
node_soc -->|"selects view"| node_iocs
node_soc -->|"selects view"| node_homographs
node_soc -->|"selects view"| node_audio_ui
node_soc -->|"selects view"| node_metrics
node_campaigns -.->|"renders graph"| node_stix
node_metrics -.->|"shows feed"| node_telemetry

click node_web_portal "https://github.com/abdullah00ashraf/hares/blob/main/frontend/src/components/CitizenTriagePortal.tsx"
click node_app "https://github.com/abdullah00ashraf/hares/blob/main/src/hares/main.py"
click node_webhook "https://github.com/abdullah00ashraf/hares/blob/main/src/hares/api/v1/webhook.py"
click node_jobs "https://github.com/abdullah00ashraf/hares/blob/main/src/hares/workers/tasks.py"
click node_audio "https://github.com/abdullah00ashraf/hares/blob/main/src/hares/ai/audio_pipeline.py"
click node_verdict "https://github.com/abdullah00ashraf/hares/blob/main/src/hares/engine/verdict.py"
click node_wa_reply "https://github.com/abdullah00ashraf/hares/blob/main/src/hares/services/whatsapp_client.py"
click node_threat_repo "https://github.com/abdullah00ashraf/hares/blob/main/src/hares/db/repositories/threat_repo.py"
click node_soc "https://github.com/abdullah00ashraf/hares/blob/main/frontend/src/app/page.tsx"
click node_campaigns "https://github.com/abdullah00ashraf/hares/blob/main/frontend/src/components/CampaignWorkbench.tsx"
click node_iocs "https://github.com/abdullah00ashraf/hares/blob/main/frontend/src/components/IocWorkbench.tsx"
click node_homographs "https://github.com/abdullah00ashraf/hares/blob/main/frontend/src/components/HomographWorkbench.tsx"
click node_audio_ui "https://github.com/abdullah00ashraf/hares/blob/main/frontend/src/components/AudioTriageWorkbench.tsx"
click node_metrics "https://github.com/abdullah00ashraf/hares/blob/main/frontend/src/components/ModelMetricsWorkbench.tsx"
click node_overview "https://github.com/abdullah00ashraf/hares/blob/main/frontend/src/components/OverviewWorkbench.tsx"
click node_stix "https://github.com/abdullah00ashraf/hares/blob/main/frontend/src/components/StixCampaignGraph.tsx"
click node_telemetry "https://github.com/abdullah00ashraf/hares/blob/main/frontend/src/components/LiveTelemetryFeed.tsx"

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_web_portal,node_app,node_webhook,node_whatsapp toneBlue
class node_jobs,node_audio,node_verdict,node_wa_reply toneAmber
class node_threat_repo toneMint
class node_soc,node_campaigns,node_iocs,node_homographs,node_audio_ui,node_metrics,node_overview,node_stix,node_telemetry toneRose
class node_citizen,node_analyst toneIndigo
```

## Components

### User Entry

- [Citizen Portal](https://github.com/abdullah00ashraf/hares/blob/main/frontend/src/components/CitizenTriagePortal.tsx): `frontend/src/components/CitizenTriagePortal.tsx`
- [API Application](https://github.com/abdullah00ashraf/hares/blob/main/src/hares/main.py): `src/hares/main.py`
- [Webhook Intake](https://github.com/abdullah00ashraf/hares/blob/main/src/hares/api/v1/webhook.py): `src/hares/api/v1/webhook.py`

### Triage Processing

- [Triage Worker](https://github.com/abdullah00ashraf/hares/blob/main/src/hares/workers/tasks.py): `src/hares/workers/tasks.py`
- [Audio Analysis](https://github.com/abdullah00ashraf/hares/blob/main/src/hares/ai/audio_pipeline.py): `src/hares/ai/audio_pipeline.py`
- [Verdict Engine](https://github.com/abdullah00ashraf/hares/blob/main/src/hares/engine/verdict.py): `src/hares/engine/verdict.py`
- [WhatsApp Reply](https://github.com/abdullah00ashraf/hares/blob/main/src/hares/services/whatsapp_client.py): `src/hares/services/whatsapp_client.py`

### Threat Intelligence

- [Threat Repository](https://github.com/abdullah00ashraf/hares/blob/main/src/hares/db/repositories/threat_repo.py): `src/hares/db/repositories/threat_repo.py`

### Web Portal

- [SOC Workbench](https://github.com/abdullah00ashraf/hares/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`
- [Campaign Analysis](https://github.com/abdullah00ashraf/hares/blob/main/frontend/src/components/CampaignWorkbench.tsx): `frontend/src/components/CampaignWorkbench.tsx`
- [IoC Analysis](https://github.com/abdullah00ashraf/hares/blob/main/frontend/src/components/IocWorkbench.tsx): `frontend/src/components/IocWorkbench.tsx`
- [Homograph Analysis](https://github.com/abdullah00ashraf/hares/blob/main/frontend/src/components/HomographWorkbench.tsx): `frontend/src/components/HomographWorkbench.tsx`
- [Audio Forensics](https://github.com/abdullah00ashraf/hares/blob/main/frontend/src/components/AudioTriageWorkbench.tsx): `frontend/src/components/AudioTriageWorkbench.tsx`
- [Model Metrics](https://github.com/abdullah00ashraf/hares/blob/main/frontend/src/components/ModelMetricsWorkbench.tsx): `frontend/src/components/ModelMetricsWorkbench.tsx`
- [SOC Overview](https://github.com/abdullah00ashraf/hares/blob/main/frontend/src/components/OverviewWorkbench.tsx): `frontend/src/components/OverviewWorkbench.tsx`
- [STIX Campaign Graph](https://github.com/abdullah00ashraf/hares/blob/main/frontend/src/components/StixCampaignGraph.tsx): `frontend/src/components/StixCampaignGraph.tsx`
- [Live Telemetry](https://github.com/abdullah00ashraf/hares/blob/main/frontend/src/components/LiveTelemetryFeed.tsx): `frontend/src/components/LiveTelemetryFeed.tsx`

### Other components

- **Citizen**
- **Municipal Analyst**
- **WhatsApp Client**

## Connections

- Citizen → Citizen Portal: submits evidence (evidence: `README.md`)
- WhatsApp Client → Webhook Intake: sends messages (evidence: `README.md`)
- Webhook Intake → Triage Worker: enqueues job (evidence: `src/hares/api/v1/webhook.py`)
- API Application → Webhook Intake: registers route (evidence: `src/hares/main.py`)
- Triage Worker → Audio Analysis: analyzes audio (evidence: `src/hares/workers/tasks.py`)
- Triage Worker → Verdict Engine: builds verdict (evidence: `src/hares/workers/tasks.py`)
- Triage Worker → WhatsApp Reply: sends verdict (evidence: `src/hares/workers/tasks.py`)
- Triage Worker → Threat Repository: persists indicators (evidence: `src/hares/workers/tasks.py`)
- WhatsApp Reply → WhatsApp Client: delivers reply (evidence: `src/hares/services/whatsapp_client.py`)
- Municipal Analyst → SOC Workbench: opens workbench (evidence: `frontend/src/app/page.tsx`)
- SOC Workbench → SOC Overview: selects view (evidence: `frontend/src/app/page.tsx`)
- SOC Workbench → Campaign Analysis: selects view (evidence: `frontend/src/app/page.tsx`)
- SOC Workbench → IoC Analysis: selects view (evidence: `frontend/src/app/page.tsx`)
- SOC Workbench → Homograph Analysis: selects view (evidence: `frontend/src/app/page.tsx`)
- SOC Workbench → Audio Forensics: selects view (evidence: `frontend/src/app/page.tsx`)
- SOC Workbench → Model Metrics: selects view (evidence: `frontend/src/app/page.tsx`)
- Campaign Analysis → STIX Campaign Graph: renders graph
- Model Metrics → Live Telemetry: shows feed
