$ show astrofox-io/astrofox
Astrofox is a desktop application (Electron + Next.js) for creating audio-reactive motion graphics in real time. It provides a timeline-based editor where users compose layers (2D canvas renderings, 3D geometries, images, videos, text) and apply post-processing effects (blur, glitch, VHS, etc.) that are dynamically modulated by audio analysis via a reactor system. The application supports live input from microphone, desktop audio, and MIDI controllers, and can export videos to file using ffmpeg (desktop) or MediaRecorder (web). The architecture is a monolith with an Electron shell; the UI is a single-page React app with Zustand state management, React Three Fiber for 3D rendering, and a custom WebGL compositor with a pass-based shader pipeline. A plugin system allows external displays and effects via sandboxed workers or shader code. The codebase is extensive but shows signs of technical debt (heavy use of `@ts-nocheck` in many files, legacy migration code, no visible tests). Several subsystems (storage abstraction, audio analysis, compositor passes, ffmpeg wrapper) are well-isolated and could be reused in other projects.
The LLM identified 5 files worth highlighting for reuse:
Provides a unified key-value storage interface with multiple backends: desktop SQLite (via Electron IPC), web localStorage, and in-memory fallback. Includes automatic legacy key migration. The abstraction is self-contained (only imports from sibling modules within the storage package) and can be extracted for use in any Electron or web application requiring simple persistent storage.
Parses raw FFT frequency data from an AudioContext analyzer node into normalized bins (bars) with configurable averaging, smoothing, and range. The class is independent of the UI and can be reused in any audio visualization project. It demonstrates clean separation of concerns and provides a config-driven API.
Base class for composable WebGL post-processing passes in the Three.js render pipeline. Provides a consistent interface for setting up render targets, writing shaders, and chaining passes. The Pass and ShaderPass classes are reusable across any Three.js project that needs a custom post-processing pipeline, and are not coupled to Astrofox-specific logic.
Manages ffmpeg subprocesses from the Electron main process for video encoding. Handles spawning, piping image data, progress reporting, temp file cleanup, and retry logic. This is a standalone utility that can be reused in any Electron application requiring ffmpeg integration, with minimal dependencies on Astrofox internals.
Implements integrity verification for plugin manifests and binaries using cryptographic hashes (SHA-256). Used to ensure plugins have not been tampered with before loading. The logic is self-contained and can be reused in any application with a plugin or extension system that requires integrity checks.