Integrate MusicGPT API generation into booth-musicgpt v0.7.0

This commit is contained in:
Troll (Hermes Agent) 2026-08-10 22:01:08 +00:00
parent 99855b1212
commit 2ca148be9b
12 changed files with 721 additions and 44 deletions

View file

@ -1,8 +1,10 @@
# Theme Song Booth
# Theme Song Booth (MusicGPT Edition)
**Version:** `v0.6.3`
**Version:** `v0.7.0`
A Flask web application for running a convention booth where visitors request a custom AI-generated theme song. Operators manage the queue from an admin dashboard, generate Suno prompts, upload MP3 previews, collect payment, and deliver final songs by email.
A Flask web application for running a convention booth where visitors request a custom AI-generated theme song. Operators manage the queue from an admin dashboard, generate prompts via Hermes, queue generations through the MusicGPT API, and deliver final songs by email.
The MusicGPT fork automates song generation: instead of manually creating songs in Suno and uploading MP3s, the operator saves a title/style/lyrics prompt and clicks **Generate A/B with MusicGPT**. The API returns two MP3 versions (plus WAVs and an album cover) and posts status updates to a webhook.
---
@ -25,12 +27,12 @@ A Flask web application for running a convention booth where visitors request a
## What the booth does
1. A visitor fills out a short form at `/request`.
2. The operator reviews the request in the admin dashboard and generates a Suno Custom Mode prompt.
3. The operator (or an AI assistant via the `/api/prompt` callback) saves the prompt to the request.
4. The operator creates two song versions in Suno, downloads them, and uploads **Version A** and **Version B** to the request page.
2. The operator reviews the request in the admin dashboard and generates a prompt for MusicGPT (manually or via the `/api/prompt` Hermes callback).
3. The operator saves the title, style, and lyrics to the request.
4. The operator clicks **Generate A/B with MusicGPT**, selects a model, and waits for the webhook to complete. MusicGPT produces two MP3 versions, WAVs, and an album cover.
5. The operator sends a preview email; the customer visits their private player page, listens to both versions, and either approves one/both or requests changes.
6. After the customer approves and pays, the operator records the payment reference and delivers the selected MP3(s) by email.
7. Optional stems / extras can be delivered via a share link that appears on the player page after delivery.
6. After the customer approves and pays, the operator records the payment reference and delivers the selected MP3(s) — optionally with WAV files and the album cover — by email.
7. Optional STEMS can be generated for an extra fee and delivered via a share link.
---
@ -74,10 +76,10 @@ The selected pronouns are stored in the `pronouns` column and included in confir
|------|------|---------|
| Login | `/admin/login` | Simple session-based login. Password comes from the `ADMIN_PASSWORD` environment variable. |
| Dashboard | `/admin` | Main queue. Filter by status and auto-refresh at a configurable interval. |
| Request detail | `/admin/request/<id>` | Full control of one request: edit customer info (including pronouns and structured style), save prompt, copy Hermes callback, view revision history, upload MP3s, send preview, record payment, deliver files, add operator notes, and cancel. |
| Pricing | `/admin/pricing` | Configure fixed prices (one song, both songs, WAV per song, STEMs per song) and up to 5 custom items. |
| Request detail | `/admin/request/<id>` | Full control of one request: edit customer info, save prompt, copy Hermes callback, queue MusicGPT generation, view status/cost, view revision history, upload MP3 overrides, send preview, record payment, deliver files (MP3/WAV/cover), add operator notes, cancel generation, and generate STEMS. |
| Pricing | `/admin/pricing` | Configure fixed prices and up to 5 custom items. Also shows running MusicGPT cost totals in USD. |
| Sales | `/admin/sales` | Report of all delivered requests with customer details and Square payment references. |
| Settings | `/admin/settings` | Database health, backups, SMTP config, MP3 metadata defaults, revision limit, auto-refresh interval, kiosk mode, booth open/closed switch, Hermes API key management, and system reset. |
| Settings | `/admin/settings` | Database health, backups, SMTP config, MP3 metadata defaults, revision limit, auto-refresh interval, kiosk mode, booth open/closed switch, Hermes API key management, MusicGPT webhook URL, album cover delivery toggle, and system reset. |
| Reset | `/admin/reset` | Clears all requests and uploaded files. Requires admin password confirmation. |
---
@ -90,9 +92,9 @@ pending → prompt_ready → songs_uploaded → awaiting_payment → paid → de
| Status | Meaning |
|--------|---------|
| `pending` | Customer submitted; waiting for a Suno prompt. |
| `pending` | Customer submitted; waiting for a prompt. |
| `prompt_ready` | Prompt saved; ready to generate songs. |
| `songs_uploaded` | Both MP3s uploaded; preview link can be sent. |
| `songs_uploaded` | Both MP3s are ready; preview link can be sent. |
| `revisions_requested` | Customer asked for changes; current files archived. |
| `awaiting_payment` | Customer approved a version; waiting for payment. |
| `paid` | Payment recorded. |
@ -162,20 +164,20 @@ Use the output for `APP_SECRET_KEY`.
1. Log in to Portainer.
2. Go to **Stacks****Add stack**.
3. Choose **Repository**:
- URL: `https://gitlab.hallsworth.ca/yrtria/theme-song-booth.git`
- URL: `https://gitlab.hallsworth.ca/yrtria/booth-musicgpt.git`
- Branch: `main`
- Compose path: `docker-compose.yml`
4. Add the environment variables listed in the section below.
5. Deploy the stack.
6. Open a console in the running `theme-song-booth` container and run once:
6. Open a console in the running `booth-musicgpt` container and run once:
```bash
python init_db.py
```
7. Point your reverse proxy at the host port you chose (default `127.0.0.1:8000`).
8. Visit `/admin/settings` and click **Regenerate API Key**.
9. Copy the key to your Hermes skill / AI assistant.
8. Visit `/admin/settings`, confirm the MusicGPT webhook URL, and configure the MusicGPT account webhook endpoint.
9. Copy the Hermes API key to your Hermes skill / AI assistant.
10. Print or display a QR code pointing to `https://your-domain/request`.
### Updating the deployment
@ -183,7 +185,7 @@ python init_db.py
After each push to Gitea:
```text
Portainer → Stacks → theme-song-booth → Pull and redeploy
Portainer → Stacks → booth-musicgpt → Pull and redeploy
```
Persistent volumes keep the database and uploads safe across redeploys.
@ -208,9 +210,10 @@ Persistent volumes keep the database and uploads safe across redeploys.
| `PRICE_PER_VERSION` | No | `10.00` | Legacy price label shown in some templates; current pricing is configured from `/admin/pricing`. |
| `CURRENCY` | No | `CAD` | Currency label shown with prices. |
| `MAX_REVISIONS` | No | `2` | Default customer revision limit before an operator override. |
| `HERMES_API_KEY` | No | — | API key for the `/api/prompt` callback. If omitted, generate one from `/admin/settings`. |
| `HERMES_API_KEY` | No | — | API key for the `/api/prompt` callback. |
| `MUSICGPT_API_KEY` | Yes | — | API key for MusicGPT generation and status polling. |
| `DATABASE` | No | `/app/data/booth.db` | Path to the SQLite database inside the container. |
| `UPLOAD_FOLDER` | No | `/app/uploads` | Path to uploaded MP3 storage inside the container. |
| `UPLOAD_FOLDER` | No | `/app/uploads` | Path to uploaded/downloaded song storage inside the container. |
---
@ -235,7 +238,7 @@ Persistent volumes keep the database and uploads safe across redeploys.
## Local development
```bash
cd /home/jess/workspace/theme-song-booth
cd /home/jess/workspace/booth-musicgpt
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
cp .env.example .env