# remicres/dinamis-sdk architecture

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

- Interactive diagram: https://gitdiagram.com/remicres/dinamis-sdk
- Repository: https://github.com/remicres/dinamis-sdk

## Overview

##### Main Components

a) Core SDK Components:
- Authentication Layer (oauth2.py, signing.py)
- HTTP Client Layer (http.py)
- Data Model Layer (model.py)
- Upload Management (upload.py)
- Configuration Management (settings.py)
- Utility Functions (utils.py)

b) External Systems:
- THEIA-MTD Geospatial Data Center
- STAC API Endpoint
- Client Applications

**┌─ Client Applications ─────────────────────────────┐**

- ┌─ DINAMIS SDK ────────────────────────────┐    │

- ┌─ High-Level Interface ─────────────┐  │    │
- CLI Interface (cli.py)           │  │    │
- Example Implementations          │  │    │
- ┘  │    │

- ┌─ Core Services ───────────────────┐   │    │
- Authentication & Signing        │   │    │
- HTTP Client                     │   │    │
- Data Model                      │   │    │
- Upload Management              │   │    │
- ┘   │    │

- ┘    │

- ┘

**┌─ External Services ──────────────────────────────┐**
- THEIA-MTD Geospatial Data Center              │
- STAC API Endpoint                             │
- ┘

##### Key Relationships to Highlight

- How the SDK interfaces with the STAC API endpoint
- Authentication flow
- Demonstrate how client applications interact with the SDK
- Data flow between components

##### Important Details

- Version compatibility information
- Key dependencies (pystac_client)
- Authentication mechanisms
- Data flow directions
- API endpoints

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and classes
    classDef client fill:#FFA07A,stroke:#333,stroke-width:2px
    classDef sdk fill:#87CEEB,stroke:#333,stroke-width:2px
    classDef external fill:#98FB98,stroke:#333,stroke-width:2px
    classDef interface fill:#DDA0DD,stroke:#333,stroke-width:2px
    classDef core fill:#B0C4DE,stroke:#333,stroke-width:2px
    classDef docs fill:#F0E68C,stroke:#333,stroke-width:2px

    %% Client Applications Layer
    subgraph ClientApps["Client Applications"]
        Client1["Python Applications"]:::client
        Client2["R Applications (rstactheia)"]:::client
    end

    %% DINAMIS SDK Layer
    subgraph SDK["DINAMIS SDK"]
        %% High-Level Interface
        subgraph Interface["High-Level Interface"]
            CLI["CLI Interface"]:::interface
            Examples["Example Implementations"]:::interface
        end

        %% Core Services
        subgraph Core["Core Services"]
            Auth["Authentication Layer"]:::core
            HTTP["HTTP Client Layer"]:::core
            Model["Data Model Layer"]:::core
            Upload["Upload Management"]:::core
            Config["Configuration Management"]:::core
            Utils["Utility Functions"]:::core
        end

        %% Documentation
        subgraph Docs["Documentation"]
            DocAdv["Advanced Usage"]:::docs
            DocColl["Collections"]:::docs
            DocCred["Credentials"]:::docs
            DocProc["Processing Examples"]:::docs
        end

        %% Testing
        subgraph Tests["Testing Infrastructure"]
            TestHeaders["Header Tests"]:::core
            TestMisc["Misc Tests"]:::core
            TestPush["Push Tests"]:::core
            TestSpot["SPOT Tests"]:::core
            TestS2["Super-S2 Tests"]:::core
        end
    end

    %% External Services
    subgraph External["External Services"]
        THEIA["THEIA-MTD Geospatial Data Center"]:::external
        STAC["STAC API Endpoint"]:::external
    end

    %% Relationships
    Client1 --> CLI
    Client2 --> CLI
    CLI --> Core
    Examples --> Core
    Auth --> STAC
    HTTP --> THEIA
    HTTP --> STAC
    Upload --> THEIA
    Model --> STAC

    %% Click events
    click Auth "https://github.com/remicres/dinamis-sdk/blob/main/dinamis_sdk/oauth2.py"
    click HTTP "https://github.com/remicres/dinamis-sdk/blob/main/dinamis_sdk/http.py"
    click Model "https://github.com/remicres/dinamis-sdk/blob/main/dinamis_sdk/model.py"
    click Upload "https://github.com/remicres/dinamis-sdk/blob/main/dinamis_sdk/upload.py"
    click Config "https://github.com/remicres/dinamis-sdk/blob/main/dinamis_sdk/settings.py"
    click Utils "https://github.com/remicres/dinamis-sdk/blob/main/dinamis_sdk/utils.py"
    click CLI "https://github.com/remicres/dinamis-sdk/blob/main/dinamis_sdk/cli.py"
    click Examples "https://github.com/remicres/dinamis-sdk/tree/main/dinamis_sdk/examples"
    click TestHeaders "https://github.com/remicres/dinamis-sdk/blob/main/tests/test_headers.py"
    click TestMisc "https://github.com/remicres/dinamis-sdk/blob/main/tests/test_misc.py"
    click TestPush "https://github.com/remicres/dinamis-sdk/blob/main/tests/test_push.py"
    click TestSpot "https://github.com/remicres/dinamis-sdk/blob/main/tests/test_spot-6-7-drs.py"
    click TestS2 "https://github.com/remicres/dinamis-sdk/blob/main/tests/test_super-s2.py"
    click DocAdv "https://github.com/remicres/dinamis-sdk/blob/main/doc/advanced.md"
    click DocColl "https://github.com/remicres/dinamis-sdk/blob/main/doc/collections.md"
    click DocCred "https://github.com/remicres/dinamis-sdk/blob/main/doc/credentials.md"
    click DocProc "https://github.com/remicres/dinamis-sdk/blob/main/doc/processing_examples.md"
    click Docs "https://github.com/remicres/dinamis-sdk/tree/main/doc"
```
