# Admin billing create/edit plan hotfix (October 14, 2026)
The Create plan form previously called `.trim()` on `max_products` and `yearly_credits`. Svelte's number inputs bind numeric values as numbers (or `undefined` when empty), causing `max_products.trim is not a function` and preventing custom Demo plans from being created.
**Fix:** Both optional limits now normalize to positive/zero safe integers or `null` (unlimited/unset), monthly credits allow `0`, and invalid numeric values show a field-specific error without sending a request. The same correction applies to **Edit plan**.
No migration, API update, or seed is needed. **Deploy the updated web frontend** and reload `/admin/billing`.
This update addresses the remaining English/Croatian/Bulgarian mismatch in existing non-A1 categories. It includes the exact historical v3 locale snapshots, so the seed can identify the old five-section translations and upgrade them **without overriding custom company instructions**. It also updates any exact old structured description formula that would otherwise force the AI to output five H2 sections.
**Run after deploying API + worker + frontend**:
```bash
npm run migrate
npm run seed:category-prompts:i18n -- -dry-run
npm run seed:category-prompts:i18n
```
Check `legacy_upgraded` and `non_a1_legacy_locales_repaired` in the seed output, then reload the category editor. No OpenAI key is needed for the seed. See `docs/seo-prompts-v8.md` and `docs/seo-prompts-all-25-languages.md`.
> **Prompt hotfix v7 (October 2026):** Fixed the API/worker Go compile error, normalized all 25 languages to brace-delimited SEO title/HTML description/meta instructions, and corrected the offline seed's stale shared cache and v6 legacy migration. A1's obsolete meta rule is upgraded, and A1 SEO meta is no longer silently discarded. Run `npm run migrate` then `npm run seed:category-prompts:i18n`. See [docs/seo-prompts-v7.md](docs/seo-prompts-v7.md).
Go API + SvelteKit frontend + PostgreSQL rewrite of Descrybe (no Clerk).
## Stack
- **API:** Go, chi, pgx, sqlc, goose, River jobs
- **Web:** SvelteKit 2, Svelte 5, Tailwind
- **DB:** PostgreSQL 16
- **Migrator:** MySQL → Postgres ETL with Clerk ID remapping
## Local setup (any OS)
Docker Compose runs **Postgres only** (host **:5433**). API, web, and worker run on the host via `npm run setup` + `npm run dev` (fast reload; no Laragon/XAMPP required). OS-specific Docker notes: [docs/docker.md](docs/docker.md). Ports match `docker-compose.yml` + `scripts/dev-ports.mjs`.
**After the stack is up:** operator path (login → feed → process → export) → [docs/getting-started.md](docs/getting-started.md).
npm install && npm run dev # API :28471 + web :28472 + worker (needed for /readyz + jobs)
```
Same on Windows PowerShell, macOS, and Linux (Node scripts; Docker Desktop or Engine + Compose v2). Equivalents: `make setup` then `make` targets / `npm run …`.
Optional: `npm run seed` (demo login) · `npm run health` (`/healthz` + `/readyz`).
### Prerequisites
| Tool | Version / notes |
|------|-----------------|
| **Docker** | Docker Engine + Compose v2 (`docker compose`) — Postgres only on **:5433** |
Do **not** use older docs that mention `:8080` / `:5174` for day-to-day `npm run dev`.
### Environment (one file)
Use a **single root `.env`** (copy from [`.env.example`](.env.example)). Do **not** create `apps/api/.env`. `npm run setup` creates `.env` from the example and fills empty `TOKEN_SIGNING_SECRET` / `APP_ENCRYPTION_KEY` with local random hex (never commit `.env`).
Platform set-password / invite SMTP may still use process `SMTP_*` when you enable live invite mail (see [docs/ops-runtime.md](docs/ops-runtime.md)). Session/encryption fail-closed rules are in `.env.example` and [docs/production-checklist.md](docs/production-checklist.md). Production does **not** require Stripe secrets at boot.
The API/worker load the **monorepo-root**`.env` automatically (`apps/api/internal/config``loadDotEnv`).
`npm run dev` starts **API + web + worker**. Processing jobs and `GET /readyz` need that worker heartbeat (stale after **60s**).
| Script | What runs |
|--------|-----------|
| `npm run dev` / `npm run dev:app` | api + web + worker |
| `npm run dev:backend` / `make backend` | api + worker (no web; enough for `/readyz`) |
| `npm run dev:api` | api only → `/readyz` 503 until a worker is started |
| `npm run dev:worker` | worker only |
| `make worker` / `.\scripts\run-api.ps1 worker` | worker only |
### Verify
```bash
npm run health
# or:
curl -sS http://127.0.0.1:28471/healthz
curl -sS http://127.0.0.1:28471/readyz
```
Open the app: [http://localhost:28472](http://localhost:28472). Demo seed: `npm run seed`.
### Split processes (optional)
```bash
npm run dev:web # web only
npm run dev:api # API only (readyz 503 without worker)
npm run dev:worker # worker only
npm run dev:backend # api + worker
npm run dev:ps1 # PowerShell: api + web + worker
```
### OS notes
- **Windows / macOS / Linux Docker details** (Desktop vs Engine, WSL2, ports): [docs/docker.md](docs/docker.md).
- **Windows:** Docker Desktop running; use `npm run setup` / `npm run migrate` / `npm run seed` (Node) — no Git Bash required. Optional: `.\scripts\migrate.ps1`, `.\scripts\dev.ps1`.
- **macOS / Linux:** same npm commands; `make setup` / `make migrate` work if Make is installed.
- **WSL2:** Docker Desktop WSL integration or Linux engine; keep `DATABASE_URL` on `localhost:5433` from the same environment as the API.
### Troubleshooting: `/readyz` returns 503
`GET /healthz` = process liveness. `GET /readyz` = Postgres ping **and** a fresh worker heartbeat (`worker_id=processing`, stale after **60s**). On worker failure the JSON keeps a short `error` and adds operator `reason` (how to start the host worker). See also [docs/ops-runtime.md](docs/ops-runtime.md) and [docs/production-checklist.md](docs/production-checklist.md).
| Symptom | Meaning | Fix |
|---------|---------|-----|
| `/healthz` 200, `/readyz` 503, `checks.worker` = `missing`, error `worker heartbeat missing` | API up, **worker never started** (or migrations before `039_worker_heartbeats`) | Use `npm run dev` (includes worker), or `npm run dev:worker` / `make worker`; ensure goose is up through **039**. Read JSON `reason`. |
| `/readyz` 503, `checks.worker` = `stale`, error `worker heartbeat stale` | Worker was up but heartbeat older than 60s | Restart the worker; confirm it stays running. Read JSON `reason`. |
| `/readyz` 503, `checks.database` = `fail` / `unavailable` | DB down or bad `DATABASE_URL` | `docker compose ps`, fix URL (host **5433**), re-run migrate |
| `/readyz` still 503 after starting worker | Heartbeat table missing or wrong DB | Re-run migrate; confirm worker and API share the same `DATABASE_URL` |
**Expected:** API-only local (`cmd/api` without `cmd/worker`, or `npm run dev:api`) → `/readyz`**503**. That is not a broken API binary — start the worker (`npm run dev`, `npm run dev:backend`, or `npm run dev:worker`) before treating readiness as green. Jobs on `/processing` also need the worker. Compose does **not** start the worker (Postgres only).
### Routes
| Path | Purpose |
|------|---------|
| `/` | Public marketing homepage (sell copy, FAQ, pricing teaser; no app shell) |
| `/pricing` | Public marketing pricing (Free→Enterprise; no client deals) |
| `/features` | Optional features deep-dive (not primary nav) |
| `/campaigns`, `/seo`, `/brand`, `/marketing/calendar` | Marketing suite |
| `/reviews` | Alias to WooCommerce Reviews tab |
| `/admin/*` | Platform admin |
### Demo login (migrated staging data)
Alias `demo@descrybe.test` is also seeded. Platform admin + **admin of Platform Demo only** (not A1). Default session company: **Platform Demo**. Act for A1 via Admin → Users → Switch to user (`a1-primary@descrybe.local`). Details: [docs/demo-user.md](docs/demo-user.md), [docs/safe-test-fixtures.md](docs/safe-test-fixtures.md).
```bash
npm run seed
# or: node scripts/seed-local.mjs
# or: pwsh -File .\scripts\seed-local.ps1
```
## Migrations
Prefer the cross-platform script (loads root `.env`):
```bash
npm run migrate
# equivalents: node scripts/migrate.mjs | make migrate | .\scripts\migrate.ps1
```
Manual:
```bash
cd apps/api
go run github.com/pressly/goose/v3/cmd/goose@v3.24.3 -dir sql/schema postgres "$DATABASE_URL" up
sqlc generate
```
## Migrator
Live MySQL → staging Postgres load **succeeded** (2026-08-03); production cutover is still **NO-GO** until emails/roles/SMTP login are proven. Evidence: [docs/migration-run-log.md](docs/migration-run-log.md).
```bash
cd apps/api
go run ./cmd/migrator -mysql "$MIGRATE_MYSQL_DSN" -postgres "$DATABASE_URL" -dry-run