# reaalsatyam/whistleblower architecture

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

- Interactive diagram: https://gitdiagram.com/reaalsatyam/whistleblower
- Repository: https://github.com/reaalsatyam/whistleblower

## Overview

WhistleBlower collects reports through web and Android clients, supports administrative review and status tracking, and provides an image/video AI analysis service. A separate backend route module implements IPFS upload and blockchain verification. The README also describes audio detection, but the sampled service has audio dispatch commented out; model and Android wiring is not fully evidenced here, so uncertain connections are omitted. The web report store is local JSON and uploaded files, not the relational database described as a scalability consideration.

Main entry points: [`WebApp/backend/server.js`](https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/backend/server.js) (Report API), [`WebApp/frontend/src/components/AdminDashboard.jsx`](https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/frontend/src/components/AdminDashboard.jsx) (Admin dashboard), [`WebApp/evidence_service/app.py`](https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/evidence_service/app.py) (Evidence AI API), [`WebApp/backend/routes.js`](https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/backend/routes.js) (Evidence routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web reporting"]
  node_webform["Report form<br/>[ReportForm.jsx]"]
  node_webserver["Report API<br/>[server.js]"]
  node_reportstore[("Local report store<br/>[server.js]")]
end

subgraph group_review["Review and tracking"]
  node_adminui["Admin dashboard<br/>[AdminDashboard.jsx]"]
  node_statusui["Status lookup<br/>[Status.jsx]"]
  node_adminlogin["Admin login<br/>[AdminLogin.jsx]"]
  node_aiui["AI review controls<br/>[AdminDashboard.jsx]"]
end

subgraph group_ai["Evidence analysis"]
  node_evidenceapi["Evidence AI API<br/>[app.py]"]
  node_imagedetector["Image detector<br/>[image_detector.py]"]
  node_videodetector["Video detector<br/>[video_detector.py]"]
  node_audiodetector["Audio detector<br/>[audio_detector.py]"]
end

subgraph group_decentralized["Decentralized logging"]
  node_routeapi["Evidence routes<br/>[routes.js]"]
  node_ipfshelper["IPFS uploader<br/>[ipfs.js]"]
  node_chainhelper["Chain access<br/>[blockchain.js]"]
  node_contract["Registry contract<br/>[Whistleblower.sol]"]
end

subgraph group_mobile["Android client"]
  node_mobilemain["Mobile app<br/>[MainActivity.java]"]
  node_mobileapi["Mobile API clients"]
  node_mobileadmin["Mobile administration"]
end

node_reporter(("Report submitter"))
node_admin(("Administrator"))
node_ipfs[("IPFS network")]
node_evm[("EVM network")]

node_reporter -->|"submits to"| node_webform
node_webform -->|"posts report"| node_webserver
node_webserver -->|"persists reports"| node_reportstore
node_admin -->|"reviews reports"| node_adminui
node_adminui -->|"loads reports"| node_webserver
node_adminui -->|"updates status"| node_webserver
node_reporter -->|"checks status"| node_statusui
node_statusui -->|"requests status"| node_webserver
node_adminui -->|"fetches evidence"| node_webserver
node_adminui -->|"starts analysis"| node_aiui
node_aiui -->|"posts media"| node_evidenceapi
node_evidenceapi -->|"dispatches images"| node_imagedetector
node_evidenceapi -->|"dispatches videos"| node_videodetector
node_routeapi -->|"uploads file"| node_ipfshelper
node_routeapi -->|"records hash"| node_chainhelper
node_ipfshelper -->|"stores evidence"| node_ipfs
node_chainhelper -->|"calls registry"| node_evm
node_evm -->|"executes"| node_contract

click node_webform "https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/frontend/src/components/ReportForm.jsx"
click node_webserver "https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/backend/server.js"
click node_reportstore "https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/backend/server.js"
click node_adminui "https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/frontend/src/components/AdminDashboard.jsx"
click node_statusui "https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/frontend/src/pages/Status.jsx"
click node_adminlogin "https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/frontend/src/components/AdminLogin.jsx"
click node_aiui "https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/frontend/src/components/AdminDashboard.jsx"
click node_evidenceapi "https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/evidence_service/app.py"
click node_imagedetector "https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/evidence_service/models/image_detector.py"
click node_videodetector "https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/evidence_service/models/video_detector.py"
click node_audiodetector "https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/evidence_service/models/audio_detector.py"
click node_routeapi "https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/backend/routes.js"
click node_ipfshelper "https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/backend/ipfs.js"
click node_chainhelper "https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/backend/blockchain.js"
click node_contract "https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/backend/contracts/Whistleblower.sol"
click node_mobilemain "https://github.com/reaalsatyam/whistleblower/blob/main/AndroidApp/app/src/main/java/com/example/whistleblower/MainActivity.java"
click node_mobileapi "https://github.com/reaalsatyam/whistleblower/tree/main/AndroidApp/app/src/main/java/com/example/whistleblower/api"
click node_mobileadmin "https://github.com/reaalsatyam/whistleblower/blob/main/AndroidApp/app/src/main/java/com/example/whistleblower/AdminDashboardActivity.java"

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_webform,node_webserver,node_reportstore toneBlue
class node_adminui,node_statusui,node_adminlogin,node_aiui,node_ipfs,node_evm toneAmber
class node_evidenceapi,node_imagedetector,node_videodetector,node_audiodetector toneMint
class node_routeapi,node_ipfshelper,node_chainhelper,node_contract toneRose
class node_mobilemain,node_mobileapi,node_mobileadmin,node_reporter,node_admin toneIndigo
```

## Components

### Web reporting

- [Report form](https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/frontend/src/components/ReportForm.jsx): `WebApp/frontend/src/components/ReportForm.jsx`
- [Report API](https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/backend/server.js): `WebApp/backend/server.js`
- [Local report store](https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/backend/server.js): `WebApp/backend/server.js`

### Review and tracking

- [Admin dashboard](https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/frontend/src/components/AdminDashboard.jsx): `WebApp/frontend/src/components/AdminDashboard.jsx`
- [Status lookup](https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/frontend/src/pages/Status.jsx): `WebApp/frontend/src/pages/Status.jsx`
- [Admin login](https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/frontend/src/components/AdminLogin.jsx): `WebApp/frontend/src/components/AdminLogin.jsx`
- [AI review controls](https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/frontend/src/components/AdminDashboard.jsx): `WebApp/frontend/src/components/AdminDashboard.jsx`

### Evidence analysis

- [Evidence AI API](https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/evidence_service/app.py): `WebApp/evidence_service/app.py`
- [Image detector](https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/evidence_service/models/image_detector.py): `WebApp/evidence_service/models/image_detector.py`
- [Video detector](https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/evidence_service/models/video_detector.py): `WebApp/evidence_service/models/video_detector.py`
- [Audio detector](https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/evidence_service/models/audio_detector.py): `WebApp/evidence_service/models/audio_detector.py`

### Decentralized logging

- [Evidence routes](https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/backend/routes.js): `WebApp/backend/routes.js`
- [IPFS uploader](https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/backend/ipfs.js): `WebApp/backend/ipfs.js`
- [Chain access](https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/backend/blockchain.js): `WebApp/backend/blockchain.js`
- [Registry contract](https://github.com/reaalsatyam/whistleblower/blob/main/WebApp/backend/contracts/Whistleblower.sol): `WebApp/backend/contracts/Whistleblower.sol`

### Android client

- [Mobile app](https://github.com/reaalsatyam/whistleblower/blob/main/AndroidApp/app/src/main/java/com/example/whistleblower/MainActivity.java): `AndroidApp/app/src/main/java/com/example/whistleblower/MainActivity.java`
- [Mobile API clients](https://github.com/reaalsatyam/whistleblower/tree/main/AndroidApp/app/src/main/java/com/example/whistleblower/api): `AndroidApp/app/src/main/java/com/example/whistleblower/api`
- [Mobile administration](https://github.com/reaalsatyam/whistleblower/blob/main/AndroidApp/app/src/main/java/com/example/whistleblower/AdminDashboardActivity.java): `AndroidApp/app/src/main/java/com/example/whistleblower/AdminDashboardActivity.java`

### Other components

- **Report submitter**
- **Administrator**
- **IPFS network**
- **EVM network**

## Connections

- Report submitter → Report form: submits to
- Report form → Report API: posts report
- Report API → Local report store: persists reports
- Administrator → Admin dashboard: reviews reports
- Admin dashboard → Report API: loads reports
- Admin dashboard → Report API: updates status
- Report submitter → Status lookup: checks status
- Status lookup → Report API: requests status
- Admin dashboard → Report API: fetches evidence
- Admin dashboard → AI review controls: starts analysis
- AI review controls → Evidence AI API: posts media
- Evidence AI API → Image detector: dispatches images
- Evidence AI API → Video detector: dispatches videos
- Evidence routes → IPFS uploader: uploads file
- Evidence routes → Chain access: records hash
- IPFS uploader → IPFS network: stores evidence
- Chain access → EVM network: calls registry
- EVM network → Registry contract: executes
