# abhisheksum/rakshak-digital-brand-protection architecture

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

- Interactive diagram: https://gitdiagram.com/abhisheksum/rakshak-digital-brand-protection
- Repository: https://github.com/abhisheksum/rakshak-digital-brand-protection

## Overview

Rakshak is a digital brand-protection application: an organisation registers a brand and official assets, submits or scans app/social candidates, and reviews scored findings. The main runtime path runs from the React application through its API client to FastAPI routes, then through candidate collection, exclusion, scoring, and persisted findings. The README documents manual social submissions, CSV imports, Apple App Store searches, demo mode, and investigation workflows. Some frontend and backend modules were not sampled; their documented capabilities are included, while uncertain internal calls are omitted.

Main entry points: [`frontend/src/App.tsx`](https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/frontend/src/App.tsx) (Rakshak UI), [`backend/app/api/scans.py`](https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/api/scans.py) (Scan orchestration), [`backend/app/database.py`](https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/database.py) (Relational database), [`backend/app/api/alerts.py`](https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/api/alerts.py) (Findings and investigation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_webapp["Rakshak UI<br/>[App.tsx]"]
  node_brandui["Brand profiles"]
  node_setupui["Brand setup"]
  node_socialui["Social monitoring"]
  node_appsui["App monitoring"]
  node_historyui["Scan history"]
  node_threatui["Threat investigation"]
  node_overviewui["Overview dashboard<br/>[OverviewView.tsx]"]
  node_authui["Sign in and register<br/>[AuthPage.tsx]"]
  node_apiclient["API client<br/>[api.ts]"]
end

subgraph group_api["API and identity"]
  node_server["FastAPI application<br/>[main.py]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_brands["Brand management<br/>[brands.py]"]
  node_scans["Scan orchestration<br/>[scans.py]"]
  node_alerts["Findings and investigation<br/>[alerts.py]"]
end

subgraph group_analysis["Candidate analysis"]
  node_socialcollector["Social candidates"]
  node_appcollector["App Store candidates<br/>[app_collector.py]"]
  node_exclusion["Official asset exclusion<br/>[exclusion.py]"]
  node_scoring["Risk scoring<br/>[scoring.py]"]
  node_findings["Finding construction<br/>[findings.py]"]
end

subgraph group_records["Brand and findings data"]
  node_database[("Relational database<br/>[database.py]")]
  node_brandrecords["Brand and asset records<br/>[brand.py]"]
  node_alertrecords["Alert records<br/>[alert.py]"]
  node_scanrecords["Scan records<br/>[scan.py]"]
end

node_user(("Organisation user"))
node_apple["Apple Search API"]
node_candidate(("Submitted candidates"))

node_user -->|"uses"| node_webapp
node_webapp -->|"shows"| node_brandui
node_webapp -->|"shows"| node_setupui
node_webapp -->|"shows"| node_socialui
node_webapp -->|"shows"| node_appsui
node_webapp -->|"shows"| node_historyui
node_webapp -->|"shows"| node_threatui
node_webapp -->|"shows"| node_overviewui
node_webapp -->|"shows"| node_authui
node_webapp -->|"requests data"| node_apiclient
node_authui -->|"authenticates"| node_apiclient
node_apiclient -->|"calls API"| node_server
node_server -->|"mounts"| node_auth
node_server -->|"mounts"| node_brands
node_server -->|"mounts"| node_scans
node_server -->|"mounts"| node_alerts
node_brands -->|"reads and writes"| node_brandrecords
node_brands -->|"uses sessions"| node_database
node_auth -->|"uses sessions"| node_database
node_auth -->|"persists accounts"| node_user
node_scans -->|"collects candidates"| node_socialcollector
node_scans -->|"collects candidates"| node_appcollector
node_scans -->|"excludes assets"| node_exclusion
node_scans -->|"scores candidates"| node_scoring
node_scans -->|"builds findings"| node_findings
node_scans -->|"uses sessions"| node_database
node_scans -->|"persists scans"| node_scanrecords
node_scans -->|"persists alerts"| node_alertrecords
node_alerts -->|"scores submissions"| node_scoring
node_alerts -->|"checks official assets"| node_exclusion
node_alerts -->|"reads and writes"| node_alertrecords
node_alerts -->|"uses sessions"| node_database
node_candidate -->|"submits manually or CSV"| node_alerts
node_apple -->|"returns search results"| node_appcollector
node_brandrecords -->|"stored in"| node_database
node_alertrecords -->|"stored in"| node_database
node_scanrecords -->|"stored in"| node_database

click node_webapp "https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/frontend/src/App.tsx"
click node_brandui "https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/frontend/src/pages/BrandProfilesView.tsx"
click node_setupui "https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/frontend/src/pages/BrandSetupWizard.tsx"
click node_socialui "https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/frontend/src/pages/SocialMonitoringView.tsx"
click node_appsui "https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/frontend/src/pages/AppMonitoringView.tsx"
click node_historyui "https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/frontend/src/pages/ScanHistoryView.tsx"
click node_threatui "https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/frontend/src/pages/ThreatDetailsView.tsx"
click node_overviewui "https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/frontend/src/pages/OverviewView.tsx"
click node_authui "https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/frontend/src/pages/AuthPage.tsx"
click node_apiclient "https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/frontend/src/services/api.ts"
click node_server "https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/main.py"
click node_auth "https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/api/auth.py"
click node_brands "https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/api/brands.py"
click node_scans "https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/api/scans.py"
click node_alerts "https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/api/alerts.py"
click node_socialcollector "https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/collectors/social_collector.py"
click node_appcollector "https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/collectors/app_collector.py"
click node_exclusion "https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/core/exclusion.py"
click node_scoring "https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/core/scoring.py"
click node_findings "https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/core/findings.py"
click node_database "https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/database.py"
click node_brandrecords "https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/models/brand.py"
click node_alertrecords "https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/models/alert.py"
click node_scanrecords "https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/models/scan.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_webapp,node_brandui,node_setupui,node_socialui,node_appsui,node_historyui,node_threatui,node_overviewui,node_authui,node_apiclient,node_user toneBlue
class node_server,node_auth,node_brands,node_scans,node_alerts toneAmber
class node_socialcollector,node_appcollector,node_exclusion,node_scoring,node_findings,node_apple toneMint
class node_database,node_brandrecords,node_alertrecords,node_scanrecords toneRose
class node_candidate toneIndigo
```

## Components

### Web application

- [Rakshak UI](https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Brand profiles](https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/frontend/src/pages/BrandProfilesView.tsx): `frontend/src/pages/BrandProfilesView.tsx`
- [Brand setup](https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/frontend/src/pages/BrandSetupWizard.tsx): `frontend/src/pages/BrandSetupWizard.tsx`
- [Social monitoring](https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/frontend/src/pages/SocialMonitoringView.tsx): `frontend/src/pages/SocialMonitoringView.tsx`
- [App monitoring](https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/frontend/src/pages/AppMonitoringView.tsx): `frontend/src/pages/AppMonitoringView.tsx`
- [Scan history](https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/frontend/src/pages/ScanHistoryView.tsx): `frontend/src/pages/ScanHistoryView.tsx`
- [Threat investigation](https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/frontend/src/pages/ThreatDetailsView.tsx): `frontend/src/pages/ThreatDetailsView.tsx`
- [Overview dashboard](https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/frontend/src/pages/OverviewView.tsx): `frontend/src/pages/OverviewView.tsx`
- [Sign in and register](https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/frontend/src/pages/AuthPage.tsx): `frontend/src/pages/AuthPage.tsx`
- [API client](https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`

### API and identity

- [FastAPI application](https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/main.py): `backend/app/main.py`
- [Authentication](https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/api/auth.py): `backend/app/api/auth.py`
- [Brand management](https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/api/brands.py): `backend/app/api/brands.py`
- [Scan orchestration](https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/api/scans.py): `backend/app/api/scans.py`
- [Findings and investigation](https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/api/alerts.py): `backend/app/api/alerts.py`

### Candidate analysis

- [Social candidates](https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/collectors/social_collector.py): `backend/app/collectors/social_collector.py`
- [App Store candidates](https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/collectors/app_collector.py): `backend/app/collectors/app_collector.py`
- [Official asset exclusion](https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/core/exclusion.py): `backend/app/core/exclusion.py`
- [Risk scoring](https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/core/scoring.py): `backend/app/core/scoring.py`
- [Finding construction](https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/core/findings.py): `backend/app/core/findings.py`

### Brand and findings data

- [Relational database](https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/database.py): `backend/app/database.py`
- [Brand and asset records](https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/models/brand.py): `backend/app/models/brand.py`
- [Alert records](https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/models/alert.py): `backend/app/models/alert.py`
- [Scan records](https://github.com/abhisheksum/rakshak-digital-brand-protection/blob/main/backend/app/models/scan.py): `backend/app/models/scan.py`

### Other components

- **Organisation user**
- **Apple Search API**
- **Submitted candidates**

## Connections

- Organisation user → Rakshak UI: uses
- Rakshak UI → Brand profiles: shows (evidence: `frontend/src/App.tsx`)
- Rakshak UI → Brand setup: shows (evidence: `frontend/src/App.tsx`)
- Rakshak UI → Social monitoring: shows (evidence: `frontend/src/App.tsx`)
- Rakshak UI → App monitoring: shows (evidence: `frontend/src/App.tsx`)
- Rakshak UI → Scan history: shows (evidence: `frontend/src/App.tsx`)
- Rakshak UI → Threat investigation: shows (evidence: `frontend/src/App.tsx`)
- Rakshak UI → Overview dashboard: shows (evidence: `frontend/src/App.tsx`)
- Rakshak UI → Sign in and register: shows (evidence: `frontend/src/App.tsx`)
- Rakshak UI → API client: requests data (evidence: `frontend/src/App.tsx`)
- Sign in and register → API client: authenticates (evidence: `frontend/src/pages/AuthPage.tsx`)
- API client → FastAPI application: calls API
- FastAPI application → Authentication: mounts (evidence: `backend/app/main.py`)
- FastAPI application → Brand management: mounts (evidence: `backend/app/main.py`)
- FastAPI application → Scan orchestration: mounts (evidence: `backend/app/main.py`)
- FastAPI application → Findings and investigation: mounts (evidence: `backend/app/main.py`)
- Brand management → Brand and asset records: reads and writes (evidence: `backend/app/api/brands.py`)
- Brand management → Relational database: uses sessions (evidence: `backend/app/api/brands.py`)
- Authentication → Relational database: uses sessions (evidence: `backend/app/api/auth.py`)
- Authentication → Organisation user: persists accounts (evidence: `backend/app/api/auth.py`)
- Scan orchestration → Social candidates: collects candidates (evidence: `backend/app/api/scans.py`)
- Scan orchestration → App Store candidates: collects candidates (evidence: `backend/app/api/scans.py`)
- Scan orchestration → Official asset exclusion: excludes assets (evidence: `backend/app/api/scans.py`)
- Scan orchestration → Risk scoring: scores candidates (evidence: `backend/app/api/scans.py`)
- Scan orchestration → Finding construction: builds findings (evidence: `backend/app/api/scans.py`)
- Scan orchestration → Relational database: uses sessions (evidence: `backend/app/api/scans.py`)
- Scan orchestration → Scan records: persists scans (evidence: `backend/app/api/scans.py`)
- Scan orchestration → Alert records: persists alerts (evidence: `backend/app/api/scans.py`)
- Findings and investigation → Risk scoring: scores submissions (evidence: `backend/app/api/alerts.py`)
- Findings and investigation → Official asset exclusion: checks official assets (evidence: `backend/app/api/alerts.py`)
- Findings and investigation → Alert records: reads and writes (evidence: `backend/app/api/alerts.py`)
- Findings and investigation → Relational database: uses sessions (evidence: `backend/app/api/alerts.py`)
- Submitted candidates → Findings and investigation: submits manually or CSV
- Apple Search API → App Store candidates: returns search results
- Brand and asset records → Relational database: stored in (evidence: `backend/app/models/brand.py`)
- Alert records → Relational database: stored in (evidence: `backend/app/models/alert.py`)
- Scan records → Relational database: stored in (evidence: `backend/app/api/scans.py`)
