AI-powered music generation ecosystem. Combines a Python AI inference engine (Modal) with a Node.js processing backend to turn user prompts into full tracks with auto-generated lyrics and cover art.
Building a high-quality AI music generator requires multiple distinct services. You need heavy GPU compute to run synthesis models, LLMs to generate creative lyrics, and image models to generate cover art. Running all this synchronously on a single server leads to massive timeouts and crashes.
Furthermore, the raw `.wav` output from AI models is enormous. Serving uncompressed audio to thousands of frontend users directly from a GPU worker creates unbearable latency and bandwidth costs.
Beatflow implements a highly decoupled microservices architecture. A Python backend deployed on Modal orchestrates the heavy AI models (ACEStepPipeline, Qwen2, and SDXL-Turbo) using serverless GPUs.
Simultaneously, a dedicated Node.js/Express backend handles all post-processing via FFmpeg. It watches an Upstash Redis queue, pulls the raw AI audio, compresses it to MP3, generates 30-second watermarked previews, and offloads the final assets to Cloudflare R2 for zero-egress CDN delivery.
A multi-tier architecture decoupling the Next.js frontend, Python GPU inference engine, and Node.js audio processing worker via Upstash Redis.