# gogoez0007/dmarine_trading_dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/gogoez0007/dmarine_trading_dashboard
- Repository: https://github.com/gogoez0007/dmarine_trading_dashboard

## Overview

Delta Marine AquaTrack is a shrimp-trading operations dashboard spanning harvest intake, buyer contracts, allocation, unloading reconciliation, review, and reporting, with configurable ML/AI prediction. The frontend’s application shell and API client are visible in excerpts; the README names the product but does not document runtime wiring. Backend handlers, services, repositories, and several views are therefore represented at subsystem level where source coverage is incomplete. Dashed, uncited edges mark likely runtime connections rather than inspected call paths.

Main entry points: [`frontend/src/App.tsx`](https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/frontend/src/App.tsx) (App shell), [`internal/service`](https://github.com/gogoez0007/dmarine_trading_dashboard/tree/main/internal/service) (Trading services), [`ml_service/app/main.py`](https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/ml_service/app/main.py) (Prediction API), [`sync_service/ingester.py`](https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/sync_service/ingester.py) (Excel sync ingester)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Trading dashboard"]
  node_app["App shell<br/>[App.tsx]"]
  node_api["API client<br/>[client.ts]"]
  node_dashboard["Dashboard &amp; KPIs<br/>[DashboardView.tsx]"]
  node_allocation["Harvest allocation<br/>[AllocationView.tsx]"]
  node_spb["Buyer contracts<br/>[SPBView.tsx]"]
  node_reconciliation["Unload reconciliation<br/>[RekonView.tsx]"]
  node_review["Trading review<br/>[ReviewView.tsx]"]
  node_reports["Operations reports<br/>[SPBReportView.tsx]"]
  node_prediction_ui["Prediction workbench"]
  node_master["Company &amp; pond masters"]
  node_tambak["Pond management<br/>[TambakView.tsx]"]
  node_panen_report["Harvest reports"]
end

subgraph group_ops["Trading operations"]
  node_backend["HTTP API<br/>[main.go]"]
  node_handlers["Domain handlers"]
  node_services["Trading services"]
  node_repositories["Data repositories"]
end

subgraph group_prediction["Prediction service"]
  node_ml_client["ML client<br/>[ml_client.go]"]
  node_ml_api["Prediction API<br/>[main.py]"]
  node_predictors["Prediction models"]
  node_ai_providers["AI providers"]
end

subgraph group_ingest["Harvest ingestion"]
  node_sync["Excel sync ingester<br/>[ingester.py]"]
  node_parser["Harvest workbook parser<br/>[parser.py]"]
end

node_user(("Trading user"))
node_database[("MySQL store")]
node_drive["Synced Excel files"]
node_external_ai(("AI provider APIs"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_dashboard
node_app -->|"renders"| node_allocation
node_app -->|"renders"| node_spb
node_app -->|"renders"| node_reconciliation
node_app -->|"renders"| node_review
node_app -->|"renders"| node_prediction_ui
node_app -->|"renders"| node_tambak
node_app -->|"renders"| node_panen_report
node_app -->|"renders"| node_reports
node_app -.->|"renders"| node_master
node_app -->|"requests data"| node_api
node_api -.->|"calls API"| node_backend
node_backend -.->|"routes to"| node_handlers
node_handlers -.->|"delegates to"| node_services
node_services -.->|"uses"| node_repositories
node_repositories -.->|"reads and writes"| node_database
node_services -.->|"requests predictions"| node_ml_client
node_ml_client -.->|"calls"| node_ml_api
node_ml_api -.->|"uses models"| node_predictors
node_ml_api -.->|"dispatches"| node_ai_providers
node_ai_providers -.->|"calls optionally"| node_external_ai
node_drive -.->|"supplies files"| node_sync
node_sync -.->|"parses workbooks"| node_parser
node_sync -->|"ingests records"| node_database

click node_app "https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/frontend/src/App.tsx"
click node_api "https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/frontend/src/api/client.ts"
click node_dashboard "https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/frontend/src/views/DashboardView.tsx"
click node_allocation "https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/frontend/src/views/AllocationView.tsx"
click node_spb "https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/frontend/src/views/SPBView.tsx"
click node_reconciliation "https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/frontend/src/views/RekonView.tsx"
click node_review "https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/frontend/src/views/ReviewView.tsx"
click node_reports "https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/frontend/src/views/SPBReportView.tsx"
click node_prediction_ui "https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/frontend/src/views/TestPredictView.tsx"
click node_master "https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/frontend/src/views/MasterPerusahaanView.tsx"
click node_tambak "https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/frontend/src/views/TambakView.tsx"
click node_panen_report "https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/frontend/src/views/PanenReportView.tsx"
click node_backend "https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/cmd/api/main.go"
click node_handlers "https://github.com/gogoez0007/dmarine_trading_dashboard/tree/main/internal/handler"
click node_services "https://github.com/gogoez0007/dmarine_trading_dashboard/tree/main/internal/service"
click node_repositories "https://github.com/gogoez0007/dmarine_trading_dashboard/tree/main/internal/repository"
click node_ml_client "https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/internal/client/ml_client.go"
click node_ml_api "https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/ml_service/app/main.py"
click node_predictors "https://github.com/gogoez0007/dmarine_trading_dashboard/tree/main/ml_service/app/predictors"
click node_ai_providers "https://github.com/gogoez0007/dmarine_trading_dashboard/tree/main/ml_service/app/ai_providers"
click node_sync "https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/sync_service/ingester.py"
click node_parser "https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/sync_service/parser.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_api,node_dashboard,node_allocation,node_spb,node_reconciliation,node_review,node_reports,node_prediction_ui,node_master,node_tambak,node_panen_report,node_user toneBlue
class node_backend,node_handlers,node_services,node_repositories,node_database toneAmber
class node_ml_client,node_ml_api,node_predictors,node_ai_providers,node_external_ai toneMint
class node_sync,node_parser toneRose
class node_drive toneIndigo
```

## Components

### Trading dashboard

- [App shell](https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [API client](https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [Dashboard & KPIs](https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/frontend/src/views/DashboardView.tsx): `frontend/src/views/DashboardView.tsx`
- [Harvest allocation](https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/frontend/src/views/AllocationView.tsx): `frontend/src/views/AllocationView.tsx`
- [Buyer contracts](https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/frontend/src/views/SPBView.tsx): `frontend/src/views/SPBView.tsx`
- [Unload reconciliation](https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/frontend/src/views/RekonView.tsx): `frontend/src/views/RekonView.tsx`
- [Trading review](https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/frontend/src/views/ReviewView.tsx): `frontend/src/views/ReviewView.tsx`
- [Operations reports](https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/frontend/src/views/SPBReportView.tsx): `frontend/src/views/SPBReportView.tsx`
- [Prediction workbench](https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/frontend/src/views/TestPredictView.tsx): `frontend/src/views/TestPredictView.tsx`
- [Company & pond masters](https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/frontend/src/views/MasterPerusahaanView.tsx): `frontend/src/views/MasterPerusahaanView.tsx`
- [Pond management](https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/frontend/src/views/TambakView.tsx): `frontend/src/views/TambakView.tsx`
- [Harvest reports](https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/frontend/src/views/PanenReportView.tsx): `frontend/src/views/PanenReportView.tsx`

### Trading operations

- [HTTP API](https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/cmd/api/main.go): `cmd/api/main.go`
- [Domain handlers](https://github.com/gogoez0007/dmarine_trading_dashboard/tree/main/internal/handler): `internal/handler`
- [Trading services](https://github.com/gogoez0007/dmarine_trading_dashboard/tree/main/internal/service): `internal/service`
- [Data repositories](https://github.com/gogoez0007/dmarine_trading_dashboard/tree/main/internal/repository): `internal/repository`

### Prediction service

- [ML client](https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/internal/client/ml_client.go): `internal/client/ml_client.go`
- [Prediction API](https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/ml_service/app/main.py): `ml_service/app/main.py`
- [Prediction models](https://github.com/gogoez0007/dmarine_trading_dashboard/tree/main/ml_service/app/predictors): `ml_service/app/predictors`
- [AI providers](https://github.com/gogoez0007/dmarine_trading_dashboard/tree/main/ml_service/app/ai_providers): `ml_service/app/ai_providers`

### Harvest ingestion

- [Excel sync ingester](https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/sync_service/ingester.py): `sync_service/ingester.py`
- [Harvest workbook parser](https://github.com/gogoez0007/dmarine_trading_dashboard/blob/main/sync_service/parser.py): `sync_service/parser.py`

### Other components

- **Trading user**
- **MySQL store**
- **Synced Excel files**
- **AI provider APIs**

## Connections

- Trading user → App shell: uses (evidence: `README.md`)
- App shell → Dashboard & KPIs: renders (evidence: `frontend/src/App.tsx`)
- App shell → Harvest allocation: renders (evidence: `frontend/src/App.tsx`)
- App shell → Buyer contracts: renders (evidence: `frontend/src/App.tsx`)
- App shell → Unload reconciliation: renders (evidence: `frontend/src/App.tsx`)
- App shell → Trading review: renders (evidence: `frontend/src/App.tsx`)
- App shell → Prediction workbench: renders (evidence: `frontend/src/App.tsx`)
- App shell → Pond management: renders (evidence: `frontend/src/App.tsx`)
- App shell → Harvest reports: renders (evidence: `frontend/src/App.tsx`)
- App shell → Operations reports: renders (evidence: `frontend/src/App.tsx`)
- App shell → Company & pond masters: renders (evidence: `frontend/src/App.tsx`)
- App shell → API client: requests data (evidence: `frontend/src/App.tsx`)
- API client → HTTP API: calls API
- HTTP API → Domain handlers: routes to
- Domain handlers → Trading services: delegates to
- Trading services → Data repositories: uses
- Data repositories → MySQL store: reads and writes
- Trading services → ML client: requests predictions
- ML client → Prediction API: calls
- Prediction API → Prediction models: uses models (evidence: `ml_service/app/main.py`)
- Prediction API → AI providers: dispatches (evidence: `ml_service/app/main.py`)
- AI providers → AI provider APIs: calls optionally (evidence: `ml_service/app/ai_providers/agent_provider.py`)
- Synced Excel files → Excel sync ingester: supplies files
- Excel sync ingester → Harvest workbook parser: parses workbooks (evidence: `sync_service/ingester.py`)
- Excel sync ingester → MySQL store: ingests records (evidence: `sync_service/ingester.py`)
