An end-to-end application for AI-powered music creation. It combines a Next.js frontend, a Python backend (for generation), and a Node.js backend (for audio processing). Users can describe a mood, theme, or lyrics, and get back a full track with title, tags, and cover art.
👉 Live Demo: https://www.beatflow.art
👉 YouTube Demo: https://youtu.be/cRrX_xsLS1E
The system is split into three main services:
-
Frontend (Next.js + TypeScript)
A web interface where users log in, generate tracks, and manage their music library. -
Python Backend (Modal)
Handles all heavy AI tasks like generating music, lyrics, titles, and cover art. -
Node.js Backend (Express + FFmpeg)
Responsible for post-processing audio before storage (conversion, previews, watermarking).
- Authentication – Handled by Better Auth.
- Music Generation UI – Generate tracks from prompts or lyrics.
- Track Library – Save, browse, and play generated tracks.
- Audio Player – Stream generated music directly.
- State Management – Powered by Zustand.
- Music Generation – Uses
ACEStepPipeline
to turn prompts/lyrics into music. - Lyric Writing – Powered by
Qwen2-7B-Instruct
. - Automatic Titles + Tags – AI-generated for each track.
- Cover Art – Generated using
stabilityai/sdxl-turbo
. - Cloudflare R2 Storage – Uploads outputs (music + art).
- Audio Conversion – WAV → MP3 (with bitrate options).
- Preview Creation – 30s watermarked snippets.
- Redis Queueing – Upstash Redis handles task queues + caching.
- Cloudflare R2 Integration – Downloads raw files, uploads processed versions.
- Neon (Postgres) – Scalable Postgres for storing users, tracks, metadata.
Layer | Stack |
---|---|
Frontend | Next.js (TypeScript), React, TailwindCSS, Zustand, Better Auth |
Database | Neon (Postgres), Upstash Redis |
Python Backend | Modal, PyTorch, Hugging Face Transformers, FastAPI |
Node.js Backend | Express, TypeScript, FFmpeg, Cloudflare R2 |
- Node.js + pnpm
- Python 3.11+
- Modal CLI + account
- Neon Postgres database
- Upstash Redis account
- Cloudflare R2 bucket
cd frontend
pnpm install
cp .env.example .env # add auth, DB, Redis, R2 keys
pnpm dev
cd backend
pip install -r requirements.txt
# set secrets with `modal secret create <name> <value>`
modal deploy main.py
cd node-backend
pnpm install
cp .env.example .env # add S3/R2 credentials, Redis config
pnpm start
Generate a track from a text prompt.
{
"prompt": "A calm lo-fi track with rain sounds"
}
Generate music from custom lyrics.
{
"lyrics": "Under the stars, we fade away...",
"style": "dreamy pop"
}
Auto-generate lyrics from a description, then create a track.
{
"description": "An upbeat motivational anthem with electronic vibes"
}
Convert or preview audio.
{
"songKey": "raw/song123.wav",
"outputKey": "processed/song123.mp3",
"task": "CONVERT_TO_MP3",
"params": { "bitrate": "192k" }
}
Tasks:
CONVERT_TO_MP3
– Full conversionCREATE_PREVIEW
– 30s preview with watermark
Health check – returns "pong"
.
.
├── frontend/ # Next.js (TypeScript) app
├── backend/ # Python backend (Modal + FastAPI)
├── node-backend/ # Node.js backend (Express + FFmpeg)
└── README.md
- Stems generation (vocals, drums, instruments separately)
- User playlists & sharing
- Fine-tuned models per genre/mood
- Real-time collaborative track editing
Contributions welcome — open an issue before submitting a PR.
MIT – free to use, modify, and share.