# oscarminus/steinapi architecture

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

- Interactive diagram: https://gitdiagram.com/oscarminus/steinapi
- Repository: https://github.com/oscarminus/steinapi

## Overview

steinapi is a command-line synchronizer for vehicle status and comments between Stein.APP and Divera 24/7. It loads credentials and a direction option, fetches both services’ vehicle data, matches vehicles by their shared number/name, then compares status and modification times to decide which side to update. The Stein client encapsulates authenticated, rate-limited asset requests; Divera requests and synchronization decisions are handled in divera.py. The README documents the setup and directional modes; the graph reflects the sampled runtime code.

Main entry points: [`divera.py`](https://github.com/oscarminus/steinapi/blob/main/divera.py) (Sync command), [`steinapi.py`](https://github.com/oscarminus/steinapi/blob/main/steinapi.py) (Stein API client), [`config.json.sample`](https://github.com/oscarminus/steinapi/blob/main/config.json.sample) (Sync config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sync["Synchronization"]
  node_config["Sync config<br/>[config.json.sample]"]
  node_runner["Sync command<br/>[divera.py]"]
  node_reconcile["Match and reconcile<br/>[divera.py]"]
end

subgraph group_clients["API clients"]
  node_stein_client["Stein API client<br/>[steinapi.py]"]
end

subgraph group_external["External services"]
  node_divera_api["Divera API"]
  node_stein_app["Stein.APP API"]
end

node_operator(("Operator"))

node_operator -->|"runs"| node_runner
node_operator -->|"configures"| node_config
node_runner -->|"loads"| node_config
node_runner -->|"fetches vehicles"| node_divera_api
node_runner -->|"fetches assets"| node_stein_client
node_runner -->|"processes data"| node_reconcile
node_reconcile -->|"updates status"| node_divera_api
node_reconcile -->|"updates asset"| node_stein_client
node_stein_client -->|"reads and patches"| node_stein_app

click node_config "https://github.com/oscarminus/steinapi/blob/main/config.json.sample"
click node_runner "https://github.com/oscarminus/steinapi/blob/main/divera.py"
click node_reconcile "https://github.com/oscarminus/steinapi/blob/main/divera.py"
click node_stein_client "https://github.com/oscarminus/steinapi/blob/main/steinapi.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_config,node_runner,node_reconcile toneBlue
class node_stein_client toneAmber
class node_divera_api,node_stein_app toneMint
class node_operator toneIndigo
```

## Components

### Synchronization

- [Sync config](https://github.com/oscarminus/steinapi/blob/main/config.json.sample): `config.json.sample`
- [Sync command](https://github.com/oscarminus/steinapi/blob/main/divera.py): `divera.py`
- [Match and reconcile](https://github.com/oscarminus/steinapi/blob/main/divera.py): `divera.py`

### API clients

- [Stein API client](https://github.com/oscarminus/steinapi/blob/main/steinapi.py): `steinapi.py`

### External services

- **Divera API**
- **Stein.APP API**

### Other components

- **Operator**

## Connections

- Operator → Sync command: runs (evidence: `README.md`)
- Operator → Sync config: configures (evidence: `README.md`)
- Sync command → Sync config: loads (evidence: `divera.py`)
- Sync command → Divera API: fetches vehicles (evidence: `divera.py`)
- Sync command → Stein API client: fetches assets (evidence: `divera.py`)
- Sync command → Match and reconcile: processes data (evidence: `divera.py`)
- Match and reconcile → Divera API: updates status (evidence: `divera.py`)
- Match and reconcile → Stein API client: updates asset (evidence: `divera.py`)
- Stein API client → Stein.APP API: reads and patches (evidence: `steinapi.py`)
