# nyniraula/celeste architecture

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

- Interactive diagram: https://gitdiagram.com/nyniraula/celeste
- Repository: https://github.com/nyniraula/celeste

## Overview

1. **Project shape**
   - This is a **Python application** with a small, layered architecture centered on **fetching inputs, processing them through a media pipeline, and exposing a CLI**.
   - The repo is intentionally compact: `core/` for shared domain/runtime services, `input/` for intake and URL handling, `pipeline/` for the download/transform lifecycle, and `ui/` for command-line construction.

2. **Likely entrypoint**
   - `main.py` is the top-level executable entrypoint.
   - It likely wires together configuration, CLI parsing, input selection, and the media pipeline execution.

3. **UI boundary**
   - `ui/cli_builder.py` is the outward-facing command interface.
   - This layer is responsible for translating user intent into application actions, keeping the rest of the system CLI-agnostic.

4. **Input intake subsystem**
   - `input/input_controller.py`, `input/fetcher.py`, and `input/url_handler.py` form the ingestion boundary.
   - This subsystem appears to accept user-supplied inputs, normalize them, and determine whether they are URLs or other supported references before handing them into the core pipeline.

5. **Core orchestration and shared services**
   - `core/config.py` centralizes configuration loading and access.
   - `core/dependency_resolver.py` suggests a service-selection layer, likely choosing the correct handler/strategy based on input type, config, or runtime state.
   - `core/path_router.py` likely resolves filesystem destinations or route-like path decisions for outputs and intermediate artifacts.

6. **Pipeline subsystem**
   - `pipeline/media_pipeline.py` is the main orchestration unit for processing media end-to-end.
   - It likely coordinates the lower-level stages: download, format handling, and cleanup.

7. **Pipeline stages**
   - `pipeline/download.py` handles acquisition of the remote asset.
   - `pipeline/format_handler.py` handles post-download conversion, normalization, or selection of output format.
   - `pipeline/cleanup.py` removes temporary files or intermediate state after successful completion or failure.

8. **Data flow**
   - The typical flow is: **CLI input → input controller/fetcher → URL handling → dependency/path resolution → media pipeline → download → format handling → cleanup**.
   - `data.json` and `config.json` likely provide runtime state and configurable behavior that influence this flow.

9. **Configuration and state boundaries**
   - `config.json` appears to be the main app configuration surface.
   - `data.json` likely stores persistent metadata, cached results, or operational state separate from configuration.
   - Keeping these outside code suggests the app is meant to be configured and run repeatedly without code changes.

10. **Tooling and runtime**
   - `pyproject.toml`, `.python-version`, and `uv.lock` indicate a modern Python project managed with **uv** and pinned dependencies.
   - This matters architecturally because the runtime and dependency set are reproducible, which is important for a downloader/processor that may depend on external libraries or codecs.

11. **Repo boundaries worth diagramming**
   - One boundary is **user interaction vs. processing**: `ui/` should sit outside the core pipeline.
   - Another is **input normalization vs. execution**: `input/` prepares work items, while `pipeline/` performs the actual work.
   - A third is **shared orchestration vs. concrete operations**: `core/` decides and routes, while `pipeline/` executes.

12. **High-level mental model**
   - Treat this repo as a **command-driven media acquisition pipeline** with clear separation between CLI, input parsing, shared decision logic, and processing stages.
   - The architecture is more “layered service pipeline” than a broad framework: each package owns a distinct phase of the workflow.

Main entry points: [`pipeline/media_pipeline.py`](https://github.com/nyniraula/celeste/blob/main/pipeline/media_pipeline.py) (Media Pipeline), [`main.py`](https://github.com/nyniraula/celeste/blob/main/main.py) (Main), [`input/input_controller.py`](https://github.com/nyniraula/celeste/blob/main/input/input_controller.py) (Input Ctrl), [`core/dependency_resolver.py`](https://github.com/nyniraula/celeste/blob/main/core/dependency_resolver.py) (Resolver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_ui["UI"]
  node_main_py(("Main<br/>entrypoint<br/>[main.py]"))
  node_cli_builder["CLI Builder<br/>[cli_builder.py]"]
end

subgraph group_group_input["Input"]
  node_input_controller["Input Ctrl<br/>ingest controller"]
  node_fetcher["Fetcher<br/>[fetcher.py]"]
  node_url_handler["URL Handler<br/>input normalizer<br/>[url_handler.py]"]
end

subgraph group_group_core["Core"]
  node_config_service["Config<br/>[config.py]"]
  node_dependency_resolver["Resolver"]
  node_path_router["Path Router<br/>path routing<br/>[path_router.py]"]
end

subgraph group_group_pipeline["Pipeline"]
  node_media_pipeline["Media Pipeline<br/>orchestrator<br/>[media_pipeline.py]"]
  node_download["Download<br/>acquisition stage<br/>[download.py]"]
  node_format_handler["Format<br/>transform stage<br/>[format_handler.py]"]
  node_cleanup["Cleanup<br/>finalization stage<br/>[cleanup.py]"]
end

node_config_json["Config Data<br/>config file<br/>[config.json]"]
node_data_json["State Data<br/>state file<br/>[data.json]"]

node_main_py -->|"builds CLI"| node_cli_builder
node_main_py -->|"loads config"| node_config_service
node_main_py -->|"accepts input"| node_input_controller
node_main_py -->|"runs pipeline"| node_media_pipeline
node_cli_builder -->|"dispatches"| node_input_controller
node_input_controller -->|"fetches"| node_fetcher
node_input_controller -->|"normalizes urls"| node_url_handler
node_fetcher -->|"resolves"| node_dependency_resolver
node_url_handler -->|"selects handler"| node_dependency_resolver
node_config_json -->|"feeds config"| node_config_service
node_dependency_resolver -->|"routes paths"| node_path_router
node_dependency_resolver -->|"selects flow"| node_media_pipeline
node_media_pipeline -->|"downloads"| node_download
node_media_pipeline -->|"formats"| node_format_handler
node_media_pipeline -->|"cleans up"| node_cleanup
node_path_router -->|"targets output"| node_download
node_data_json -->|"state input"| node_media_pipeline

click node_main_py "https://github.com/nyniraula/celeste/blob/main/main.py"
click node_cli_builder "https://github.com/nyniraula/celeste/blob/main/ui/cli_builder.py"
click node_input_controller "https://github.com/nyniraula/celeste/blob/main/input/input_controller.py"
click node_fetcher "https://github.com/nyniraula/celeste/blob/main/input/fetcher.py"
click node_url_handler "https://github.com/nyniraula/celeste/blob/main/input/url_handler.py"
click node_config_service "https://github.com/nyniraula/celeste/blob/main/core/config.py"
click node_dependency_resolver "https://github.com/nyniraula/celeste/blob/main/core/dependency_resolver.py"
click node_path_router "https://github.com/nyniraula/celeste/blob/main/core/path_router.py"
click node_media_pipeline "https://github.com/nyniraula/celeste/blob/main/pipeline/media_pipeline.py"
click node_download "https://github.com/nyniraula/celeste/blob/main/pipeline/download.py"
click node_format_handler "https://github.com/nyniraula/celeste/blob/main/pipeline/format_handler.py"
click node_cleanup "https://github.com/nyniraula/celeste/blob/main/pipeline/cleanup.py"
click node_config_json "https://github.com/nyniraula/celeste/blob/main/config.json"
click node_data_json "https://github.com/nyniraula/celeste/blob/main/data.json"

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_main_py,node_cli_builder toneBlue
class node_input_controller,node_fetcher,node_url_handler toneAmber
class node_config_service,node_dependency_resolver,node_path_router toneMint
class node_media_pipeline,node_download,node_format_handler,node_cleanup toneRose
class node_config_json,node_data_json toneNeutral
```

## Components

### UI

Command-line construction and user entry boundary

- [Main](https://github.com/nyniraula/celeste/blob/main/main.py): entrypoint · Top-level executable that wires the application together · `main.py`
- [CLI Builder](https://github.com/nyniraula/celeste/blob/main/ui/cli_builder.py): cli · Builds the command interface and translates user intent · `ui/cli_builder.py`

### Input

Input intake, normalization, and URL handling

- [Input Ctrl](https://github.com/nyniraula/celeste/blob/main/input/input_controller.py): ingest controller · Coordinates intake of user-supplied references · `input/input_controller.py`
- [Fetcher](https://github.com/nyniraula/celeste/blob/main/input/fetcher.py): input fetcher · Pulls or prepares incoming input for processing · `input/fetcher.py`
- [URL Handler](https://github.com/nyniraula/celeste/blob/main/input/url_handler.py): input normalizer · Detects and normalizes URL-like inputs · `input/url_handler.py`

### Core

Shared configuration, resolution, and path decisions

- [Config](https://github.com/nyniraula/celeste/blob/main/core/config.py): runtime config · Loads and exposes application configuration · `core/config.py`
- [Resolver](https://github.com/nyniraula/celeste/blob/main/core/dependency_resolver.py): strategy resolver · Selects the appropriate handler or strategy at runtime · `core/dependency_resolver.py`
- [Path Router](https://github.com/nyniraula/celeste/blob/main/core/path_router.py): path routing · Resolves output and intermediate filesystem destinations · `core/path_router.py`

### Pipeline

Media acquisition, transformation, and cleanup

- [Media Pipeline](https://github.com/nyniraula/celeste/blob/main/pipeline/media_pipeline.py): orchestrator · Coordinates the end-to-end media processing flow · `pipeline/media_pipeline.py`
- [Download](https://github.com/nyniraula/celeste/blob/main/pipeline/download.py): acquisition stage · Fetches the remote asset · `pipeline/download.py`
- [Format](https://github.com/nyniraula/celeste/blob/main/pipeline/format_handler.py): transform stage · Normalizes or converts media output format · `pipeline/format_handler.py`
- [Cleanup](https://github.com/nyniraula/celeste/blob/main/pipeline/cleanup.py): finalization stage · Removes temporary files and intermediate state · `pipeline/cleanup.py`

### Other components

- [Config Data](https://github.com/nyniraula/celeste/blob/main/config.json): config file · External runtime configuration surface · `config.json`
- [State Data](https://github.com/nyniraula/celeste/blob/main/data.json): state file · Persistent runtime data or cached metadata · `data.json`

## Connections

- Main → CLI Builder: builds CLI · Executable initializes the command interface
- Main → Config: loads config · Startup wires application settings
- Main → Input Ctrl: accepts input · Entrypoint passes user input into intake
- Main → Media Pipeline: runs pipeline · Top-level execution delegates to processing
- CLI Builder → Input Ctrl: dispatches · CLI actions are translated into intake requests
- Input Ctrl → Fetcher: fetches · Controller delegates intake preparation
- Input Ctrl → URL Handler: normalizes urls · Controller routes URL-like inputs through handler
- Fetcher → Resolver: resolves · Fetched work items are matched to an execution strategy
- URL Handler → Resolver: selects handler · URL parsing informs downstream strategy selection
- Config Data → Config: feeds config · External config file backs runtime settings
- Resolver → Path Router: routes paths · Chosen strategy determines destination routing
- Resolver → Media Pipeline: selects flow · Resolution outcome enters the main processing pipeline
- Media Pipeline → Download: downloads · Orchestrator starts acquisition stage
- Media Pipeline → Format: formats · Orchestrator applies transformation stage
- Media Pipeline → Cleanup: cleans up · Orchestrator finalizes temporary state
- Path Router → Download: targets output · Path decisions guide where downloaded assets land
- State Data → Media Pipeline: state input · Persistent data influences repeated runs or cached state
