# iian12/labflow architecture

> Architecture diagram of the GitHub repository iian12/labflow, 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/iian12/labflow
- Repository: https://github.com/iian12/labflow

## Overview

Labflow appears to be an experiment/run-tracking product: a Python SDK starts runs and supplies telemetry to a Java backend, with user accounts, projects, and project-scoped API keys. The SDK’s run, logging, and metric modules are represented from the tree; their internal behavior was not sampled. The frontend excerpt is a generic Vite/React starter rather than a product workflow. The README contains no capability details, so the graph relies on the source index and excerpts; edges to unsampled runtime pieces are omitted or marked unverified.

Main entry points: [`sdk/src/labflow/client.py`](https://github.com/iian12/labflow/blob/main/sdk/src/labflow/client.py) (SDK Client), [`backend/labflow/src/main/java/com/labflow/auth/application/AuthService.java`](https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/auth/application/AuthService.java) (Auth Service), [`backend/labflow/src/main/java/com/labflow/project/project/ProjectService.java`](https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/project/project/ProjectService.java) (Project Service), [`sdk/src/labflow/run.py`](https://github.com/iian12/labflow/blob/main/sdk/src/labflow/run.py) (Active Run)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sdk["Python SDK"]
  node_sdk_client["SDK Client<br/>[client.py]"]
  node_http_client["HTTP Client<br/>[http_client.py]"]
  node_active_run["Active Run<br/>[run.py]"]
  node_log_stream["Log Stream<br/>[stream.py]"]
  node_system_metrics["System Collector<br/>[collector.py]"]
end

subgraph group_ingest["Run Ingestion"]
  node_backend_api["SDK API"]
  node_run_service["Run Service<br/>[RunService.java]"]
  node_run_store[("Run Store")]
end

subgraph group_identity["Identity and Access"]
  node_auth_api["Auth API"]
  node_auth_service["Auth Service<br/>[AuthService.java]"]
  node_token_refresh["Token Refresh"]
  node_user_domain["User Domain<br/>[User.java]"]
  node_user_store[("User Store")]
end

subgraph group_projects["Projects and Keys"]
  node_project_service["Project Service"]
  node_project_store[("Project Store")]
  node_key_api["Key API"]
  node_key_service["Key Service"]
  node_key_auth["Key Authentication"]
  node_key_store[("Key Store")]
end

node_sdk_user(("SDK User"))

node_sdk_user -->|"uses"| node_sdk_client
node_sdk_client -->|"creates"| node_http_client
node_sdk_client -->|"creates"| node_active_run
node_sdk_client -->|"creates"| node_system_metrics
node_sdk_client -->|"posts run"| node_http_client
node_http_client -.->|"sends requests"| node_backend_api
node_active_run -.->|"uses"| node_log_stream
node_active_run -.->|"uses"| node_system_metrics
node_auth_api -.->|"delegates"| node_auth_service
node_auth_service -->|"reads and writes"| node_user_store
node_auth_service -->|"creates"| node_user_domain
node_auth_service -.->|"issues tokens"| node_token_refresh
node_token_refresh -->|"reads"| node_user_store
node_token_refresh -->|"uses"| node_user_domain
node_project_service -->|"reads"| node_user_store
node_project_service -->|"uses"| node_user_domain
node_project_service -->|"saves"| node_project_store
node_key_api -.->|"delegates"| node_key_service
node_key_service -->|"reads"| node_project_store
node_key_service -->|"saves"| node_key_store
node_key_auth -->|"looks up key"| node_key_store
node_backend_api -.->|"dispatches"| node_run_service
node_run_service -.->|"persists runs"| node_run_store

click node_sdk_client "https://github.com/iian12/labflow/blob/main/sdk/src/labflow/client.py"
click node_http_client "https://github.com/iian12/labflow/blob/main/sdk/src/labflow/api/http_client.py"
click node_active_run "https://github.com/iian12/labflow/blob/main/sdk/src/labflow/run.py"
click node_log_stream "https://github.com/iian12/labflow/blob/main/sdk/src/labflow/logging/stream.py"
click node_system_metrics "https://github.com/iian12/labflow/blob/main/sdk/src/labflow/system/collector.py"
click node_backend_api "https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/sdk/SdkTestController.java"
click node_run_service "https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/run/application/RunService.java"
click node_run_store "https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/run/infrastructure/RunRepositoryImpl.java"
click node_auth_api "https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/auth/presentation/AuthController.java"
click node_auth_service "https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/auth/application/AuthService.java"
click node_token_refresh "https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/auth/application/token/TokenRefreshService.java"
click node_user_domain "https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/user/domain/User.java"
click node_user_store "https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/user/infrastructure/persistence/UserRepositoryImpl.java"
click node_project_service "https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/project/project/ProjectService.java"
click node_project_store "https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/project/project/ProjectRepositoryImpl.java"
click node_key_api "https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/project/key/presentation/ProjectApiKeyController.java"
click node_key_service "https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/project/key/application/ProjectApiKeyService.java"
click node_key_auth "https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/project/key/application/ProjectApiKeyAuthenticationService.java"
click node_key_store "https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/project/key/infrastructure/persistence/ProjectApiKeyRepositoryImpl.java"

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_sdk_client,node_http_client,node_active_run,node_log_stream,node_system_metrics,node_sdk_user toneBlue
class node_backend_api,node_run_service,node_run_store toneAmber
class node_auth_api,node_auth_service,node_token_refresh,node_user_domain,node_user_store toneMint
class node_project_service,node_project_store,node_key_api,node_key_service,node_key_auth,node_key_store toneRose
```

## Components

### Python SDK

- [SDK Client](https://github.com/iian12/labflow/blob/main/sdk/src/labflow/client.py): `sdk/src/labflow/client.py`
- [HTTP Client](https://github.com/iian12/labflow/blob/main/sdk/src/labflow/api/http_client.py): `sdk/src/labflow/api/http_client.py`
- [Active Run](https://github.com/iian12/labflow/blob/main/sdk/src/labflow/run.py): `sdk/src/labflow/run.py`
- [Log Stream](https://github.com/iian12/labflow/blob/main/sdk/src/labflow/logging/stream.py): `sdk/src/labflow/logging/stream.py`
- [System Collector](https://github.com/iian12/labflow/blob/main/sdk/src/labflow/system/collector.py): `sdk/src/labflow/system/collector.py`

### Run Ingestion

- [SDK API](https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/sdk/SdkTestController.java): `backend/labflow/src/main/java/com/labflow/sdk/SdkTestController.java`
- [Run Service](https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/run/application/RunService.java): `backend/labflow/src/main/java/com/labflow/run/application/RunService.java`
- [Run Store](https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/run/infrastructure/RunRepositoryImpl.java): `backend/labflow/src/main/java/com/labflow/run/infrastructure/RunRepositoryImpl.java`

### Identity and Access

- [Auth API](https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/auth/presentation/AuthController.java): `backend/labflow/src/main/java/com/labflow/auth/presentation/AuthController.java`
- [Auth Service](https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/auth/application/AuthService.java): `backend/labflow/src/main/java/com/labflow/auth/application/AuthService.java`
- [Token Refresh](https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/auth/application/token/TokenRefreshService.java): `backend/labflow/src/main/java/com/labflow/auth/application/token/TokenRefreshService.java`
- [User Domain](https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/user/domain/User.java): `backend/labflow/src/main/java/com/labflow/user/domain/User.java`
- [User Store](https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/user/infrastructure/persistence/UserRepositoryImpl.java): `backend/labflow/src/main/java/com/labflow/user/infrastructure/persistence/UserRepositoryImpl.java`

### Projects and Keys

- [Project Service](https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/project/project/ProjectService.java): `backend/labflow/src/main/java/com/labflow/project/project/ProjectService.java`
- [Project Store](https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/project/project/ProjectRepositoryImpl.java): `backend/labflow/src/main/java/com/labflow/project/project/ProjectRepositoryImpl.java`
- [Key API](https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/project/key/presentation/ProjectApiKeyController.java): `backend/labflow/src/main/java/com/labflow/project/key/presentation/ProjectApiKeyController.java`
- [Key Service](https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/project/key/application/ProjectApiKeyService.java): `backend/labflow/src/main/java/com/labflow/project/key/application/ProjectApiKeyService.java`
- [Key Authentication](https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/project/key/application/ProjectApiKeyAuthenticationService.java): `backend/labflow/src/main/java/com/labflow/project/key/application/ProjectApiKeyAuthenticationService.java`
- [Key Store](https://github.com/iian12/labflow/blob/main/backend/labflow/src/main/java/com/labflow/project/key/infrastructure/persistence/ProjectApiKeyRepositoryImpl.java): `backend/labflow/src/main/java/com/labflow/project/key/infrastructure/persistence/ProjectApiKeyRepositoryImpl.java`

### Other components

- **SDK User**

## Connections

- SDK User → SDK Client: uses (evidence: `sdk/src/labflow/client.py`)
- SDK Client → HTTP Client: creates (evidence: `sdk/src/labflow/client.py`)
- SDK Client → Active Run: creates (evidence: `sdk/src/labflow/client.py`)
- SDK Client → System Collector: creates (evidence: `sdk/src/labflow/client.py`)
- SDK Client → HTTP Client: posts run (evidence: `sdk/src/labflow/client.py`)
- HTTP Client → SDK API: sends requests
- Active Run → Log Stream: uses (evidence: `sdk/src/labflow/run.py`)
- Active Run → System Collector: uses (evidence: `sdk/src/labflow/run.py`)
- Auth API → Auth Service: delegates (evidence: `backend/labflow/src/main/java/com/labflow/auth/presentation/AuthController.java`)
- Auth Service → User Store: reads and writes (evidence: `backend/labflow/src/main/java/com/labflow/auth/application/AuthService.java`)
- Auth Service → User Domain: creates (evidence: `backend/labflow/src/main/java/com/labflow/auth/application/AuthService.java`)
- Auth Service → Token Refresh: issues tokens
- Token Refresh → User Store: reads (evidence: `backend/labflow/src/main/java/com/labflow/auth/application/token/TokenRefreshService.java`)
- Token Refresh → User Domain: uses (evidence: `backend/labflow/src/main/java/com/labflow/auth/application/token/TokenRefreshService.java`)
- Project Service → User Store: reads (evidence: `backend/labflow/src/main/java/com/labflow/project/project/ProjectService.java`)
- Project Service → User Domain: uses (evidence: `backend/labflow/src/main/java/com/labflow/project/project/ProjectService.java`)
- Project Service → Project Store: saves (evidence: `backend/labflow/src/main/java/com/labflow/project/project/ProjectService.java`)
- Key API → Key Service: delegates (evidence: `backend/labflow/src/main/java/com/labflow/project/key/presentation/ProjectApiKeyController.java`)
- Key Service → Project Store: reads (evidence: `backend/labflow/src/main/java/com/labflow/project/key/application/ProjectApiKeyService.java`)
- Key Service → Key Store: saves (evidence: `backend/labflow/src/main/java/com/labflow/project/key/application/ProjectApiKeyService.java`)
- Key Authentication → Key Store: looks up key (evidence: `backend/labflow/src/main/java/com/labflow/project/key/application/ProjectApiKeyAuthenticationService.java`)
- SDK API → Run Service: dispatches
- Run Service → Run Store: persists runs
