Hákon Freyr

Autopod

Multi-Tenant Podcast Orchestrator. A multi-tenant podcast automation system built with a Go control plane driving a Python/FastAPI data plane. Handles the full pipeline from audio extraction through transcription, subtitles in English, Icelandic and Polish, summaries, tags and hashtags, extraction of the most quotable clips, thumbnail creation, and multi-platform upload — all with crash-resilient state management and per-customer isolation enforced by directory structure and encryption boundaries.

General notes

  1. Control plane / data plane split: Go orchestrator drives a 7-step pipeline by calling stateless Python/FastAPI endpoints with typed HTTP contracts mirrored across languages
  2. Crash-resilient job state machine with SQLite persistence — every state transition writes to disk before proceeding, GetActiveJobs() resumes all in-flight jobs on startup
  3. Multi-tenancy by construction: per-customer watch directories, age-encrypted secrets decrypted at runtime, namespaced cloud storage on Cloudflare R2
  4. 21 Go tests + 36 Python tests, GitHub Actions CI with -race flag, Docker multi-stage builds

Construction notes

  1. Goroutine semaphore (chan struct{}, capacity 2) with mutex-protected file map preventing watcher re-triggering on pipeline-generated outputs
  2. File stability detection polls size every 2s until stable (30s timeout) to handle large Google Drive sync uploads
  3. Idiomatic Go: internal/ package layout, sql.NullString, table-driven tests, httptest.NewServer for contract verification, error wrapping with %w
  4. OAuth consent flow → token capture → age encrypt → save. Stale flow pruning (10-min TTL)
  5. AI-powered error recovery: ffprobe analysis → Gemini diagnosis → suggested ffmpeg fix → validated execution
  6. Systemd timer for Google Drive sync with randomized delay (thundering herd prevention)

7-step Automated pipeline from ingestion to multi-platform publish

57 Combined Go + Python tests with race detection

2-lang Typed HTTP contracts mirrored across Go and Python

Materials

  • Go
  • Python/FastAPI
  • SQLite
  • Docker
  • Cloudflare R2/Tunnel
Project
Hákon Freyr Gunnarsson
Sheet
Detail J
Title
Autopod
Scale
N.T.S.
Rev
2026-10