# zaheerk19n/floatchat-aquaminds architecture

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

- Interactive diagram: https://gitdiagram.com/zaheerk19n/floatchat-aquaminds
- Repository: https://github.com/zaheerk19n/floatchat-aquaminds

## Overview

FloatChat presents oceanographic data through a React interface and a FastAPI backend: users explore dashboards, ask questions, and view reports, while backend endpoints query profiles, authenticate users, search profile context, and serve analytics and alerts. The README also describes forecasting, explainable AI, voice, and export formats; these are represented as product capabilities, not asserted implementation details where source evidence is unavailable. The excerpts establish router registration, selected database operations, NetCDF ingestion, and RAG behavior; other links are limited to explicit README statements.

Main entry points: [`backend/app/main.py`](https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/main.py) (FastAPI router), [`oceanai-frontend/src/App.tsx`](https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/oceanai-frontend/src/App.tsx) (Web app routes), [`backend/app/models.py`](https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/models.py) (Ocean records), [`backend/app/database.py`](https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/database.py) (Database sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["User interface"]
  node_app["Web app routes<br/>[App.tsx]"]
  node_home["Home exploration<br/>[Home.tsx]"]
  node_dashboard["Ocean dashboard<br/>[Dashboard.tsx]"]
  node_chatui["Chat interface<br/>[Chat.tsx]"]
  node_analyticsui["Analytics views<br/>[Analytics.tsx]"]
  node_reportsui["Report interface<br/>[Reports.tsx]"]
end

subgraph group_api["API and identity"]
  node_api["FastAPI router<br/>[main.py]"]
  node_auth["Account access<br/>[auth.py]"]
  node_security["Token security<br/>[security.py]"]
  node_profiles["Profile queries<br/>[profiles.py]"]
  node_analytics["Analytics endpoint<br/>[analytics.py]"]
  node_alerts["Anomaly alerts<br/>[alerts.py]"]
  node_chatapi["Chat endpoint<br/>[chat.py]"]
  node_reportapi["Report endpoint<br/>[reports.py]"]
end

subgraph group_data["Ocean data"]
  node_sql[("Ocean records<br/>[models.py]")]
  node_database["Database sessions<br/>[database.py]"]
  node_ingestion["NetCDF ingestion<br/>[ingestion.py]"]
end

subgraph group_insights["AI and outputs"]
  node_rag["Semantic retrieval<br/>[rag_service.py]"]
  node_anomaly["Anomaly detection<br/>[anomaly.py]"]
  node_pdf["PDF generation<br/>[pdf_service.py]"]
end

node_user(("Ocean data user"))
node_llm["Gemini model"]

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_chatui
node_app -->|"routes to"| node_analyticsui
node_app -->|"routes to"| node_reportsui
node_app -.->|"requests data"| node_api
node_api -->|"registers"| node_auth
node_api -->|"registers"| node_chatapi
node_api -->|"registers"| node_profiles
node_api -->|"registers"| node_analytics
node_api -->|"registers"| node_reportapi
node_api -->|"registers"| node_alerts
node_api -->|"creates tables"| node_sql
node_auth -->|"opens sessions"| node_database
node_auth -->|"reads and writes"| node_sql
node_auth -->|"hashes credentials"| node_security
node_profiles -->|"opens sessions"| node_database
node_profiles -->|"queries profiles"| node_sql
node_analytics -->|"uses sessions"| node_database
node_analytics -->|"queries records"| node_sql
node_alerts -->|"uses sessions"| node_database
node_alerts -->|"queries records"| node_sql
node_alerts -->|"checks anomalies"| node_anomaly
node_chatapi -->|"answers queries"| node_rag
node_rag -->|"embeds queries"| node_database
node_rag -->|"generates answer"| node_llm
node_ingestion -->|"uses sessions"| node_database
node_ingestion -->|"stores profiles"| node_sql
node_reportsui -.->|"exports PDF"| node_pdf
node_reportapi -->|"generates report"| node_pdf
node_dashboard -.->|"explores trends"| node_analyticsui
node_analyticsui -.->|"shows anomalies"| node_anomaly
node_analyticsui -.->|"visualizes ocean data"| node_sql

click node_app "https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/oceanai-frontend/src/App.tsx"
click node_home "https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/oceanai-frontend/src/pages/Home.tsx"
click node_dashboard "https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/oceanai-frontend/src/pages/Dashboard.tsx"
click node_chatui "https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/oceanai-frontend/src/pages/Chat.tsx"
click node_analyticsui "https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/oceanai-frontend/src/pages/Analytics.tsx"
click node_reportsui "https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/oceanai-frontend/src/pages/Reports.tsx"
click node_api "https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/main.py"
click node_auth "https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/routers/auth.py"
click node_security "https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/security.py"
click node_profiles "https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/routers/profiles.py"
click node_analytics "https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/routers/analytics.py"
click node_alerts "https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/routers/alerts.py"
click node_chatapi "https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/routers/chat.py"
click node_reportapi "https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/routers/reports.py"
click node_sql "https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/models.py"
click node_database "https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/database.py"
click node_ingestion "https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/services/ingestion.py"
click node_rag "https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/services/rag_service.py"
click node_anomaly "https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/services/anomaly.py"
click node_pdf "https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/services/pdf_service.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_home,node_dashboard,node_chatui,node_analyticsui,node_reportsui,node_user toneBlue
class node_api,node_auth,node_security,node_profiles,node_analytics,node_alerts,node_chatapi,node_reportapi toneAmber
class node_sql,node_database,node_ingestion toneMint
class node_rag,node_anomaly,node_pdf toneRose
class node_llm toneIndigo
```

## Components

### User interface

- [Web app routes](https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/oceanai-frontend/src/App.tsx): `oceanai-frontend/src/App.tsx`
- [Home exploration](https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/oceanai-frontend/src/pages/Home.tsx): `oceanai-frontend/src/pages/Home.tsx`
- [Ocean dashboard](https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/oceanai-frontend/src/pages/Dashboard.tsx): `oceanai-frontend/src/pages/Dashboard.tsx`
- [Chat interface](https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/oceanai-frontend/src/pages/Chat.tsx): `oceanai-frontend/src/pages/Chat.tsx`
- [Analytics views](https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/oceanai-frontend/src/pages/Analytics.tsx): `oceanai-frontend/src/pages/Analytics.tsx`
- [Report interface](https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/oceanai-frontend/src/pages/Reports.tsx): `oceanai-frontend/src/pages/Reports.tsx`

### API and identity

- [FastAPI router](https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/main.py): `backend/app/main.py`
- [Account access](https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/routers/auth.py): `backend/app/routers/auth.py`
- [Token security](https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/security.py): `backend/app/security.py`
- [Profile queries](https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/routers/profiles.py): `backend/app/routers/profiles.py`
- [Analytics endpoint](https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/routers/analytics.py): `backend/app/routers/analytics.py`
- [Anomaly alerts](https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/routers/alerts.py): `backend/app/routers/alerts.py`
- [Chat endpoint](https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/routers/chat.py): `backend/app/routers/chat.py`
- [Report endpoint](https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/routers/reports.py): `backend/app/routers/reports.py`

### Ocean data

- [Ocean records](https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/models.py): `backend/app/models.py`
- [Database sessions](https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/database.py): `backend/app/database.py`
- [NetCDF ingestion](https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/services/ingestion.py): `backend/app/services/ingestion.py`

### AI and outputs

- [Semantic retrieval](https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/services/rag_service.py): `backend/app/services/rag_service.py`
- [Anomaly detection](https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/services/anomaly.py): `backend/app/services/anomaly.py`
- [PDF generation](https://github.com/zaheerk19n/floatchat-aquaminds/blob/main/backend/app/services/pdf_service.py): `backend/app/services/pdf_service.py`

### Other components

- **Ocean data user**
- **Gemini model**

## Connections

- Ocean data user → Web app routes: uses
- Web app routes → Home exploration: routes to (evidence: `oceanai-frontend/src/App.tsx`)
- Web app routes → Ocean dashboard: routes to (evidence: `oceanai-frontend/src/App.tsx`)
- Web app routes → Chat interface: routes to (evidence: `oceanai-frontend/src/App.tsx`)
- Web app routes → Analytics views: routes to (evidence: `oceanai-frontend/src/App.tsx`)
- Web app routes → Report interface: routes to (evidence: `oceanai-frontend/src/App.tsx`)
- Web app routes → FastAPI router: requests data
- FastAPI router → Account access: registers (evidence: `backend/app/main.py`)
- FastAPI router → Chat endpoint: registers (evidence: `backend/app/main.py`)
- FastAPI router → Profile queries: registers (evidence: `backend/app/main.py`)
- FastAPI router → Analytics endpoint: registers (evidence: `backend/app/main.py`)
- FastAPI router → Report endpoint: registers (evidence: `backend/app/main.py`)
- FastAPI router → Anomaly alerts: registers (evidence: `backend/app/main.py`)
- FastAPI router → Ocean records: creates tables (evidence: `backend/app/main.py`)
- Account access → Database sessions: opens sessions (evidence: `backend/app/routers/auth.py`)
- Account access → Ocean records: reads and writes (evidence: `backend/app/routers/auth.py`)
- Account access → Token security: hashes credentials (evidence: `backend/app/routers/auth.py`)
- Profile queries → Database sessions: opens sessions (evidence: `backend/app/routers/profiles.py`)
- Profile queries → Ocean records: queries profiles (evidence: `backend/app/routers/profiles.py`)
- Analytics endpoint → Database sessions: uses sessions (evidence: `backend/app/routers/analytics.py`)
- Analytics endpoint → Ocean records: queries records (evidence: `backend/app/routers/analytics.py`)
- Anomaly alerts → Database sessions: uses sessions (evidence: `backend/app/routers/alerts.py`)
- Anomaly alerts → Ocean records: queries records (evidence: `backend/app/routers/alerts.py`)
- Anomaly alerts → Anomaly detection: checks anomalies (evidence: `backend/app/routers/alerts.py`)
- Chat endpoint → Semantic retrieval: answers queries (evidence: `backend/app/routers/chat.py`)
- Semantic retrieval → Database sessions: embeds queries (evidence: `backend/app/services/rag_service.py`)
- Semantic retrieval → Gemini model: generates answer (evidence: `backend/app/services/rag_service.py`)
- NetCDF ingestion → Database sessions: uses sessions (evidence: `backend/app/services/ingestion.py`)
- NetCDF ingestion → Ocean records: stores profiles (evidence: `backend/app/services/ingestion.py`)
- Report interface → PDF generation: exports PDF
- Report endpoint → PDF generation: generates report (evidence: `backend/app/routers/reports.py`)
- Ocean dashboard → Analytics views: explores trends
- Analytics views → Anomaly detection: shows anomalies
- Analytics views → Ocean records: visualizes ocean data
