Skip to Content
BackendCurrent State

Current State

Snapshot

The backend is a FastAPI application with SQLite persistence and inline execution for all workflows. It provides 11 API route modules covering health, assets, episodes, conversions, configs, jobs, outputs, tags, dashboard, and visualization.

All primary workflows are functional end-to-end.

API Surface

Health

  • GET /health

Assets

MethodRouteDescription
POST/assets/registerRegister asset by file path
POST/assets/uploadUpload raw file
POST/assets/register-dialogNative file dialog registration
POST/assets/scan-directoryScan directory for supported files
POST/assets/{asset_id}/indexTrigger indexing via hephaes.Profiler
POST/assets/reindex-allBulk reindex all assets
GET/assetsList with filters (search, tag, file type, status, duration, start-time)
GET/assets/{asset_id}Asset detail with indexed metadata
GET/assets/{asset_id}/episodesList episodes for asset

Tags

MethodRouteDescription
GET/tagsList tag catalog with asset counts
POST/tagsCreate tag
POST/assets/{asset_id}/tagsAttach tag to asset
DELETE/assets/{asset_id}/tags/{tag_id}Detach tag from asset

Episodes and Replay

MethodRouteDescription
GET/assets/{asset_id}/episodes/{episode_id}Episode detail
GET/assets/{asset_id}/episodes/{episode_id}/timelineBucketed timeline data for scrubber
GET/assets/{asset_id}/episodes/{episode_id}/samplesSample windows around timestamp
WS/assets/{asset_id}/episodes/{episode_id}/replayRealtime replay (hello, seek, play, pause, set_speed, set_streams)

Conversions

MethodRouteDescription
POST/conversionsExecute conversion (inline spec, legacy fields, or saved config reference)
GET/conversionsList conversions with filters (including by image payload contract)
GET/conversions/{conversion_id}Conversion detail with representation policy
GET/conversions/capabilitiesBackend capability metadata (policy version, defaults, supported contracts)
POST/conversions/inspectInspect asset topics via hephaes
POST/conversions/draftGenerate draft conversion spec
POST/conversions/previewPreview sample conversion output

Conversion Configs

MethodRouteDescription
GET/conversion-configsList saved configs
POST/conversion-configsCreate saved config
GET/conversion-configs/{config_id}Config detail with migration notes
PATCH/conversion-configs/{config_id}Update config
POST/conversion-configs/{config_id}/duplicateDuplicate config

Saved configs persist JSON-backed spec payloads with immutable revision history. Configs migrate on load through hephaes and surface upgrade notes in responses.

Jobs

MethodRouteDescription
GET/jobsList jobs with type/status filters
GET/jobs/{job_id}Job detail with effective representation policy for conversion jobs

Job types: index, convert, prepare_visualization. Statuses: queued, running, succeeded, failed.

Outputs

MethodRouteDescription
GET/outputsList with filters (format, role, asset, conversion, availability)
GET/outputs/{output_id}Output detail with manifest summary
GET/outputs/{output_id}/contentServe output file content
POST/outputs/{output_id}/actionsTrigger output action
GET/outputs/{output_id}/actionsList actions for output
GET/output-actions/{action_id}Action detail

Output roles: datasets, manifests, reports, sidecars. Only refresh_metadata action is implemented end-to-end. Parquet metadata inspection available via pyarrow.

Dashboard

MethodRouteDescription
GET/dashboard/summaryAggregate counts and freshness timestamps
GET/dashboard/trendsPer-day trend buckets (configurable 1-90 day window)
GET/dashboard/blockersFailed/missing state counts

Visualization

MethodRouteDescription
POST/assets/{asset_id}/episodes/{episode_id}/prepare-visualizationGenerate cached Rerun .rrd
GET/assets/{asset_id}/episodes/{episode_id}/viewer-sourceViewer-source manifest for frontend
Static/visualizations/...Serve prepared visualization files

Cache reuse when matching artifact exists. Cache invalidation when viewer or recording versions change.

Persistence Model

SQLite database with SQLAlchemy 2.0 declarative ORM. Tables:

TableDescription
assetsRegistered files with indexing status (pending/indexing/indexed/failed)
asset_metadataIndexed content (duration, topics, message counts, sensor types)
tagsUser-defined labels with normalized names
asset_tagsMany-to-many asset/tag join
jobsDurable job records with type, status, timestamps
conversionsConversion runs with source IDs, config snapshots, output paths
conversion_configsReusable spec-based templates
conversion_config_revisionsImmutable config change history
conversion_draft_revisionsDraft workflow data with status tracking
output_artifactsOutput files with role, format, availability
output_actionsPost-processing actions on outputs

All tables use UUID primary keys and timezone-aware UTC timestamps.

Tests

17 test modules under tests/ using pytest with httpx for async HTTP testing:

  • Asset registration, listing, filtering, and indexing
  • Conversion CRUD, execution, and authoring workflows
  • Conversion config persistence and revision management
  • Authoring request/response contracts
  • Episode playback and streaming
  • Dashboard summary, trends, and blockers
  • Visualization preparation
  • Job tracking and querying
  • Output artifact management and filtering
  • Tag creation and assignment
  • Image payload contract integration

Known Limitations

  • Conversion execution runs inline in the request path — no worker queue for long-running jobs
  • Only refresh_metadata output action is implemented; other action types are not yet supported
  • The frontend replay route does not yet use the backend viewer-source / cached .rrd flow
  • Some asset list filters (file size, registration date) are applied client-side in the frontend rather than in backend queries
Last updated on