Skip to Content
BackendOverview

Backend Overview

Goal

The Hephaes backend is the API and orchestration layer for the local data pipeline. It manages asset registration, indexing, conversion execution, job tracking, and output cataloging — connecting the frontend UI to the hephaes conversion library.

Local-Only Design

The backend is designed for local use only. It runs on the user’s machine, stores data on the local filesystem, and uses SQLite for persistence. There is no authentication, multi-tenancy, or cloud deployment model in the current release.

What It Does

  • Asset management — register, upload, scan directories, index MCAP files, and manage tags
  • Conversion authoring — inspect asset topics, draft conversion specs, preview sample output, and persist reusable configs with revision history
  • Conversion execution — run conversions via the hephaes library to produce TFRecord or Parquet output
  • Job tracking — durable job records for indexing, conversion, and visualization preparation
  • Output catalog — track output artifacts with metadata, filtering, content serving, and post-processing actions
  • Episode replay — serve timeline data, sample windows, and realtime websocket streaming for episode playback
  • Dashboard — aggregate metrics, trend views, and blocker rollups
  • Visualization — generate and cache Rerun .rrd artifacts for episode visualization

Architecture

Frontend (Next.js) ←→ Backend (FastAPI) ←→ hephaes (Python library) SQLite + Filesystem

The backend is a thin orchestration layer:

  • hephaes owns conversion semantics, encoding behavior, spec validation, and data processing
  • Backend owns HTTP contracts, persistence, policy exposure, job lifecycle, and migration signaling
  • Frontend owns presentation and guided user workflows based on backend contracts

Stack

LayerTechnology
FrameworkFastAPI (Python 3.11+)
ServerUvicorn (ASGI)
DatabaseSQLite via SQLAlchemy 2.0
Realtimewebsockets (episode replay)
VisualizationRerun SDK 0.22
Conversionhephaes (internal library)
Testingpytest, httpx

Configuration

The backend is configured via environment variables:

VariablePurposeDefault
HEPHAES_BACKEND_DATA_DIRLocal data directorybackend/data
HEPHAES_BACKEND_RAW_DATA_DIRRaw asset storagedata/raw
HEPHAES_BACKEND_OUTPUTS_DIRConversion outputsdata/outputs
HEPHAES_BACKEND_DB_PATHSQLite database filedata/app.db
HEPHAES_BACKEND_DEBUGDebug modefalse

Code Organization

DirectoryPurpose
app/api/HTTP route handlers (thin layer)
app/services/Business logic and orchestration
app/db/models.pySQLAlchemy ORM models
app/schemas/Request/response Pydantic models
app/config.pyEnvironment-based configuration
app/main.pyApp creation, CORS, router registration, lifespan
tests/API test suite (17 test modules)

Future Direction

  • Worker queue for long-running conversion jobs (currently inline)
  • Custom computation scripts as a conversion option
  • Cloud-hosted deployment model beyond local use
  • Expanded output action support beyond refresh_metadata
Last updated on