Skip to content

feat: asobi dev - one command to run a local backend#32

Merged
Taure merged 1 commit into
mainfrom
feat/asobi-dev
Jul 7, 2026
Merged

feat: asobi dev - one command to run a local backend#32
Taure merged 1 commit into
mainfrom
feat/asobi-dev

Conversation

@Taure

@Taure Taure commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Implements #30 (onboarding upgrade). The no-account, no-key self-host loop: asobi init scaffolds a Lua game, asobi dev runs it locally.

asobi init mygame && cd mygame
asobi dev            # boots Postgres + asobi_lua, serves http://localhost:8084 (+ /ws)

Design (architecture-guardian approved, option A)

  • Compose-orchestrator, not a bundled-Postgres image. Writes a managed compose to .asobi/dev-compose.yml (regenerated each run) and shells out to docker compose up, streaming logs. Based on the sdk_demo_backend compose (robust healthcheck, correct asobi_lua env).
  • Thin internal/dev; only cmdDev imports it, so control-plane commands keep zero Docker dependency.
  • Same tool, not same auth: dev is the no-account/no-key self-host side; it never touches credentials or the control plane. Bridge to deploy is just the endpoint URL.
  • Graceful degradation: Docker missing / Compose v1 / daemon down each yield an actionable message. Ctrl+C is suppressed in the parent so Compose stops its containers cleanly.
  • Flags: --port (default 8084), --dir (auto-detects lua/ then game/).

Verified end-to-end

Booted a real stack from the generated compose (Postgres healthy -> asobi_lua boots + migrates) and registered a player: POST /api/v1/auth/register returned 200 with a player_id + tokens. Teardown via docker compose down exits asobi dev cleanly (exit 0).

Tests

Unit: Lua-dir resolution (lua/ vs game/ vs --dir vs none), compose rendering (port, image, mount, healthcheck). gofmt / go vet / go build / go test ./... all clean.

Scope note

Payoff for this MVP is 'server up + point your client at it' (pairs with asobi init). A bundled browser playground stays out of core per the guardian (asobi_saas owns the console role) - a later optional artifact. Next: asobi_site#80 (samples gallery).

Related: #29 (init --template, merged), #31.

One command boots Postgres + the asobi_lua runtime via Docker Compose,
mounts your Lua (lua/ or game/), streams logs, and serves the API + WS on
localhost. The no-account, no-key self-host loop: pairs with 'asobi init'.

Thin orchestrator in internal/dev - writes a managed compose to
.asobi/dev-compose.yml and shells out to 'docker compose up'. Only cmdDev
imports it, so control-plane commands keep zero Docker dependency. Docker
missing/stopped yields an actionable message; Ctrl+C lets Compose stop
cleanly. Flags: --port (default 8084), --dir.

Closes #30.
@Taure
Taure merged commit 94732be into main Jul 7, 2026
1 check passed
@Taure
Taure deleted the feat/asobi-dev branch July 7, 2026 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant