Skip to main content
Version: Development

Local development installation

A disposable, fully working Melodee stack that builds the first-party components from this repository's api/, admin-ui/, auth-ui/ and cli/ directories. It is for development and integration work, not for production or for judging release readiness.

What you get​

ServiceAddress
Admin UIhttps://melodee.localhost:8443/admin/
Auth UIhttps://melodee.localhost:8443/auth/login
API + OpenAPIhttps://melodee.localhost:8443/api/v1/
Mailpit (magic-link inbox)http://127.0.0.1:8025
PostgreSQLinternal only (project volume melodee-dev-postgres)

The HTTPS edge binds 127.0.0.1:8443 only. All four applications share one origin, so cookies, CSRF and WebAuthn behave exactly as in the production shape.

Prerequisites​

  • Linux x86_64 host with Docker Engine and Compose v2.
  • No source outside this repository. The four component directories are built in place.
  • openssl, curl, Python 3.11+, Node 22 with the website dependencies installed (cd website && npm ci, used only for the Chromium verifier), and certutil (nss-tools) for browser trust.

Run ./scripts/dev doctor to check all of this before starting. Component directories can be overridden with MELODEE_API_SRC, MELODEE_ADMIN_UI_SRC, MELODEE_AUTH_UI_SRC and MELODEE_CLI_SRC only for an unusual renamed checkout; no source is expected outside this repository.

Quick start​

./scripts/dev up # configure, build, migrate, register volume, start
./scripts/dev bootstrap --name 'Administrator'
# open the printed URL, complete the challenge, enroll a passkey
./scripts/dev fixtures # 6 synthetic tagged tracks + an album cover
./scripts/dev verify # end-to-end qualification (HTTP, Chromium, CLI)

up is idempotent: an existing dev/dev.env, CA, volumes and data are reused. It never deletes a database, a volume or media.

Commands​

CommandPurpose
./scripts/dev doctorprerequisites, component versions, port conflicts
./scripts/dev configurecredentials, CA/TLS, directories (keeps existing values)
./scripts/dev build [component]build all or one first-party image from source
./scripts/dev up [--no-build]migrate, register the volume, start, wait for readiness
./scripts/dev statuscontainers, /healthz, /readyz, URLs
./scripts/dev logs [service]follow logs
./scripts/dev rebuild apirebuild and restart one component (api, admin-ui, auth-ui, cli)
./scripts/dev stop / startordinary stop/start; data and volumes persist
./scripts/dev bootstrap --name X [--reset]first administrator and one-time challenge
./scripts/dev fixturesgenerate synthetic music into the inbound area
./scripts/dev verifyfull end-to-end qualification
node scripts/dev_auth_boundary.mjsreal-browser authentication-entry qualification (all protected routes, standalone states, magic link, passkey, non-admin, revoked session, logout/Back, API outage, continuations, themes)
./scripts/dev cli <args>bundled CLI against the dev origin
./scripts/dev reset --yesdestructive: delete dev database volumes, library and CLI state

What is pinned and recorded​

  • First-party images are built from the api/, admin-ui/, auth-ui/ and cli/ working trees of this repository; there is no dependency on published ghcr.io Melodee images.
  • PostgreSQL 17.6, nginx 1.29.2 and Mailpit 1.27.8 are pulled by immutable digest.
  • Every build writes dev/build-manifest.json with the consolidated repository revision, component versions, the pinned OpenAPI SHA-256 and the resulting image IDs. These local identities are deliberately kept out of versions.lock.json.
  • All three consumers vendor the same authoritative API contract (1.0.1, 9241a9ab…) and the edge serves it byte-for-byte; make contracts-check enforces that.

HTTPS trust​

./scripts/dev configure creates a private CA and a server certificate for melodee.localhost, localhost and 127.0.0.1, and installs the CA in the user NSS store (~/.pki/nssdb) for Chromium/Firefox. The CLI trusts it through MELODEE_CA_FILE (mounted into the CLI container); certificate validation is never disabled.

melodee.localhost is used because browsers and WebAuthn treat *.localhost as a secure context. curl needs the mapping explicitly:

curl --resolve melodee.localhost:8443:127.0.0.1 \
--cacert dev/secrets/ca/dev-ca.crt https://melodee.localhost:8443/readyz

Authentication​

There is no default password and no bypass. bootstrap prints a one-time challenge; completing it in the browser at /auth/bootstrap creates the session, and a passkey can then be enrolled at /auth/account/passkeys. Magic links are delivered to Mailpit, so the real email flow is exercised without an external provider.

dev verify enrolls a passkey with a Chromium virtual authenticator. Those keys are ephemeral, so verification first verifies a second sign-in path (a dev-verify@melodee.localhost contact through Mailpit) and then removes the disposable passkey; the operator is never locked out. If a verification run is interrupted before that cleanup, ./scripts/dev reset --yes returns a pristine installation.

node scripts/dev_auth_boundary.mjs is the focused authentication-entry qualification. It creates an exact synthetic non-administrator account and a second synthetic admin contact, drives Chromium through every protected administration route, magic-link and passkey sign-in, the standalone loading, redirect, Access Denied and service-unavailable states, invalid continuations, revoked sessions, logout/Back and light/dark themes, then removes exactly those identities, contacts, sessions and passkeys. It captures screenshots under the Admin UI and Auth UI design/evidence/auth-boundary/ directories and a JSON report at dev/evidence/auth-boundary-report.json. It is a local-development qualification, not a production security review.

Isolated namespace and ports​

The default project name is melodee-dev on ports 8443 (HTTPS) and 8025 (Mailpit). To run a second, completely separate installation beside an existing one, select a different namespace and free ports before the first up:

MELODEE_DEV_PROJECT=melodee-baseline \
MELODEE_DEV_IMAGE_PREFIX=melodee-baseline \
MELODEE_DEV_EDGE_PORT=9443 \
MELODEE_DEV_MAILPIT_PORT=9025 \
./scripts/dev up

The project name selects the Compose project, the image prefix and the named volumes (<project>-postgres, <project>-api), so an existing development database, library and CLI state are never reused or deleted.

Persistence and reset​

Database state lives in the melodee-dev-postgres/melodee-dev-api volumes and media/artwork/protected objects live on the dev/data/library volume. stop, start, up and rebuild preserve all of it. Only reset --yes deletes it, and only the dev/ tree is touched. TLS material and dev/dev.env are kept so you do not have to re-trust the CA.

Troubleshooting​

  • Port already in use — up names the port; stop the other process. Ports held by this project's own containers are recognized.
  • readyz reports storage: missing — the volume marker or mount is wrong. Re-run ./scripts/dev up; it registers the volume idempotently.
  • Browser rejects the certificate — re-run ./scripts/dev configure to reinstall the CA in the NSS store, then restart the browser.
  • A passkey was enrolled from a disposable browser — ./scripts/dev reset --yes, then up.
  • CLI cannot trust the endpoint — pass MELODEE_CA_FILE (the launcher already mounts it at /etc/melodee/ca.crt).

Limits​

This is a development topology: single host, synthetic media, Mailpit, no multi-architecture image, no production hardening, no upgrade or backup qualification, and no release publication. dev/build-manifest.json is not a release lock and must not be published as one.