Skip to Content
BackendOverview

Backend Overview

Goal

The Hephaes backend is the local API and orchestration layer for the data pipeline. It connects the desktop UI to the hephaes package for asset registration, authoring, conversion execution, job tracking, and output cataloging.

Local-Only Design

The backend is designed for local use only. It runs on the user’s machine and stores data in the package-owned hephaes workspace (workspace.db) plus local filesystem directories for uploads, outputs, and logs.

There is no authentication, multi-tenancy, or cloud deployment model in the current open-source release.

What It Does

  • Asset management — register, upload, scan directories, index .bag and .mcap files, and manage tags
  • Conversion authoring — inspect asset topics, generate draft specs, preview sample rows, and persist reusable configs with revision history
  • Conversion execution — run conversions via the hephaes library to produce TFRecord or Parquet output
  • Job tracking — durable index and convert job records
  • Output catalog — track output artifacts, surface manifest and artifact metadata, and serve file content directly
  • Dashboard — aggregate summary metrics, trend views, and blocker counts for the local workflow

What It Does Not Do Today

  • replay or visualization APIs
  • output-action APIs
  • authentication, organizations, or cloud-hosted multi-user workflows

Architecture

Frontend (React + Vite / Tauri) <-> Backend (FastAPI) <-> hephaes (Workspace + conversion library) workspace.db + local filesystem

The backend is intentionally thin:

  • hephaes owns workspace persistence, conversion semantics, spec validation, and data processing
  • Backend owns HTTP contracts, local runtime configuration, background job submission, and response mapping
  • Frontend owns presentation and guided user workflows

Stack

LayerTechnology
FrameworkFastAPI (Python 3.11+)
ServerUvicorn (ASGI)
Persistencehephaes workspace SQLite database (workspace.db)
Background jobsIn-process ThreadPoolExecutor wrapper
Conversionhephaes (internal library)
Testingpytest, httpx

Configuration

The backend is configured via environment variables:

VariablePurposeDefault
HEPHAES_BACKEND_DATA_DIRRoot local data directorybackend/data/ (dev) or ~/.hephaes/backend/ (desktop)
HEPHAES_WORKSPACE_ROOTWorkspace storage path<data_dir>/workspace/
HEPHAES_BACKEND_RAW_DATA_DIRStaged uploaded asset files<data_dir>/raw/
HEPHAES_BACKEND_OUTPUTS_DIRConversion output artifacts<data_dir>/outputs/
HEPHAES_BACKEND_LOG_DIRBackend log files<data_dir>/logs/
HEPHAES_DESKTOP_MODEDesktop sidecar mode toggle0
HEPHAES_BACKEND_APP_NAMEFastAPI app titleHephaes Backend
HEPHAES_BACKEND_DEBUGDebug mode0
HEPHAES_BACKEND_CORS_ALLOW_ORIGIN_REGEXCORS origin allowlisthttps?://(localhost|127\.0\.0\.1)(:\d+)?

Code Organization

DirectoryPurpose
app/api/HTTP route handlers
app/services/Business logic and orchestration
app/mappers/Workspace-to-API response mapping
app/schemas/Request/response Pydantic models
app/config.pyEnvironment-based configuration
app/main.pyApp creation, middleware, router registration, lifespan
app/workspace_bootstrap.pyWorkspace bootstrap and resolution
tests/API and sidecar test suite

Future Direction

  • Worker queue for long-running conversion jobs with retry and cancellation support
  • Custom computation scripts as a conversion option
  • Richer backend-side filtering, pagination, and output inspection metadata
Last updated on