feat: asobi dev - one command to run a local backend#32
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #30 (onboarding upgrade). The no-account, no-key self-host loop:
asobi initscaffolds a Lua game,asobi devruns it locally.Design (architecture-guardian approved, option A)
.asobi/dev-compose.yml(regenerated each run) and shells out todocker compose up, streaming logs. Based on thesdk_demo_backendcompose (robust healthcheck, correctasobi_luaenv).internal/dev; onlycmdDevimports it, so control-plane commands keep zero Docker dependency.devis the no-account/no-key self-host side; it never touches credentials or the control plane. Bridge todeployis just the endpoint URL.--port(default 8084),--dir(auto-detectslua/thengame/).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/registerreturned 200 with aplayer_id+ tokens. Teardown viadocker compose downexitsasobi devcleanly (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.