# anand-jatothu/marinevisionai architecture

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

- Interactive diagram: https://gitdiagram.com/anand-jatothu/marinevisionai
- Repository: https://github.com/anand-jatothu/marinevisionai

## Overview

MarineVision is an underwater survey and debris-detection UI with a FastAPI service. The visible workflow is operator upload or simulation, API-side image analysis, detections returned to app state, then map/list review and report export. The inference engine currently reports mock/incomplete processing, and the database helper defines mission and detection storage but is not shown wired into the API. Major screens and backend routes are represented; unsampled training and edge-support areas are included as documented tree branches without guessed runtime links.

Main entry points: [`marine_vision/frontend/src/App.jsx`](https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/frontend/src/App.jsx) (Console State), [`marine_vision/frontend/src/components/Navbar.jsx`](https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/frontend/src/components/Navbar.jsx) (Mission Controls), [`marine_vision/backend/api/main.py`](https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/backend/api/main.py) (FastAPI Routes), [`marine_vision/frontend/src/components/LeafletMap.jsx`](https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/frontend/src/components/LeafletMap.jsx) (Target Map)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Survey Console"]
  node_app["Console State<br/>[App.jsx]"]
  node_nav["Mission Controls<br/>[Navbar.jsx]"]
  node_sidebar["Telemetry Panel<br/>[Sidebar.jsx]"]
  node_waterfall["Sonar Display"]
  node_map["Target Map<br/>[LeafletMap.jsx]"]
  node_drawer["Detection Review"]
  node_settings["System Settings<br/>[SettingsModal.jsx]"]
  node_status["Status Footer<br/>[StatusFooter.jsx]"]
end

subgraph group_backend["API and Analysis"]
  node_api["FastAPI Routes<br/>[main.py]"]
  node_inference["Sonar Inference<br/>[inference.py]"]
end

subgraph group_persistence["Mission Storage"]
  node_sqlite[("Mission Database<br/>[database.py]")]
end

subgraph group_ml["Model Lifecycle"]
  node_training["Model Training<br/>[train.py]"]
  node_export["ONNX Export<br/>[export_onnx.py]"]
end

subgraph group_edge["Edge Inputs"]
  node_edge["Sensor Interfaces"]
  node_samples["Edge Data Tools"]
end

node_operator(("Survey Operator"))
node_tiles["External Map Tiles"]

node_operator -->|"operates"| node_nav
node_app -->|"renders"| node_nav
node_app -->|"renders"| node_sidebar
node_app -->|"renders"| node_waterfall
node_app -->|"renders"| node_map
node_app -->|"renders"| node_drawer
node_app -->|"renders"| node_settings
node_app -->|"renders"| node_status
node_nav -->|"uploads to"| node_api
node_api -->|"uses"| node_inference
node_nav -->|"requests export"| node_api
node_nav -->|"returns detections"| node_app
node_app -->|"passes detections"| node_map
node_app -->|"passes detections"| node_drawer
node_drawer -->|"confirms or rejects"| node_app
node_api -->|"database access"| node_sqlite
node_training -.->|"prepares model"| node_export
node_export -.->|"produces model"| node_inference
node_edge -.->|"sensor input"| node_api
node_samples -.->|"supports testing"| node_edge
node_map -->|"loads tiles"| node_tiles

click node_app "https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/frontend/src/App.jsx"
click node_nav "https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/frontend/src/components/Navbar.jsx"
click node_sidebar "https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/frontend/src/components/Sidebar.jsx"
click node_waterfall "https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/frontend/src/components/WaterfallCanvas.jsx"
click node_map "https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/frontend/src/components/LeafletMap.jsx"
click node_drawer "https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/frontend/src/components/DetectionDrawer.jsx"
click node_settings "https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/frontend/src/components/SettingsModal.jsx"
click node_status "https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/frontend/src/components/StatusFooter.jsx"
click node_api "https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/backend/api/main.py"
click node_inference "https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/backend/api/inference.py"
click node_sqlite "https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/backend/db/database.py"
click node_training "https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/model_training/scripts/train.py"
click node_export "https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/model_training/scripts/export_onnx.py"
click node_edge "https://github.com/anand-jatothu/marinevisionai/tree/main/marine_vision/edge_tests/sensor_interface"
click node_samples "https://github.com/anand-jatothu/marinevisionai/tree/main/marine_vision/edge_tests/scripts"

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_nav,node_sidebar,node_waterfall,node_map,node_drawer,node_settings,node_status toneBlue
class node_api,node_inference toneAmber
class node_sqlite toneMint
class node_training,node_export toneRose
class node_edge,node_samples,node_operator,node_tiles toneIndigo
```

## Components

### Survey Console

- [Console State](https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/frontend/src/App.jsx): `marine_vision/frontend/src/App.jsx`
- [Mission Controls](https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/frontend/src/components/Navbar.jsx): `marine_vision/frontend/src/components/Navbar.jsx`
- [Telemetry Panel](https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/frontend/src/components/Sidebar.jsx): `marine_vision/frontend/src/components/Sidebar.jsx`
- [Sonar Display](https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/frontend/src/components/WaterfallCanvas.jsx): `marine_vision/frontend/src/components/WaterfallCanvas.jsx`
- [Target Map](https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/frontend/src/components/LeafletMap.jsx): `marine_vision/frontend/src/components/LeafletMap.jsx`
- [Detection Review](https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/frontend/src/components/DetectionDrawer.jsx): `marine_vision/frontend/src/components/DetectionDrawer.jsx`
- [System Settings](https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/frontend/src/components/SettingsModal.jsx): `marine_vision/frontend/src/components/SettingsModal.jsx`
- [Status Footer](https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/frontend/src/components/StatusFooter.jsx): `marine_vision/frontend/src/components/StatusFooter.jsx`

### API and Analysis

- [FastAPI Routes](https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/backend/api/main.py): `marine_vision/backend/api/main.py`
- [Sonar Inference](https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/backend/api/inference.py): `marine_vision/backend/api/inference.py`

### Mission Storage

- [Mission Database](https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/backend/db/database.py): `marine_vision/backend/db/database.py`

### Model Lifecycle

- [Model Training](https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/model_training/scripts/train.py): `marine_vision/model_training/scripts/train.py`
- [ONNX Export](https://github.com/anand-jatothu/marinevisionai/blob/main/marine_vision/model_training/scripts/export_onnx.py): `marine_vision/model_training/scripts/export_onnx.py`

### Edge Inputs

- [Sensor Interfaces](https://github.com/anand-jatothu/marinevisionai/tree/main/marine_vision/edge_tests/sensor_interface): `marine_vision/edge_tests/sensor_interface`
- [Edge Data Tools](https://github.com/anand-jatothu/marinevisionai/tree/main/marine_vision/edge_tests/scripts): `marine_vision/edge_tests/scripts`

### Other components

- **Survey Operator**
- **External Map Tiles**

## Connections

- Survey Operator → Mission Controls: operates
- Console State → Mission Controls: renders (evidence: `marine_vision/frontend/src/App.jsx`)
- Console State → Telemetry Panel: renders (evidence: `marine_vision/frontend/src/App.jsx`)
- Console State → Sonar Display: renders (evidence: `marine_vision/frontend/src/App.jsx`)
- Console State → Target Map: renders (evidence: `marine_vision/frontend/src/App.jsx`)
- Console State → Detection Review: renders (evidence: `marine_vision/frontend/src/App.jsx`)
- Console State → System Settings: renders (evidence: `marine_vision/frontend/src/App.jsx`)
- Console State → Status Footer: renders (evidence: `marine_vision/frontend/src/App.jsx`)
- Mission Controls → FastAPI Routes: uploads to (evidence: `marine_vision/frontend/src/components/Navbar.jsx`)
- FastAPI Routes → Sonar Inference: uses (evidence: `marine_vision/backend/api/main.py`)
- Mission Controls → FastAPI Routes: requests export (evidence: `marine_vision/frontend/src/components/Navbar.jsx`)
- Mission Controls → Console State: returns detections (evidence: `marine_vision/frontend/src/App.jsx`)
- Console State → Target Map: passes detections (evidence: `marine_vision/frontend/src/App.jsx`)
- Console State → Detection Review: passes detections (evidence: `marine_vision/frontend/src/App.jsx`)
- Detection Review → Console State: confirms or rejects (evidence: `marine_vision/frontend/src/App.jsx`)
- FastAPI Routes → Mission Database: database access (evidence: `marine_vision/backend/api/main.py`)
- Model Training → ONNX Export: prepares model
- ONNX Export → Sonar Inference: produces model
- Sensor Interfaces → FastAPI Routes: sensor input
- Edge Data Tools → Sensor Interfaces: supports testing
- Target Map → External Map Tiles: loads tiles (evidence: `marine_vision/frontend/src/components/LeafletMap.jsx`)
