# helmholtz-ufz/cosmosuite architecture

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

## Overview

Cosmo Suite is a domain-free Dash/Celery application framework, with a CSV profiler as its documented reference domain. A consumer app supplies job/configuration seams; the framework provides the shell, job lifecycle and persistence, asynchronous task machinery, and operations pages. The graph emphasizes those stages and the documented logging and error-handling capabilities. Some source is unsampled, so uncertain runtime links are omitted or marked unverified.

Main entry points: [`cosmo_suite/job.py`](https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/job.py) (Job lifecycle), [`cosmo_suite/db_manager.py`](https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/db_manager.py) (Database manager), [`cosmo_suite/background_job_manager.py`](https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/background_job_manager.py) (Task manager), [`cosmo_suite/tasks/maintenance_tasks.py`](https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/tasks/maintenance_tasks.py) (Maintenance tasks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_layouts["Dash shell<br/>[layouts.py]"]
  node_job_page["Job management<br/>[job_management.py]"]
  node_logs_page["Logs page<br/>[logs.py]"]
  node_worker_page["Worker management"]
end

subgraph group_jobs["Job lifecycle"]
  node_job["Job lifecycle<br/>[job.py]"]
  node_base_job["Job base<br/>[base_job.py]"]
  node_models["Framework models<br/>[pydantic_models.py]"]
  node_files_route["Job file route<br/>[files_route.py]"]
end

subgraph group_async["Task operations"]
  node_background["Task manager"]
  node_celery_app["Celery registration<br/>[celery_app.py]"]
  node_celery_config["Celery configuration<br/>[celery_config.py]"]
  node_maintenance["Maintenance tasks"]
end

subgraph group_support["Persistence and support"]
  node_db["Database manager<br/>[db_manager.py]"]
  node_object_storage["Object storage"]
  node_logger["Logging<br/>[logger.py]"]
  node_logs_table["Log table view<br/>[logs_table.py]"]
  node_errors["Error handling<br/>[error_handling.py]"]
  node_config["Runtime config<br/>[config.py]"]
end

node_consumer(("Domain app"))
node_dash_user(("App user"))
node_database[("PostgreSQL")]
node_s3[("S3-compatible storage")]
node_broker["Celery broker"]

node_consumer -->|"injects seams"| node_job
node_dash_user -.->|"uses app"| node_layouts
node_job_page -->|"manages jobs"| node_job
node_job_page -->|"lists jobs"| node_db
node_job_page -->|"runs cleanup"| node_maintenance
node_job -->|"uses base"| node_base_job
node_job -->|"uses config model"| node_models
node_job -->|"persists attributes"| node_db
node_job -->|"stores job files"| node_object_storage
node_files_route -->|"serves job files"| node_job
node_celery_app -->|"initializes manager"| node_background
node_celery_app -->|"registers tasks"| node_maintenance
node_background -->|"loads config"| node_celery_config
node_celery_config -->|"reads settings"| node_config
node_background -.->|"dispatches tasks"| node_broker
node_worker_page -->|"monitors workers"| node_background
node_maintenance -->|"cleans job records"| node_db
node_maintenance -->|"deletes job data"| node_object_storage
node_logs_page -->|"queries logs"| node_db
node_logs_page -->|"renders log table"| node_logs_table
node_db -.->|"reads and writes"| node_database
node_object_storage -->|"transfers objects"| node_s3
node_db -->|"reads settings"| node_config
node_object_storage -.->|"reads settings"| node_config
node_job -->|"uses job errors"| node_errors
node_layouts -->|"mounts error UI"| node_errors

click node_layouts "https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/layouts.py"
click node_job_page "https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/pages/job_management.py"
click node_logs_page "https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/pages/logs.py"
click node_worker_page "https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/pages/worker_management.py"
click node_job "https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/job.py"
click node_base_job "https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/base_job.py"
click node_models "https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/pydantic_models.py"
click node_files_route "https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/files_route.py"
click node_background "https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/background_job_manager.py"
click node_celery_app "https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/celery_app.py"
click node_celery_config "https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/celery_config.py"
click node_maintenance "https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/tasks/maintenance_tasks.py"
click node_db "https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/db_manager.py"
click node_object_storage "https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/object_storage_manager.py"
click node_logger "https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/logger.py"
click node_logs_table "https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/logs_table.py"
click node_errors "https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/error_handling.py"
click node_config "https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/config.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_layouts,node_job_page,node_logs_page,node_worker_page,node_dash_user toneBlue
class node_job,node_base_job,node_models,node_files_route,node_database,node_s3 toneAmber
class node_background,node_celery_app,node_celery_config,node_maintenance toneMint
class node_db,node_object_storage,node_logger,node_logs_table,node_errors,node_config toneRose
class node_consumer,node_broker toneIndigo
```

## Components

### App shell

- [Dash shell](https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/layouts.py): `cosmo_suite/layouts.py`
- [Job management](https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/pages/job_management.py): `cosmo_suite/pages/job_management.py`
- [Logs page](https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/pages/logs.py): `cosmo_suite/pages/logs.py`
- [Worker management](https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/pages/worker_management.py): `cosmo_suite/pages/worker_management.py`

### Job lifecycle

- [Job lifecycle](https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/job.py): `cosmo_suite/job.py`
- [Job base](https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/base_job.py): `cosmo_suite/base_job.py`
- [Framework models](https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/pydantic_models.py): `cosmo_suite/pydantic_models.py`
- [Job file route](https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/files_route.py): `cosmo_suite/files_route.py`

### Task operations

- [Task manager](https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/background_job_manager.py): `cosmo_suite/background_job_manager.py`
- [Celery registration](https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/celery_app.py): `cosmo_suite/celery_app.py`
- [Celery configuration](https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/celery_config.py): `cosmo_suite/celery_config.py`
- [Maintenance tasks](https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/tasks/maintenance_tasks.py): `cosmo_suite/tasks/maintenance_tasks.py`

### Persistence and support

- [Database manager](https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/db_manager.py): `cosmo_suite/db_manager.py`
- [Object storage](https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/object_storage_manager.py): `cosmo_suite/object_storage_manager.py`
- [Logging](https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/logger.py): `cosmo_suite/logger.py`
- [Log table view](https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/logs_table.py): `cosmo_suite/logs_table.py`
- [Error handling](https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/error_handling.py): `cosmo_suite/error_handling.py`
- [Runtime config](https://github.com/helmholtz-ufz/cosmosuite/blob/main/cosmo_suite/config.py): `cosmo_suite/config.py`

### Other components

- **Domain app**
- **App user**
- **PostgreSQL**
- **S3-compatible storage**
- **Celery broker**

## Connections

- Domain app → Job lifecycle: injects seams (evidence: `README.md`)
- App user → Dash shell: uses app
- Job management → Job lifecycle: manages jobs (evidence: `cosmo_suite/pages/job_management.py`)
- Job management → Database manager: lists jobs (evidence: `cosmo_suite/pages/job_management.py`)
- Job management → Maintenance tasks: runs cleanup (evidence: `cosmo_suite/pages/job_management.py`)
- Job lifecycle → Job base: uses base (evidence: `cosmo_suite/job.py`)
- Job lifecycle → Framework models: uses config model (evidence: `cosmo_suite/job.py`)
- Job lifecycle → Database manager: persists attributes (evidence: `cosmo_suite/job.py`)
- Job lifecycle → Object storage: stores job files (evidence: `cosmo_suite/job.py`)
- Job file route → Job lifecycle: serves job files (evidence: `cosmo_suite/files_route.py`)
- Celery registration → Task manager: initializes manager (evidence: `cosmo_suite/celery_app.py`)
- Celery registration → Maintenance tasks: registers tasks (evidence: `cosmo_suite/celery_app.py`)
- Task manager → Celery configuration: loads config (evidence: `cosmo_suite/background_job_manager.py`)
- Celery configuration → Runtime config: reads settings (evidence: `cosmo_suite/celery_config.py`)
- Task manager → Celery broker: dispatches tasks
- Worker management → Task manager: monitors workers (evidence: `cosmo_suite/pages/worker_management.py`)
- Maintenance tasks → Database manager: cleans job records (evidence: `cosmo_suite/tasks/maintenance_tasks.py`)
- Maintenance tasks → Object storage: deletes job data (evidence: `cosmo_suite/tasks/maintenance_tasks.py`)
- Logs page → Database manager: queries logs (evidence: `cosmo_suite/pages/logs.py`)
- Logs page → Log table view: renders log table (evidence: `cosmo_suite/pages/logs.py`)
- Database manager → PostgreSQL: reads and writes
- Object storage → S3-compatible storage: transfers objects (evidence: `cosmo_suite/object_storage_manager.py`)
- Database manager → Runtime config: reads settings (evidence: `cosmo_suite/db_manager.py`)
- Object storage → Runtime config: reads settings (evidence: `cosmo_suite/object_storage_manager.py`)
- Job lifecycle → Error handling: uses job errors (evidence: `cosmo_suite/job.py`)
- Dash shell → Error handling: mounts error UI (evidence: `cosmo_suite/layouts.py`)
