File size: 5,094 Bytes
09fa60b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# AudioForge Setup Status

## Completed Tasks

### 1. Fixed Windows Console Encoding Issues
- Updated all Python scripts to handle Windows console encoding properly
- Fixed `quick_setup.py`, `verify_setup.py`, and `init_db.py` to work on Windows

### 2. Fixed Python Package Configuration
- Updated `pyproject.toml` to support Python 3.13
- Removed incompatible dependencies (torch 2.1.0, audiocraft 1.3.0)
- Created optional `[ml]` dependency group for ML models
- Added hatchling build configuration to specify package location

### 3. Backend Dependencies Installed
- Created virtual environment at `backend/.venv`
- Installed all core dependencies successfully
- Created `.env` file from `.env.example`
- Created storage directories

### 4. Project Structure Verified
- Backend: FastAPI application with proper structure
- Frontend: Next.js 14 application with TypeScript
- Docker Compose configuration ready
- All documentation files in place

## Current Status

**Backend**: Dependencies installed, ready to run (requires PostgreSQL and Redis)
**Frontend**: Not yet installed
**Database**: Not yet initialized
**Docker**: Installed but Docker Desktop not running

## Next Steps

### Option 1: Docker Compose (Recommended)

1. **Start Docker Desktop**
   ```powershell

   # Start Docker Desktop application manually

   ```

2. **Start all services with Docker Compose**
   ```powershell

   docker-compose up -d

   ```

3. **Verify services are running**
   ```powershell

   docker-compose ps

   docker-compose logs -f

   ```

4. **Access the application**
   - Frontend: http://localhost:3000
   - Backend API: http://localhost:8000
   - API Docs: http://localhost:8000/api/docs

### Option 2: Manual Setup (Local Development)

#### Step 1: Start PostgreSQL and Redis

**Option A: Using Docker**
```powershell

# Start only PostgreSQL and Redis

docker run -d --name audioforge-postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=audioforge -p 5432:5432 postgres:16-alpine

docker run -d --name audioforge-redis -p 6379:6379 redis:7-alpine

```

**Option B: Using Local Installation**
- Install PostgreSQL 16 and Redis locally
- Ensure they're running on default ports (5432 and 6379)

#### Step 2: Initialize Database

```powershell

cd backend

.venv\Scripts\python.exe scripts\init_db.py

```

#### Step 3: Start Backend

```powershell

cd backend

.venv\Scripts\uvicorn.exe app.main:app --reload

```

#### Step 4: Install Frontend Dependencies

```powershell

cd frontend

pnpm install

```

#### Step 5: Create Frontend Environment File

```powershell

cd frontend

echo "NEXT_PUBLIC_API_URL=http://localhost:8000" > .env.local

```

#### Step 6: Start Frontend

```powershell

cd frontend

pnpm dev

```

## Verification

### Backend Health Check
```powershell

curl http://localhost:8000/health

```

### Backend API Documentation
Open http://localhost:8000/api/docs in your browser

### Frontend
Open http://localhost:3000 in your browser

## Installing ML Models (Optional)

The ML models (torch, audiocraft) are optional and can be installed later:

```powershell

cd backend

.venv\Scripts\uv.exe pip install -e ".[ml]"

```

**Note**: This will download ~2GB of model files on first run.

## Troubleshooting

### Backend won't start
- Ensure PostgreSQL is running on port 5432
- Ensure Redis is running on port 6379
- Check `.env` file has correct DATABASE_URL and REDIS_URL

### Frontend won't start
- Ensure `pnpm` is installed: `npm install -g pnpm`
- Delete `node_modules` and `pnpm-lock.yaml`, then run `pnpm install` again

### Database connection error
- Verify PostgreSQL is running: `docker ps` or check local service
- Test connection: `psql -h localhost -U postgres -d audioforge`

### Docker issues
- Ensure Docker Desktop is running
- Check Docker daemon status: `docker ps`
- Restart Docker Desktop if needed

## Files Modified

1. `backend/pyproject.toml` - Updated dependencies and build configuration
2. `backend/scripts/quick_setup.py` - Fixed Windows encoding
3. `backend/scripts/verify_setup.py` - Fixed Windows encoding
4. `backend/scripts/init_db.py` - Fixed Windows encoding

## Environment Configuration

### Backend `.env` (already created)
```env

# Application

DEBUG=false

ENVIRONMENT=development



# Database

DATABASE_URL=postgresql+asyncpg://postgres:postgres@localhost:5432/audioforge



# Redis

REDIS_URL=redis://localhost:6379/0



# Music Generation

MUSICGEN_MODEL=facebook/musicgen-medium

MUSICGEN_DEVICE=cpu

MUSICGEN_DURATION=30



# Vocal Generation

BARK_MODEL=suno/bark

BARK_DEVICE=cpu



# Storage

AUDIO_STORAGE_PATH=./storage/audio

```

### Frontend `.env.local` (needs to be created)
```env

NEXT_PUBLIC_API_URL=http://localhost:8000

```

## Recommended Next Action

**For quickest setup**: Start Docker Desktop, then run `docker-compose up -d`

This will start all services (PostgreSQL, Redis, Backend, Frontend) in containers and handle all initialization automatically.