# lithishvishal/fishermanpolicymaker architecture

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

- Interactive diagram: https://gitdiagram.com/lithishvishal/fishermanpolicymaker
- Repository: https://github.com/lithishvishal/fishermanpolicymaker

## Overview

Oceanix is a marine biodiversity and regional ocean-health dashboard. Users explore species and occurrence maps, view health and time-series analyses, compare periods or regions, detect anomalies, run what-if projections, validate CSV uploads, ask a data-backed assistant, and download PDF or CSV reports. The frontend calls a FastAPI application, which orchestrates OBIS occurrence data, environmental readings, calculations, assistant responses, and report generation. Source excerpts establish these connections; unsampled routes and frontend behavior are represented only where documented by shown calls or the source index.

Main entry points: [`backend/main.py`](https://github.com/lithishvishal/fishermanpolicymaker/blob/main/backend/main.py) (FastAPI routes), [`backend/report.py`](https://github.com/lithishvishal/fishermanpolicymaker/blob/main/backend/report.py) (PDF report generation), [`backend/assistant.py`](https://github.com/lithishvishal/fishermanpolicymaker/blob/main/backend/assistant.py) (Marine Q&A), [`backend/obis.py`](https://github.com/lithishvishal/fishermanpolicymaker/blob/main/backend/obis.py) (OBIS species and occurrences)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web dashboard"]
  node_dashboard["Interactive dashboard<br/>[script.js]"]
  node_annotations["Map annotations<br/>[script.js]"]
end

subgraph group_api["API orchestration"]
  node_api_app["FastAPI routes<br/>[main.py]"]
end

subgraph group_marine_data["Marine data"]
  node_obis["OBIS species and occurrences<br/>[obis.py]"]
  node_environment["Environmental readings<br/>[environment.py]"]
end

subgraph group_analysis["Analysis and reporting"]
  node_calculations["Health and trend analysis<br/>[calculations.py]"]
  node_report["PDF report generation<br/>[report.py]"]
end

subgraph group_assistant["Assistant"]
  node_assistant_logic["Marine Q&amp;A<br/>[assistant.py]"]
end

node_user(("Dashboard user"))
node_obis_service{{"OBIS API"}}
node_open_meteo{{"Open-Meteo APIs"}}
node_llm_services{{"LLM providers"}}
node_reportlab{{"ReportLab"}}

node_user -->|"uses"| node_dashboard
node_dashboard -->|"requests data"| node_api_app
node_dashboard -->|"saves notes"| node_annotations
node_api_app -->|"fetches records"| node_obis
node_api_app -->|"fetches readings"| node_environment
node_api_app -->|"computes indicators"| node_calculations
node_api_app -->|"answers questions"| node_assistant_logic
node_api_app -->|"builds PDF"| node_report
node_obis -->|"queries"| node_obis_service
node_environment -->|"queries"| node_open_meteo
node_assistant_logic -->|"gets marine context"| node_obis
node_assistant_logic -->|"uses analysis"| node_calculations
node_assistant_logic -->|"dispatches prompts"| node_llm_services
node_report -->|"loads period records"| node_obis
node_report -->|"computes report metrics"| node_calculations
node_report -->|"renders PDF"| node_reportlab

click node_dashboard "https://github.com/lithishvishal/fishermanpolicymaker/blob/main/frontend/script.js"
click node_annotations "https://github.com/lithishvishal/fishermanpolicymaker/blob/main/frontend/script.js"
click node_api_app "https://github.com/lithishvishal/fishermanpolicymaker/blob/main/backend/main.py"
click node_obis "https://github.com/lithishvishal/fishermanpolicymaker/blob/main/backend/obis.py"
click node_environment "https://github.com/lithishvishal/fishermanpolicymaker/blob/main/backend/environment.py"
click node_calculations "https://github.com/lithishvishal/fishermanpolicymaker/blob/main/backend/calculations.py"
click node_assistant_logic "https://github.com/lithishvishal/fishermanpolicymaker/blob/main/backend/assistant.py"
click node_report "https://github.com/lithishvishal/fishermanpolicymaker/blob/main/backend/report.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_dashboard,node_annotations,node_user toneBlue
class node_api_app toneAmber
class node_obis,node_environment,node_obis_service,node_open_meteo toneMint
class node_calculations,node_report toneRose
class node_assistant_logic,node_llm_services,node_reportlab toneIndigo
```

## Components

### Web dashboard

- [Interactive dashboard](https://github.com/lithishvishal/fishermanpolicymaker/blob/main/frontend/script.js): `frontend/script.js`
- [Map annotations](https://github.com/lithishvishal/fishermanpolicymaker/blob/main/frontend/script.js): `frontend/script.js`

### API orchestration

- [FastAPI routes](https://github.com/lithishvishal/fishermanpolicymaker/blob/main/backend/main.py): `backend/main.py`

### Marine data

- [OBIS species and occurrences](https://github.com/lithishvishal/fishermanpolicymaker/blob/main/backend/obis.py): `backend/obis.py`
- [Environmental readings](https://github.com/lithishvishal/fishermanpolicymaker/blob/main/backend/environment.py): `backend/environment.py`

### Analysis and reporting

- [Health and trend analysis](https://github.com/lithishvishal/fishermanpolicymaker/blob/main/backend/calculations.py): `backend/calculations.py`
- [PDF report generation](https://github.com/lithishvishal/fishermanpolicymaker/blob/main/backend/report.py): `backend/report.py`

### Assistant

- [Marine Q&A](https://github.com/lithishvishal/fishermanpolicymaker/blob/main/backend/assistant.py): `backend/assistant.py`

### Other components

- **Dashboard user**
- **OBIS API**
- **Open-Meteo APIs**
- **LLM providers**
- **ReportLab**

## Connections

- Dashboard user → Interactive dashboard: uses (evidence: `frontend/script.js`)
- Interactive dashboard → FastAPI routes: requests data (evidence: `frontend/script.js`)
- Interactive dashboard → Map annotations: saves notes (evidence: `frontend/script.js`)
- FastAPI routes → OBIS species and occurrences: fetches records (evidence: `backend/main.py`)
- FastAPI routes → Environmental readings: fetches readings (evidence: `backend/main.py`)
- FastAPI routes → Health and trend analysis: computes indicators (evidence: `backend/main.py`)
- FastAPI routes → Marine Q&A: answers questions (evidence: `backend/main.py`)
- FastAPI routes → PDF report generation: builds PDF (evidence: `backend/main.py`)
- OBIS species and occurrences → OBIS API: queries (evidence: `backend/obis.py`)
- Environmental readings → Open-Meteo APIs: queries (evidence: `backend/environment.py`)
- Marine Q&A → OBIS species and occurrences: gets marine context (evidence: `backend/assistant.py`)
- Marine Q&A → Health and trend analysis: uses analysis (evidence: `backend/assistant.py`)
- Marine Q&A → LLM providers: dispatches prompts (evidence: `backend/assistant.py`)
- PDF report generation → OBIS species and occurrences: loads period records (evidence: `backend/report.py`)
- PDF report generation → Health and trend analysis: computes report metrics (evidence: `backend/report.py`)
- PDF report generation → ReportLab: renders PDF (evidence: `backend/report.py`)
