# codeplus076-max/sss-image architecture

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

- Interactive diagram: https://gitdiagram.com/codeplus076-max/sss-image
- Repository: https://github.com/codeplus076-max/sss-image

## Overview

SIH26057 is a side-scan sonar marine-intelligence workstation: analysts submit sonar imagery, review quality and anomaly results, anchor surveys geographically, and produce operational reports. The documented backend flow validates acoustic imagery, runs registered detectors, normalizes and prioritizes detections, then persists analysis records and evidence. The frontend also supports batch triage, survey history, GIS review, model and health information, and report export. Edges reflect README workflow statements or SOURCE INDEX references; analysis-route internals and several frontend view behaviors were not sampled, so those links are documented or omitted rather than inferred.

Main entry points: [`frontend/src/App.jsx`](https://github.com/codeplus076-max/sss-image/blob/main/frontend/src/App.jsx) (Application Shell), [`backend/app/api/v1/routes/analysis.py`](https://github.com/codeplus076-max/sss-image/blob/main/backend/app/api/v1/routes/analysis.py) (Analysis API), [`backend/app/services/analysis_service.py`](https://github.com/codeplus076-max/sss-image/blob/main/backend/app/services/analysis_service.py) (Survey Analysis), [`frontend/src/services/api.js`](https://github.com/codeplus076-max/sss-image/blob/main/frontend/src/services/api.js) (API Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Analyst Workstation"]
  node_app["Application Shell<br/>[App.jsx]"]
  node_ingest["Image Ingest"]
  node_quality_view["Quality Review"]
  node_batch["Batch Triage"]
  node_detections["Detection Review<br/>[DetectionsView.jsx]"]
  node_workspace["Survey Workspace<br/>[WorkspaceView.jsx]"]
  node_gis["Marine GIS Map<br/>[MarineGisMap.jsx]"]
  node_report["Survey Reports<br/>[ReportView.jsx]"]
  node_report_data["Report Builders<br/>[reportData.js]"]
  node_api_client["API Client<br/>[api.js]"]
end

subgraph group_analysis["Analysis Pipeline"]
  node_analysis_service["Survey Analysis"]
  node_validator["Sonar Quality Gate"]
  node_preprocessing["Image Preprocessing"]
  node_normalizer["Detection Normalizer"]
end

subgraph group_models["Model Execution"]
  node_registry["Model Registry<br/>[model_registry.py]"]
  node_inference["Multi-Model Inference<br/>[inference.py]"]
  node_model_loader["Model Loader<br/>[model_loader.py]"]
end

subgraph group_persistence["Evidence &amp; Records"]
  node_persistence_service["Analysis Persistence"]
  node_storage["Evidence Storage<br/>[storage_service.py]"]
  node_repository["Analysis Repository"]
  node_database[("SQL Database<br/>[session.py]")]
end

subgraph group_platform["API Platform"]
  node_analysis_api["Analysis API<br/>[analysis.py]"]
  node_health_api["Health Endpoint<br/>[health.py]"]
  node_models_api["Models Endpoint<br/>[models.py]"]
  node_backend_app["FastAPI Application<br/>[main.py]"]
end

node_analyst(("Sonar Analyst"))
node_external_storage[("Supabase Storage")]

node_analyst -->|"uses"| node_app
node_app -->|"renders"| node_ingest
node_app -->|"renders"| node_quality_view
node_app -->|"renders"| node_batch
node_app -->|"renders"| node_detections
node_app -->|"renders"| node_workspace
node_app -->|"renders"| node_report
node_workspace -->|"renders"| node_gis
node_report -->|"uses"| node_report_data
node_app -->|"calls"| node_api_client
node_ingest -.->|"submits imagery"| node_api_client
node_api_client -->|"requests analysis"| node_analysis_api
node_analysis_api -->|"validates imagery"| node_validator
node_analysis_api -.->|"runs analysis"| node_analysis_service
node_analysis_service -->|"preprocesses"| node_preprocessing
node_analysis_service -->|"executes models"| node_inference
node_analysis_service -->|"normalizes detections"| node_normalizer
node_analysis_service -->|"resolves models"| node_registry
node_inference -->|"loads models"| node_model_loader
node_model_loader -->|"reads definitions"| node_registry
node_analysis_api -.->|"persists results"| node_persistence_service
node_persistence_service -->|"stores evidence"| node_storage
node_persistence_service -->|"saves records"| node_repository
node_repository -->|"writes records"| node_database
node_storage -.->|"uploads optionally"| node_external_storage
node_backend_app -->|"registers routes"| node_analysis_api
node_backend_app -->|"registers routes"| node_health_api
node_backend_app -->|"registers routes"| node_models_api
node_api_client -.->|"checks health"| node_health_api
node_api_client -.->|"lists models"| node_models_api
node_analysis_api -.->|"returns results"| node_detections
node_analysis_api -.->|"serves survey history"| node_workspace

click node_app "https://github.com/codeplus076-max/sss-image/blob/main/frontend/src/App.jsx"
click node_ingest "https://github.com/codeplus076-max/sss-image/blob/main/frontend/src/components/views/SonarIngestView.jsx"
click node_quality_view "https://github.com/codeplus076-max/sss-image/blob/main/frontend/src/components/views/SonarQualityView.jsx"
click node_batch "https://github.com/codeplus076-max/sss-image/blob/main/frontend/src/components/views/BatchTriageView.jsx"
click node_detections "https://github.com/codeplus076-max/sss-image/blob/main/frontend/src/components/views/DetectionsView.jsx"
click node_workspace "https://github.com/codeplus076-max/sss-image/blob/main/frontend/src/components/views/WorkspaceView.jsx"
click node_gis "https://github.com/codeplus076-max/sss-image/blob/main/frontend/src/components/gis/MarineGisMap.jsx"
click node_report "https://github.com/codeplus076-max/sss-image/blob/main/frontend/src/components/views/ReportView.jsx"
click node_report_data "https://github.com/codeplus076-max/sss-image/blob/main/frontend/src/data/reportData.js"
click node_api_client "https://github.com/codeplus076-max/sss-image/blob/main/frontend/src/services/api.js"
click node_analysis_api "https://github.com/codeplus076-max/sss-image/blob/main/backend/app/api/v1/routes/analysis.py"
click node_health_api "https://github.com/codeplus076-max/sss-image/blob/main/backend/app/api/v1/routes/health.py"
click node_models_api "https://github.com/codeplus076-max/sss-image/blob/main/backend/app/api/v1/routes/models.py"
click node_analysis_service "https://github.com/codeplus076-max/sss-image/blob/main/backend/app/services/analysis_service.py"
click node_validator "https://github.com/codeplus076-max/sss-image/blob/main/backend/app/services/sonar_image_validator.py"
click node_preprocessing "https://github.com/codeplus076-max/sss-image/blob/main/backend/app/services/preprocessing_service.py"
click node_normalizer "https://github.com/codeplus076-max/sss-image/blob/main/backend/app/services/detection_normalizer.py"
click node_registry "https://github.com/codeplus076-max/sss-image/blob/main/backend/app/core/model_registry.py"
click node_inference "https://github.com/codeplus076-max/sss-image/blob/main/backend/app/services/inference.py"
click node_model_loader "https://github.com/codeplus076-max/sss-image/blob/main/backend/app/services/model_loader.py"
click node_persistence_service "https://github.com/codeplus076-max/sss-image/blob/main/backend/app/services/analysis_persistence_service.py"
click node_storage "https://github.com/codeplus076-max/sss-image/blob/main/backend/app/services/storage_service.py"
click node_repository "https://github.com/codeplus076-max/sss-image/blob/main/backend/app/repositories/analysis_repository.py"
click node_database "https://github.com/codeplus076-max/sss-image/blob/main/backend/app/db/session.py"
click node_backend_app "https://github.com/codeplus076-max/sss-image/blob/main/backend/app/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_app,node_ingest,node_quality_view,node_batch,node_detections,node_workspace,node_gis,node_report,node_report_data,node_api_client toneBlue
class node_analysis_service,node_validator,node_preprocessing,node_normalizer,node_external_storage toneAmber
class node_registry,node_inference,node_model_loader toneMint
class node_persistence_service,node_storage,node_repository,node_database toneRose
class node_analysis_api,node_health_api,node_models_api,node_backend_app,node_analyst toneIndigo
```

## Components

### Analyst Workstation

- [Application Shell](https://github.com/codeplus076-max/sss-image/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Image Ingest](https://github.com/codeplus076-max/sss-image/blob/main/frontend/src/components/views/SonarIngestView.jsx): `frontend/src/components/views/SonarIngestView.jsx`
- [Quality Review](https://github.com/codeplus076-max/sss-image/blob/main/frontend/src/components/views/SonarQualityView.jsx): `frontend/src/components/views/SonarQualityView.jsx`
- [Batch Triage](https://github.com/codeplus076-max/sss-image/blob/main/frontend/src/components/views/BatchTriageView.jsx): `frontend/src/components/views/BatchTriageView.jsx`
- [Detection Review](https://github.com/codeplus076-max/sss-image/blob/main/frontend/src/components/views/DetectionsView.jsx): `frontend/src/components/views/DetectionsView.jsx`
- [Survey Workspace](https://github.com/codeplus076-max/sss-image/blob/main/frontend/src/components/views/WorkspaceView.jsx): `frontend/src/components/views/WorkspaceView.jsx`
- [Marine GIS Map](https://github.com/codeplus076-max/sss-image/blob/main/frontend/src/components/gis/MarineGisMap.jsx): `frontend/src/components/gis/MarineGisMap.jsx`
- [Survey Reports](https://github.com/codeplus076-max/sss-image/blob/main/frontend/src/components/views/ReportView.jsx): `frontend/src/components/views/ReportView.jsx`
- [Report Builders](https://github.com/codeplus076-max/sss-image/blob/main/frontend/src/data/reportData.js): `frontend/src/data/reportData.js`
- [API Client](https://github.com/codeplus076-max/sss-image/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### Analysis Pipeline

- [Survey Analysis](https://github.com/codeplus076-max/sss-image/blob/main/backend/app/services/analysis_service.py): `backend/app/services/analysis_service.py`
- [Sonar Quality Gate](https://github.com/codeplus076-max/sss-image/blob/main/backend/app/services/sonar_image_validator.py): `backend/app/services/sonar_image_validator.py`
- [Image Preprocessing](https://github.com/codeplus076-max/sss-image/blob/main/backend/app/services/preprocessing_service.py): `backend/app/services/preprocessing_service.py`
- [Detection Normalizer](https://github.com/codeplus076-max/sss-image/blob/main/backend/app/services/detection_normalizer.py): `backend/app/services/detection_normalizer.py`

### Model Execution

- [Model Registry](https://github.com/codeplus076-max/sss-image/blob/main/backend/app/core/model_registry.py): `backend/app/core/model_registry.py`
- [Multi-Model Inference](https://github.com/codeplus076-max/sss-image/blob/main/backend/app/services/inference.py): `backend/app/services/inference.py`
- [Model Loader](https://github.com/codeplus076-max/sss-image/blob/main/backend/app/services/model_loader.py): `backend/app/services/model_loader.py`

### Evidence & Records

- [Analysis Persistence](https://github.com/codeplus076-max/sss-image/blob/main/backend/app/services/analysis_persistence_service.py): `backend/app/services/analysis_persistence_service.py`
- [Evidence Storage](https://github.com/codeplus076-max/sss-image/blob/main/backend/app/services/storage_service.py): `backend/app/services/storage_service.py`
- [Analysis Repository](https://github.com/codeplus076-max/sss-image/blob/main/backend/app/repositories/analysis_repository.py): `backend/app/repositories/analysis_repository.py`
- [SQL Database](https://github.com/codeplus076-max/sss-image/blob/main/backend/app/db/session.py): `backend/app/db/session.py`

### API Platform

- [Analysis API](https://github.com/codeplus076-max/sss-image/blob/main/backend/app/api/v1/routes/analysis.py): `backend/app/api/v1/routes/analysis.py`
- [Health Endpoint](https://github.com/codeplus076-max/sss-image/blob/main/backend/app/api/v1/routes/health.py): `backend/app/api/v1/routes/health.py`
- [Models Endpoint](https://github.com/codeplus076-max/sss-image/blob/main/backend/app/api/v1/routes/models.py): `backend/app/api/v1/routes/models.py`
- [FastAPI Application](https://github.com/codeplus076-max/sss-image/blob/main/backend/app/main.py): `backend/app/main.py`

### Other components

- **Sonar Analyst**
- **Supabase Storage**

## Connections

- Sonar Analyst → Application Shell: uses
- Application Shell → Image Ingest: renders (evidence: `frontend/src/App.jsx`)
- Application Shell → Quality Review: renders (evidence: `frontend/src/App.jsx`)
- Application Shell → Batch Triage: renders (evidence: `frontend/src/App.jsx`)
- Application Shell → Detection Review: renders (evidence: `frontend/src/App.jsx`)
- Application Shell → Survey Workspace: renders (evidence: `frontend/src/App.jsx`)
- Application Shell → Survey Reports: renders (evidence: `frontend/src/App.jsx`)
- Survey Workspace → Marine GIS Map: renders (evidence: `frontend/src/components/views/WorkspaceView.jsx`)
- Survey Reports → Report Builders: uses (evidence: `frontend/src/components/views/ReportView.jsx`)
- Application Shell → API Client: calls (evidence: `frontend/src/App.jsx`)
- Image Ingest → API Client: submits imagery
- API Client → Analysis API: requests analysis (evidence: `README.md`)
- Analysis API → Sonar Quality Gate: validates imagery (evidence: `README.md`)
- Analysis API → Survey Analysis: runs analysis
- Survey Analysis → Image Preprocessing: preprocesses (evidence: `backend/app/services/analysis_service.py`)
- Survey Analysis → Multi-Model Inference: executes models (evidence: `backend/app/services/analysis_service.py`)
- Survey Analysis → Detection Normalizer: normalizes detections (evidence: `README.md`)
- Survey Analysis → Model Registry: resolves models (evidence: `backend/app/services/analysis_service.py`)
- Multi-Model Inference → Model Loader: loads models (evidence: `backend/app/services/inference.py`)
- Model Loader → Model Registry: reads definitions (evidence: `backend/app/services/model_loader.py`)
- Analysis API → Analysis Persistence: persists results
- Analysis Persistence → Evidence Storage: stores evidence (evidence: `backend/app/services/analysis_persistence_service.py`)
- Analysis Persistence → Analysis Repository: saves records (evidence: `backend/app/services/analysis_persistence_service.py`)
- Analysis Repository → SQL Database: writes records (evidence: `backend/app/repositories/analysis_repository.py`)
- Evidence Storage → Supabase Storage: uploads optionally (evidence: `backend/app/services/storage_service.py`)
- FastAPI Application → Analysis API: registers routes (evidence: `backend/app/main.py`)
- FastAPI Application → Health Endpoint: registers routes
- FastAPI Application → Models Endpoint: registers routes
- API Client → Health Endpoint: checks health
- API Client → Models Endpoint: lists models
- Analysis API → Detection Review: returns results
- Analysis API → Survey Workspace: serves survey history
