Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ Real-time AI music generation platform with a unified API/worker server.
## Tooling
- `pnpm dev`
- `pnpm dev:all`
- `pnpm server`
- `pnpm dev:web`
- `pnpm dev:server`
- `pnpm dev:web:portless`
- `pnpm dev:server:portless`
- `pnpm dev:all:portless`
- `pnpm dev:web:fallback`
- `pnpm dev:server:fallback`
- `pnpm dev:all:fallback`
- `pnpm check`, `pnpm typecheck`, `pnpm test`

## Ports
Expand Down
9 changes: 5 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ Infinitune is an AI-powered infinite music generator. Users describe a vibe via

```bash
# Development
pnpm dev:all # Web + server (2 processes, recommended)
pnpm dev # Vite dev server on :3000
pnpm server # Unified backend on :5175 (API + worker + rooms)
pnpm dev:all # Web + server with Portless (recommended)
pnpm dev # Web app via http://web.localhost:1355
pnpm dev:server # Unified backend via http://api.localhost:1355
pnpm dev:all:fallback # Fixed ports: web :5173, server :5175
pnpm infi --help # Terminal daemon/controller CLI

# Quality
Expand Down Expand Up @@ -120,7 +121,7 @@ Used for `transitionDismissed`, `userPaused`, `userHasInteracted`.

### URL Resolution (apps/web/src/lib/endpoints.ts)

Production Docker builds intentionally leave `VITE_API_URL` empty. The browser auto-detects `window.location.origin` so HTTPS pages get `https://` API and `wss://` WebSocket URLs. Production URL: `https://infinitune.heerlab.com`. Do NOT re-add `VITE_API_URL` to the CI build args or Dockerfile default — this breaks HTTPS deployments with mixed content errors. Local dev uses `VITE_API_URL=http://localhost:5175` from `.env.local`.
Production Docker builds intentionally leave `VITE_API_URL` empty. The browser auto-detects `window.location.origin` so HTTPS pages get `https://` API and `wss://` WebSocket URLs. Production URL: `https://infinitune.heerlab.com`. Do NOT re-add `VITE_API_URL` to the CI build args or Dockerfile default — this breaks HTTPS deployments with mixed content errors. Default local dev uses Portless (`http://web.localhost:1355` -> `http://api.localhost:1355`); fixed-port fallback uses `VITE_API_URL=http://localhost:5175`.

### LLM Client (apps/server/src/external/llm-client.ts)

Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,16 @@ pnpm infi service uninstall
# Install dependencies
pnpm install

# Start everything (web + unified server)
# Start everything (web + unified server) with Portless stable local domains
pnpm dev:all

# Or run with Portless stable local domains
pnpm dev:all:portless
# Fixed-port fallback (Vite :5173, server :5175)
pnpm dev:all:fallback
```

> Fallback mode: web runs on `:5173`, unified backend on `:5175` (`VITE_API_URL=http://localhost:5175`).
> Portless mode: web at `http://web.localhost:1355`, backend API at `http://api.localhost:1355` with `VITE_API_URL` set automatically by scripts.
> Default local dev uses Portless: web at `http://web.localhost:1355`, backend API at `http://api.localhost:1355`, with `VITE_API_URL` and `APP_ORIGIN` set automatically by scripts.
> Fallback mode: use `pnpm dev:all:fallback` to run web on `:5173` and the unified backend on `:5175` (`VITE_API_URL=http://localhost:5175`).
> Backend-only local dev should use `pnpm dev:server`; `pnpm server` is a pnpm built-in command name, not a reliable script entry point.

### Prerequisites

Expand Down
18 changes: 11 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
"private": true,
"type": "module",
"scripts": {
"dev": "pnpm -C apps/web dev",
"server": "pnpm -C apps/server dev",
"dev:all": "pnpm exec concurrently --kill-others-on-fail -n web,server -c blue,magenta \"pnpm dev\" \"LOG_TO_FILE=1 LOG_EVENT_BUS=1 WORKER_DIAGNOSTICS=1 pnpm -C apps/server dev\"",
"dev:web:portless": "VITE_API_URL=http://api.localhost:1355 node_modules/.bin/portless web pnpm -C apps/web dev",
"dev:server:portless": "API_URL=http://api.localhost:1355 node_modules/.bin/portless api pnpm -C apps/server dev",
"dev:all:portless": "pnpm exec concurrently --kill-others-on-fail -n web,server -c blue,magenta \"pnpm dev:web:portless\" \"LOG_TO_FILE=1 LOG_EVENT_BUS=1 WORKER_DIAGNOSTICS=1 pnpm dev:server:portless\"",
"dev": "pnpm dev:web",
"dev:all": "pnpm exec concurrently --kill-others-on-fail -n web,server -c blue,magenta \"pnpm dev:web\" \"LOG_TO_FILE=1 LOG_EVENT_BUS=1 WORKER_DIAGNOSTICS=1 pnpm dev:server\"",
"dev:web": "VITE_API_URL=http://api.localhost:1355 ./node_modules/.bin/portless web pnpm -C apps/web dev",
"dev:server": "API_URL=http://api.localhost:1355 APP_ORIGIN=http://web.localhost:1355 ./node_modules/.bin/portless api pnpm -C apps/server dev",
"dev:web:portless": "pnpm dev:web",
"dev:server:portless": "pnpm dev:server",
"dev:all:portless": "pnpm dev:all",
"dev:web:fallback": "VITE_API_URL=http://localhost:5175 pnpm -C apps/web dev",
"dev:server:fallback": "pnpm -C apps/server dev",
"dev:all:fallback": "pnpm exec concurrently --kill-others-on-fail -n web,server -c blue,magenta \"pnpm dev:web:fallback\" \"LOG_TO_FILE=1 LOG_EVENT_BUS=1 WORKER_DIAGNOSTICS=1 pnpm dev:server:fallback\"",
"infi": "pnpm -C apps/cli infi",
"build": "pnpm --filter @infinitune/web build",
"check": "biome check",
Expand All @@ -17,7 +21,7 @@
"dev:old:api-server": "tsx watch --env-file=.env.local --tsconfig tsconfig.json api-server/index.ts",
"dev:old:worker": "tsx watch --env-file=.env.local --tsconfig tsconfig.json worker/index.ts",
"dev:old:room-server": "tsx watch --env-file=.env.local --tsconfig tsconfig.json room-server/index.ts",
"dev:old:all": "pnpm exec concurrently --kill-others-on-fail -n vite,api,worker,rooms -c blue,magenta,green,yellow \"pnpm dev\" \"pnpm dev:old:api-server\" \"pnpm dev:old:worker\" \"pnpm dev:old:room-server\"",
"dev:old:all": "pnpm exec concurrently --kill-others-on-fail -n vite,api,worker,rooms -c blue,magenta,green,yellow \"pnpm dev:web:fallback\" \"pnpm dev:old:api-server\" \"pnpm dev:old:worker\" \"pnpm dev:old:room-server\"",
"tag:mp3s": "tsx --env-file=.env.local scripts/tag-mp3s.ts",
"react:doctor": "pnpm exec react-doctor . --yes --project @infinitune/web"
},
Expand Down