# sigangandegwa/halisiapp architecture

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

- Interactive diagram: https://gitdiagram.com/sigangandegwa/halisiapp
- Repository: https://github.com/sigangandegwa/halisiapp

## Overview

Halisi detects brand impersonation and payment fraud, giving customers a verdict before payment and merchants evidence-backed response tools. The principal flow is a customer-submitted page or handle routed through the API into profile acquisition, visual/identity/payment/language scoring, and scan/threat persistence; threat alerts and remediation serve the merchant follow-up. The README also documents payment-number checks, verified merchant pages, community reporting, dashboards, and simulator capabilities. Relationships use README statements and SOURCE INDEX references; unsampled modules are represented at their enclosing directory where needed.

Main entry points: [`backend/app/services/check.py`](https://github.com/sigangandegwa/halisiapp/blob/main/backend/app/services/check.py) (Check pipeline), [`backend/app/api/v1/router.py`](https://github.com/sigangandegwa/halisiapp/blob/main/backend/app/api/v1/router.py) (API router), [`backend/app/core/repository.py`](https://github.com/sigangandegwa/halisiapp/blob/main/backend/app/core/repository.py) (Repository), [`backend/app/api/v1/endpoints/check.py`](https://github.com/sigangandegwa/halisiapp/blob/main/backend/app/api/v1/endpoints/check.py) (Check endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Customer and merchant experience"]
  node_web_check["Page check<br/>[checker.tsx]"]
  node_payment_check["Payment check<br/>[pay-checker.tsx]"]
  node_verified_page["Verified page<br/>[page.tsx]"]
  node_merchant_dashboard["Threat dashboard<br/>[page.tsx]"]
  node_reporting["Community report<br/>[report-form.tsx]"]
  node_simulator["Simulator"]
end

subgraph group_api["API and channels"]
  node_api_app["FastAPI app<br/>[main.py]"]
  node_api_router["API router<br/>[router.py]"]
  node_check_endpoint["Check endpoint<br/>[check.py]"]
  node_merchant_endpoints["Merchant endpoints<br/>[merchants.py]"]
  node_report_endpoints["Report endpoints<br/>[reports.py]"]
  node_threat_endpoints["Threat endpoints<br/>[threats.py]"]
  node_channels["Messaging channels"]
end

subgraph group_detection["Detection and ingestion"]
  node_check_service["Check pipeline<br/>[check.py]"]
  node_scoring["Scoring engine<br/>[scorer.py]"]
  node_visual_engine["Visual matching"]
  node_profile_ingestion["Profile ingestion"]
  node_payment_validation["Payment validation<br/>[daraja.py]"]
end

subgraph group_operations["Merchant response"]
  node_alerting["Threat alerts<br/>[dispatcher.py]"]
  node_response_kit["Remediation kit<br/>[remediation.py]"]
end

subgraph group_data["Persistence and integrations"]
  node_repository[("Repository<br/>[repository.py]")]
  node_supabase[("Supabase")]
  node_nim{{"NVIDIA NIM"}}
end

node_customer(("Customer"))
node_merchant(("Merchant"))

node_customer -->|"submits page"| node_web_check
node_web_check -.->|"requests check"| node_check_endpoint
node_check_endpoint -->|"invokes pipeline"| node_check_service
node_check_service -->|"acquires profile"| node_profile_ingestion
node_check_service -->|"extracts features"| node_visual_engine
node_check_service -->|"scores signals"| node_scoring
node_check_service -->|"stores scan and threat"| node_repository
node_check_service -->|"dispatches alert"| node_alerting
node_customer -->|"checks number"| node_payment_check
node_payment_check -.->|"validates payment"| node_payment_validation
node_payment_validation -.->|"checks payment data"| node_repository
node_merchant -->|"shares certificate"| node_verified_page
node_merchant -->|"reviews threats"| node_merchant_dashboard
node_merchant_dashboard -.->|"loads threat data"| node_threat_endpoints
node_merchant -->|"submits report"| node_reporting
node_reporting -.->|"sends report"| node_report_endpoints
node_customer -.->|"tries scenarios"| node_simulator
node_api_app -->|"mounts router"| node_api_router
node_api_router -->|"registers route"| node_check_endpoint
node_api_router -->|"registers route"| node_merchant_endpoints
node_api_router -->|"registers route"| node_report_endpoints
node_api_router -->|"registers route"| node_threat_endpoints
node_api_router -->|"mounts channels"| node_channels
node_merchant_endpoints -->|"reads and writes"| node_repository
node_report_endpoints -->|"records reports"| node_repository
node_repository -.->|"persists records"| node_supabase
node_check_service -.->|"grounds response kit"| node_response_kit
node_response_kit -->|"drafts with model"| node_nim
node_merchant -->|"reviews and sends"| node_response_kit

click node_web_check "https://github.com/sigangandegwa/halisiapp/blob/main/frontend/src/components/checker/checker.tsx"
click node_payment_check "https://github.com/sigangandegwa/halisiapp/blob/main/frontend/src/components/pay/pay-checker.tsx"
click node_verified_page "https://github.com/sigangandegwa/halisiapp/blob/main/frontend/src/app/(public)/v/%5Bslug%5D/page.tsx"
click node_merchant_dashboard "https://github.com/sigangandegwa/halisiapp/blob/main/frontend/src/app/dashboard/page.tsx"
click node_reporting "https://github.com/sigangandegwa/halisiapp/blob/main/frontend/src/components/report/report-form.tsx"
click node_simulator "https://github.com/sigangandegwa/halisiapp/tree/main/frontend/src/components"
click node_api_app "https://github.com/sigangandegwa/halisiapp/blob/main/backend/app/main.py"
click node_api_router "https://github.com/sigangandegwa/halisiapp/blob/main/backend/app/api/v1/router.py"
click node_check_endpoint "https://github.com/sigangandegwa/halisiapp/blob/main/backend/app/api/v1/endpoints/check.py"
click node_merchant_endpoints "https://github.com/sigangandegwa/halisiapp/blob/main/backend/app/api/v1/endpoints/merchants.py"
click node_report_endpoints "https://github.com/sigangandegwa/halisiapp/blob/main/backend/app/api/v1/endpoints/reports.py"
click node_threat_endpoints "https://github.com/sigangandegwa/halisiapp/blob/main/backend/app/api/v1/endpoints/threats.py"
click node_channels "https://github.com/sigangandegwa/halisiapp/tree/main/backend/app/channels"
click node_check_service "https://github.com/sigangandegwa/halisiapp/blob/main/backend/app/services/check.py"
click node_scoring "https://github.com/sigangandegwa/halisiapp/blob/main/backend/app/engine/scorer.py"
click node_visual_engine "https://github.com/sigangandegwa/halisiapp/tree/main/backend/app/engine"
click node_profile_ingestion "https://github.com/sigangandegwa/halisiapp/tree/main/backend/app/ingestion"
click node_payment_validation "https://github.com/sigangandegwa/halisiapp/blob/main/backend/app/ingestion/daraja.py"
click node_alerting "https://github.com/sigangandegwa/halisiapp/blob/main/backend/app/alerts/dispatcher.py"
click node_response_kit "https://github.com/sigangandegwa/halisiapp/blob/main/backend/app/services/remediation.py"
click node_repository "https://github.com/sigangandegwa/halisiapp/blob/main/backend/app/core/repository.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_web_check,node_payment_check,node_verified_page,node_merchant_dashboard,node_reporting,node_simulator toneBlue
class node_api_app,node_api_router,node_check_endpoint,node_merchant_endpoints,node_report_endpoints,node_threat_endpoints,node_channels toneAmber
class node_check_service,node_scoring,node_visual_engine,node_profile_ingestion,node_payment_validation toneMint
class node_alerting,node_response_kit toneRose
class node_repository,node_supabase,node_nim,node_customer,node_merchant toneIndigo
```

## Components

### Customer and merchant experience

- [Page check](https://github.com/sigangandegwa/halisiapp/blob/main/frontend/src/components/checker/checker.tsx): `frontend/src/components/checker/checker.tsx`
- [Payment check](https://github.com/sigangandegwa/halisiapp/blob/main/frontend/src/components/pay/pay-checker.tsx): `frontend/src/components/pay/pay-checker.tsx`
- [Verified page](https://github.com/sigangandegwa/halisiapp/blob/main/frontend/src/app/(public)/v/%5Bslug%5D/page.tsx): `frontend/src/app/(public)/v/[slug]/page.tsx`
- [Threat dashboard](https://github.com/sigangandegwa/halisiapp/blob/main/frontend/src/app/dashboard/page.tsx): `frontend/src/app/dashboard/page.tsx`
- [Community report](https://github.com/sigangandegwa/halisiapp/blob/main/frontend/src/components/report/report-form.tsx): `frontend/src/components/report/report-form.tsx`
- [Simulator](https://github.com/sigangandegwa/halisiapp/tree/main/frontend/src/components): `frontend/src/components`

### API and channels

- [FastAPI app](https://github.com/sigangandegwa/halisiapp/blob/main/backend/app/main.py): `backend/app/main.py`
- [API router](https://github.com/sigangandegwa/halisiapp/blob/main/backend/app/api/v1/router.py): `backend/app/api/v1/router.py`
- [Check endpoint](https://github.com/sigangandegwa/halisiapp/blob/main/backend/app/api/v1/endpoints/check.py): `backend/app/api/v1/endpoints/check.py`
- [Merchant endpoints](https://github.com/sigangandegwa/halisiapp/blob/main/backend/app/api/v1/endpoints/merchants.py): `backend/app/api/v1/endpoints/merchants.py`
- [Report endpoints](https://github.com/sigangandegwa/halisiapp/blob/main/backend/app/api/v1/endpoints/reports.py): `backend/app/api/v1/endpoints/reports.py`
- [Threat endpoints](https://github.com/sigangandegwa/halisiapp/blob/main/backend/app/api/v1/endpoints/threats.py): `backend/app/api/v1/endpoints/threats.py`
- [Messaging channels](https://github.com/sigangandegwa/halisiapp/tree/main/backend/app/channels): `backend/app/channels`

### Detection and ingestion

- [Check pipeline](https://github.com/sigangandegwa/halisiapp/blob/main/backend/app/services/check.py): `backend/app/services/check.py`
- [Scoring engine](https://github.com/sigangandegwa/halisiapp/blob/main/backend/app/engine/scorer.py): `backend/app/engine/scorer.py`
- [Visual matching](https://github.com/sigangandegwa/halisiapp/tree/main/backend/app/engine): `backend/app/engine`
- [Profile ingestion](https://github.com/sigangandegwa/halisiapp/tree/main/backend/app/ingestion): `backend/app/ingestion`
- [Payment validation](https://github.com/sigangandegwa/halisiapp/blob/main/backend/app/ingestion/daraja.py): `backend/app/ingestion/daraja.py`

### Merchant response

- [Threat alerts](https://github.com/sigangandegwa/halisiapp/blob/main/backend/app/alerts/dispatcher.py): `backend/app/alerts/dispatcher.py`
- [Remediation kit](https://github.com/sigangandegwa/halisiapp/blob/main/backend/app/services/remediation.py): `backend/app/services/remediation.py`

### Persistence and integrations

- [Repository](https://github.com/sigangandegwa/halisiapp/blob/main/backend/app/core/repository.py): `backend/app/core/repository.py`
- **Supabase**
- **NVIDIA NIM**

### Other components

- **Customer**
- **Merchant**

## Connections

- Customer → Page check: submits page
- Page check → Check endpoint: requests check
- Check endpoint → Check pipeline: invokes pipeline (evidence: `backend/app/api/v1/endpoints/check.py`)
- Check pipeline → Profile ingestion: acquires profile (evidence: `backend/app/services/check.py`)
- Check pipeline → Visual matching: extracts features (evidence: `backend/app/services/check.py`)
- Check pipeline → Scoring engine: scores signals (evidence: `backend/app/services/check.py`)
- Check pipeline → Repository: stores scan and threat (evidence: `backend/app/services/check.py`)
- Check pipeline → Threat alerts: dispatches alert (evidence: `backend/app/services/check.py`)
- Customer → Payment check: checks number
- Payment check → Payment validation: validates payment
- Payment validation → Repository: checks payment data
- Merchant → Verified page: shares certificate
- Merchant → Threat dashboard: reviews threats
- Threat dashboard → Threat endpoints: loads threat data
- Merchant → Community report: submits report
- Community report → Report endpoints: sends report
- Customer → Simulator: tries scenarios
- FastAPI app → API router: mounts router (evidence: `backend/app/main.py`)
- API router → Check endpoint: registers route (evidence: `backend/app/api/v1/router.py`)
- API router → Merchant endpoints: registers route (evidence: `backend/app/api/v1/router.py`)
- API router → Report endpoints: registers route (evidence: `backend/app/api/v1/router.py`)
- API router → Threat endpoints: registers route (evidence: `backend/app/api/v1/router.py`)
- API router → Messaging channels: mounts channels (evidence: `backend/app/api/v1/router.py`)
- Merchant endpoints → Repository: reads and writes (evidence: `backend/app/api/v1/endpoints/merchants.py`)
- Report endpoints → Repository: records reports (evidence: `backend/app/api/v1/endpoints/reports.py`)
- Repository → Supabase: persists records
- Check pipeline → Remediation kit: grounds response kit
- Remediation kit → NVIDIA NIM: drafts with model
- Merchant → Remediation kit: reviews and sends
