How sang-buster/aerolex-editor works
Project type and purpose
• This is a full-stack, local-first transcription and subtitle editor:
• Frontend: A SvelteKit/TypeScript web UI for loading audio/video, displaying and editing transcripts in real time, and exporting subtitle formats.
• Backend: A Python CLI tool providing speech-to-text (Whisper), text analysis (Ollama, SpaCy), and format conversion utilities.
File structure
• Top-level:
• frontend/ – SvelteKit app, media UI, components, store, tests
• backend/ – CLI entry point (cli.py), commands (transcribe, models, shell), core libs (audio processing, Whisper engine, formatters), data folders for audio/text/proc.
• No web server: backend is a local CLI. Frontend serves a static web app that reads and writes processed files.
• Configs: package.json, tsconfig, vite.config for frontend; requirements.txt, uv/venv, pre-commit for backend.
README insights
• Emphasis on “local-first”: all data stays in the browser or local filesystem.
• Frontend features: media sync, waveform/spectrogram players, live transcript editing.
• Backend features: Whisper ASR, Ollama LLM summarization, multi-format export.
• Tech Stack: SvelteKit/TailwindCSS/TypeScript; Python/Whisper/Ollama/SpaCy.
Main components and their interactions
a. Components:
1) User’s Browser / UI
– SvelteKit app
– Media Web APIs (audio/video playback)
– UI components (Editor, Players, Panels, Tabs)
– Local store (IndexedDB or in-memory TS store)
2) Filesystem / Local Storage
– Raw audio/video files
– Transcript JSON / subtitle files
3) Backend CLI Tool
– CLI entrypoint (cli.py)
– Command modules: transcribe (calls Whisper), shell, models
– Core modules: audio.py, whisper_engine.py, formatters.py
– Data processing pipeline (data/proc: clean, llm, proc.py)
4) External Engines (all run locally)
– Whisper ASR engine
– Ollama LLM
– SpaCy NLP
b. Relationships / Data flows:
1) User uploads or selects audio/video in the browser → Frontend loads file with Media Web API.
2) Frontend can dispatch “transcribe” jobs by invoking the backend CLI (e.g., via a local shell command or file-based trigger).
3) Backend CLI reads raw audio → uses whisper_engine → produces timestamped text.
4) Optionally backend runs LLM (Ollama) / SpaCy transforms → produces summary or annotated data.
5) Backend writes output files (JSON, SRT, VTT, plaintext) to local storage.
6) Frontend watches/loads these files → displays transcripts → allows live editing → stores deltas back to local store.
7) User exports final subtitles via frontend utilities (formats generated in-browser or via calling formatters).
c. Architectural patterns / design principles:
– Separation of concerns: web UI vs. processing CLI
– Pipeline pattern in backend: raw audio → ASR → NLP → formatting
– Local-first principle: no remote servers, all processing on client/host machine
– Modular commands: each CLI command focuses on one responsibility
– Reactive UI: Svelte stores drive real-time updates on transcript edits
d. Key technologies:
– Frontend: SvelteKit, TypeScript, TailwindCSS, Vite, Media Web APIs
– Backend: Python, Whisper, Ollama, SpaCy, uv/venv, pre-commit, Ruff