Samurai is a full-stack web app for musicians, producers, and audio engineers to upload tracks, separate stems (vocals, drums, bass, etc.), preview waveforms, and analyze audio using advanced AI models. Download individual stems or all at once, and get instant insights into your music.
- π€ Upload audio (MP3, WAV, etc.)
- βοΈ AI-powered stem separation (vocals, drums, bass, other)
- ποΈ Waveform preview for original and stems
- π€ AI audio analysis (BPM, key, duration, sample rate, tags, transcription)
- π₯ Download separated stems (individually or as ZIP)
- π·οΈ Tagging and metadata extraction
- β‘ Fast, responsive UI with drag-and-drop support
- π File size badges for uploads and stems
- π₯οΈ Modern, mobile-friendly design
- βοΈ Cloud-ready: Deploy to Render (backend) and Vercel (frontend)
Add screenshots here
| Upload & Analysis | Stems & Player |
|---|---|
![]() |
![]() |
- Frontend: https://samurai-lac.vercel.app/
- Backend: https://samurai-akrb.onrender.com/
- Frontend: React, TypeScript, Tailwind CSS, Wavesurfer.js, Framer Motion
- Backend: Python, Flask, Demucs, Essentia, Gemini AI (for analysis)
- Other: Supabase (Stem Vault), Docker, CI/CD
git clone https://github.com/bantoinese83/samurai.git
cd samurai- Backend:
- Create
server/.envand add:GEMINI_API_KEY=your_gemini_api_key
- Create
- Frontend:
- Create
client/.envand add:VITE_API_URL=https://samurai-akrb.onrender.com VITE_SUPABASE_URL=your_supabase_url VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
- Create
cd server
python3 -m venv ../venv
source ../venv/bin/activate
pip install -r requirements.txt
python audio_api.py- The backend will run at http://localhost:5001 (or use the deployed URL above)
cd ../client
npm install
npm run dev- The frontend will run at http://localhost:5173 (or use the deployed URL above)
Visit http://localhost:5173 or https://samurai-lac.vercel.app/
Build and run the backend in Docker:
docker build -t samurai-backend ./server
docker run -p 5001:5001 --env-file server/.env samurai-backend- Push your code to GitHub.
- Create a new Web Service on Render:
- Root Directory:
server - Build Command:
pip install -r requirements.txt - Start Command:
gunicorn audio_api:app - Add environment variable:
GEMINI_API_KEY
- Root Directory:
- Set up persistent storage if needed for uploads/results.
- Import your repo on Vercel.
- Set project root to
client. - Set build command:
npm run build - Set output directory:
dist - Add environment variables:
VITE_API_URL=https://samurai-akrb.onrender.comVITE_SUPABASE_URL,VITE_SUPABASE_ANON_KEY
- Deploy!
curl -X POST -F "file=@path_to_your_audio.mp3" https://samurai-akrb.onrender.com/separate- Returns: JSON with job ID, progress, audio features, AI analysis, and download links.
- Returns: JSON with current progress and status.
{
"job_id": "unique_job_id",
"status": "completed",
"progress": 100,
"message": "Audio separation completed!",
"audio_features": { "bpm": 120.5, "key": "C major", ... },
"gemini_analysis": { "tags": ["hip-hop", ...], "description": "..." },
"download_url": "https://samurai-akrb.onrender.com/results/yourfile.zip"
}- Backend:
GEMINI_API_KEY(for AI analysis)
- Frontend:
VITE_API_URL(backend URL, e.g.,https://samurai-akrb.onrender.com)VITE_SUPABASE_URL,VITE_SUPABASE_ANON_KEY(for Stem Vault)
samurai/
client/ # React frontend
server/ # Python Flask backend
uploads/ # Uploaded audio files
results/ # Separated stems output
venv/ # Python virtual environment
README.md # This file
- Worker timeout or OOM on Render?
- Free tier has memory/CPU limits. Try smaller files or upgrade your plan.
- Increase Gunicorn timeout with
--timeout 300if needed.
- Gemini AI errors?
- Make sure your API key is valid and has quota.
- AI features are optional; the app works without them.
- Supabase errors?
- Check your Supabase URL and anon key in
.envand Vercel settings.
- Check your Supabase URL and anon key in
- Frontend can't reach backend?
- Make sure
VITE_API_URLis set to your backend's deployed URL.
- Make sure
- CORS issues?
- The backend enables CORS for development; configure as needed for production.
- Fork the repo and create your branch from
main. - Follow code style and best practices (TypeScript, PEP8, etc.).
- Open issues for bugs/feature requests.
- Submit pull requests with clear descriptions.
- See CONTRIBUTING.md for more.
This project is licensed under the MIT License.
- demucs for stem separation
- Essentia for audio analysis
- Wavesurfer.js for waveform rendering
- Google Gemini AI for advanced analysis
- Supabase for cloud storage
- All open source contributors and libraries
- Project Lead: Bryan Antoine
- GitHub: github.com/bantoinese83/samurai
Built with passion for music and technology.


