Spaces:
Build error
Build error
AudioForge Setup Guide
Complete setup guide to get AudioForge running locally without errors.
Prerequisites
- Python 3.11+ (check with
python --version) - Node.js 20+ (check with
node --version) - PostgreSQL 16+ (or use Docker)
- Redis 7+ (or use Docker)
- Docker & Docker Compose (optional, recommended)
Quick Start (Docker)
The easiest way to get started:
# Clone and navigate to project
cd AudioForge
# Start all services
docker-compose up -d
# Backend will be at http://localhost:8000
# Frontend will be at http://localhost:3000
Manual Setup
Backend Setup
Windows (PowerShell)
cd backend
.\scripts\setup.ps1
Linux/macOS
cd backend
chmod +x scripts/setup.sh
./scripts/setup.sh
Manual Steps
- Create virtual environment:
cd backend
python -m venv .venv
# Windows
.venv\Scripts\activate
# Linux/macOS
source .venv/bin/activate
- Install dependencies:
# Install uv (modern Python package manager)
pip install uv
# Install project dependencies
uv pip install -e ".[dev]"
- Configure environment:
# Copy example env file
cp .env.example .env
# Edit .env with your settings
# At minimum, set DATABASE_URL and REDIS_URL
- Start PostgreSQL and Redis:
Option A: Docker
docker-compose up -d postgres redis
Option B: Local Installation
- Install PostgreSQL and start service
- Install Redis and start service
- Update
.envwith connection URLs
- Run database migrations:
alembic upgrade head
- Start backend server:
uvicorn app.main:app --reload
Backend will be available at http://localhost:8000 API docs at http://localhost:8000/api/docs
Frontend Setup
- Install dependencies:
cd frontend
pnpm install
# or: npm install
- Configure environment:
# Create .env.local
echo "NEXT_PUBLIC_API_URL=http://localhost:8000" > .env.local
- Start development server:
pnpm dev
# or: npm run dev
Frontend will be available at http://localhost:3000
Verification
Backend Health Check
curl http://localhost:8000/health
# Should return: {"status":"healthy","version":"0.1.0"}
Frontend Check
Open http://localhost:3000 in your browser. You should see the AudioForge interface.
Common Issues & Solutions
Issue: Database Connection Error
Solution:
- Ensure PostgreSQL is running:
docker-compose psorpg_isready - Check DATABASE_URL in
.envmatches your PostgreSQL setup - Verify database exists:
createdb audioforge(if needed)
Issue: Redis Connection Error
Solution:
- Ensure Redis is running:
docker-compose psorredis-cli ping - Check REDIS_URL in
.env - Redis is optional for basic functionality
Issue: Model Loading Errors
Solution:
- MusicGen models download automatically on first use (can be slow)
- Ensure sufficient disk space (~2GB for models)
- For CPU-only: Set
MUSICGEN_DEVICE=cpuin.env - Models load lazily - first generation may take longer
Issue: Port Already in Use
Solution:
- Backend: Change port in
uvicorncommand or.env - Frontend: Change port in
next.config.jsor usepnpm dev -p 3001 - Stop conflicting services
Issue: Import Errors
Solution:
- Ensure virtual environment is activated
- Reinstall dependencies:
uv pip install -e ".[dev]" - Check Python version:
python --version(needs 3.11+)
Issue: Frontend Build Errors
Solution:
- Clear cache:
rm -rf .next node_modules - Reinstall:
pnpm install - Check Node version:
node --version(needs 20+)
Development Workflow
- Backend changes: Server auto-reloads with
--reloadflag - Frontend changes: Next.js hot-reloads automatically
- Database changes: Create migration:
alembic revision --autogenerate -m "description" - Apply migrations:
alembic upgrade head
Testing
Backend Tests
cd backend
pytest tests/ -v
Frontend Tests
cd frontend
pnpm test
Production Deployment
See ARCHITECTURE.md for production deployment considerations.
Getting Help
- Check logs: Backend logs to console, check for errors
- API docs: http://localhost:8000/api/docs
- Review
ARCHITECTURE.mdfor system design - Check
CONTRIBUTING.mdfor development guidelines