# cywhale/argo architecture

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

- Interactive diagram: https://gitdiagram.com/cywhale/argo
- Repository: https://github.com/cywhale/argo

## Overview

##### Project type and purpose
- This is a Python-based local API server (a microservice) named **odbargo_app**.
- Its purpose is to fetch Biogeochemical Argo float data (NetCDF) from the public ERDDAP server using the Argopy library and expose it via a local HTTP API/CLI for the Ocean APIverse Argo Mapper plugin.

##### File structure
- **argo_app/**
- `app.py` – the entry point, launches the HTTP API server (likely Flask/FastAPI) and CLI command `odbargo_app`.
- `src/config.py` – configuration management (e.g., ERDDAP endpoint, cache paths).
- **conf/**
- `simu.conf` – sample or simulation configuration.
- **dev/**
- Jupyter notebooks and helper scripts for development, testing data pulls, and DB updates.
- **scripts/win_installer/**
- Windows installer scripts for bundling the app into a self-contained environment.
- **Dockerfile & docker-compose.yml**
- Containerization files to deploy the service in Docker.
- **setup.py, Pipfile, requirements.txt**
- Packaging and dependency management – installs `argopy`, HTTP framework, etc.

##### README for additional insights
- The README confirms it’s a local API server that uses **argopy** to query ERDDAP and is designed to plug into ODB’s web platform via Ocean APIverse.
- Installation steps show both Python-virtual-env and Windows installer targets.

##### Detail
- Layers (CLI vs. HTTP)
- Technologies on each component

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client Layer"
        direction TB
        HTTPClient["HTTP Client"]:::external
        CLIClient["CLI Client (`odbargo_app`)"]:::external
    end

    %% Server Layer
    subgraph "API Server Layer"
        direction TB
        APIServer["API Server\n(Flask/FastAPI)"]:::internal
        ConfigModule["Configuration Module\n(config.py)"]:::internal
    end

    %% Service Layer
    subgraph "Service Layer"
        direction TB
        ArgopyService["Argopy Service\n(Data-Fetching)"]:::internal
    end

    %% External Dependencies
    subgraph "External Service"
        direction TB
        ERDDAP["ERDDAP Server\n(erddap.ifremer.fr)"]:::external
    end

    %% Deployment & Packaging
    subgraph "Deployment & Packaging"
        direction TB
        DockerContainer["Docker Container"]:::deployment
        DockerCompose["docker-compose"]:::deployment
        WinInstaller["Windows Installer\n(scripts)"]:::deployment
        subgraph "Packaging & Artifacts"
            direction TB
            SetupPy["setup.py"]:::packaging
            PipfileNode["Pipfile"]:::packaging
            Req["requirements.txt"]:::packaging
            Manifest["MANIFEST.in"]:::packaging
            Dist["dist/"]:::packaging
        end
    end

    %% Flow Connections
    HTTPClient -->|HTTP Request| APIServer
    CLIClient -->|CLI Invocation| APIServer
    APIServer -->|loads config| ConfigModule
    APIServer -->|calls| ArgopyService
    ArgopyService -->|queries| ERDDAP
    ERDDAP -->|returns NetCDF| ArgopyService
    ArgopyService -->|data response| APIServer
    APIServer -->|responds| HTTPClient
    APIServer -->|responds| CLIClient

    %% Deployment Links
    APIServer --> DockerContainer
    DockerContainer --> DockerCompose
    APIServer --> WinInstaller
    APIServer --> SetupPy
    APIServer --> PipfileNode
    APIServer --> Req
    APIServer --> Manifest
    APIServer --> Dist

    %% Click Events
    click APIServer "https://github.com/cywhale/argo/blob/main/argo_app/app.py"
    click ConfigModule "https://github.com/cywhale/argo/blob/main/argo_app/src/config.py"
    click CLIClient "https://github.com/cywhale/argo/blob/main/setup.py"
    click SimuConf "https://github.com/cywhale/argo/blob/main/conf/simu.conf"
    click ArgopyService "https://github.com/cywhale/argo/blob/main/argo_app/app.py"
    click Dev "https://github.com/cywhale/argo/tree/main/dev/"
    click DockerContainer "https://github.com/cywhale/argo/tree/main/Dockerfile"
    click DockerCompose "https://github.com/cywhale/argo/blob/main/docker-compose.yml"
    click WinInstaller "https://github.com/cywhale/argo/tree/main/scripts/win_installer/"
    click SetupPy "https://github.com/cywhale/argo/blob/main/setup.py"
    click PipfileNode "https://github.com/cywhale/argo/tree/main/Pipfile"
    click Req "https://github.com/cywhale/argo/blob/main/requirements.txt"
    click Manifest "https://github.com/cywhale/argo/blob/main/MANIFEST.in"
    click Dist "https://github.com/cywhale/argo/tree/main/dist/"

    %% Styles
    classDef internal fill:#e0f7e9,stroke:#2e7d32,color:#1b5e20;
    classDef external fill:#e3f2fd,stroke:#1565c0,color:#0d47a1;
    classDef deployment fill:#eceff1,stroke:#455a64,color:#263238;
    classDef packaging fill:#fff8e1,stroke:#f9a825,color:#f57f17
```
