# meet8141/signalscope architecture

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

- Interactive diagram: https://gitdiagram.com/meet8141/signalscope
- Repository: https://github.com/meet8141/signalscope

## Overview

SignalScope accepts an uploaded image through its web interface and FastAPI API, then returns AI-versus-real classification, provenance and metadata checks, pixel-forensic signals, a trust score, and—when available—a Grad-CAM heatmap. The documented pipeline includes gated handling of decisive provenance signals and parallel forensic analysis. The sampled backend excerpt shows the API coordinating C2PA, metadata, forensics, model prediction, trust scoring, and static artifacts; implementation details for those subsystems and the frontend are not included in the excerpts, so internal wiring is shown only where documented or directly visible.

Main entry points: [`backend/main.py`](https://github.com/meet8141/signalscope/blob/main/backend/main.py) (FastAPI endpoints), [`frontend/src`](https://github.com/meet8141/signalscope/tree/main/frontend/src) (React interface), [`backend`](https://github.com/meet8141/signalscope/tree/main/backend) (MobileNetV2 classifier), [`backend/static`](https://github.com/meet8141/signalscope/tree/main/backend/static) (Image and heatmap files)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_frontend["React interface"]
end

subgraph group_api["API orchestration"]
  node_api_service["FastAPI endpoints<br/>[main.py]"]
  node_upload["Temporary upload handling<br/>[main.py]"]
  node_trust["Trust score<br/>[main.py]"]
end

subgraph group_analysis["Image analysis"]
  node_c2pa["C2PA verification"]
  node_metadata["EXIF metadata"]
  node_forensics["Pixel forensics"]
  node_classifier["MobileNetV2 classifier"]
  node_gradcam["Grad-CAM explanation"]
end

subgraph group_artifacts["Results and artifacts"]
  node_static_files["Image and heatmap files"]
  node_result["Verification response<br/>[main.py]"]
end

node_user(("Image submitter"))

node_user -->|"submits image"| node_frontend
node_frontend -->|"requests verification"| node_api_service
node_api_service -->|"handles upload"| node_upload
node_api_service -->|"verifies manifest"| node_c2pa
node_api_service -->|"extracts metadata"| node_metadata
node_api_service -->|"runs analyses"| node_forensics
node_api_service -->|"predicts class"| node_classifier
node_classifier -->|"generates explanation"| node_gradcam
node_api_service -->|"calculates score"| node_trust
node_api_service -->|"saves image and heatmap"| node_static_files
node_api_service -->|"assembles response"| node_result
node_result -->|"returns results"| node_frontend
node_static_files -->|"serves artifacts"| node_frontend

click node_frontend "https://github.com/meet8141/signalscope/tree/main/frontend/src"
click node_api_service "https://github.com/meet8141/signalscope/blob/main/backend/main.py"
click node_upload "https://github.com/meet8141/signalscope/blob/main/backend/main.py"
click node_trust "https://github.com/meet8141/signalscope/blob/main/backend/main.py"
click node_c2pa "https://github.com/meet8141/signalscope/tree/main/backend/C2PA"
click node_metadata "https://github.com/meet8141/signalscope/tree/main/backend/METADATA"
click node_forensics "https://github.com/meet8141/signalscope/tree/main/backend/FORENSIC"
click node_classifier "https://github.com/meet8141/signalscope/tree/main/backend"
click node_gradcam "https://github.com/meet8141/signalscope/tree/main/backend"
click node_static_files "https://github.com/meet8141/signalscope/tree/main/backend/static"
click node_result "https://github.com/meet8141/signalscope/blob/main/backend/main.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_frontend toneBlue
class node_api_service,node_upload,node_trust toneAmber
class node_c2pa,node_metadata,node_forensics,node_classifier,node_gradcam toneMint
class node_static_files,node_result toneRose
class node_user toneIndigo
```

## Components

### Web client

- [React interface](https://github.com/meet8141/signalscope/tree/main/frontend/src): `frontend/src`

### API orchestration

- [FastAPI endpoints](https://github.com/meet8141/signalscope/blob/main/backend/main.py): `backend/main.py`
- [Temporary upload handling](https://github.com/meet8141/signalscope/blob/main/backend/main.py): `backend/main.py`
- [Trust score](https://github.com/meet8141/signalscope/blob/main/backend/main.py): `backend/main.py`

### Image analysis

- [C2PA verification](https://github.com/meet8141/signalscope/tree/main/backend/C2PA): `backend/C2PA`
- [EXIF metadata](https://github.com/meet8141/signalscope/tree/main/backend/METADATA): `backend/METADATA`
- [Pixel forensics](https://github.com/meet8141/signalscope/tree/main/backend/FORENSIC): `backend/FORENSIC`
- [MobileNetV2 classifier](https://github.com/meet8141/signalscope/tree/main/backend): `backend`
- [Grad-CAM explanation](https://github.com/meet8141/signalscope/tree/main/backend): `backend`

### Results and artifacts

- [Image and heatmap files](https://github.com/meet8141/signalscope/tree/main/backend/static): `backend/static`
- [Verification response](https://github.com/meet8141/signalscope/blob/main/backend/main.py): `backend/main.py`

### Other components

- **Image submitter**

## Connections

- Image submitter → React interface: submits image
- React interface → FastAPI endpoints: requests verification
- FastAPI endpoints → Temporary upload handling: handles upload
- FastAPI endpoints → C2PA verification: verifies manifest
- FastAPI endpoints → EXIF metadata: extracts metadata
- FastAPI endpoints → Pixel forensics: runs analyses
- FastAPI endpoints → MobileNetV2 classifier: predicts class
- MobileNetV2 classifier → Grad-CAM explanation: generates explanation
- FastAPI endpoints → Trust score: calculates score
- FastAPI endpoints → Image and heatmap files: saves image and heatmap
- FastAPI endpoints → Verification response: assembles response
- Verification response → React interface: returns results
- Image and heatmap files → React interface: serves artifacts
