Skip to content

dev: run local slices with bun run dev <slice> - #39

Merged
ShaunSHamilton merged 2 commits into
mainfrom
dev_compose-slices
Nov 7, 2026
Merged

ShaunSHamilton merged 2 commits into
mainfrom
dev_compose-slices

Conversation

@ShaunSHamilton

@ShaunSHamilton ShaunSHamilton commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Summary

One command per slice of the platform, with dependencies, migrations and local S3, in Docker:

bun run dev edd        # eDd + eDb + SeaweedFS, migrated; attached, Ctrl-C stops
bun run dev -d edd     # background, returns once ready; stop with `bun run dev down`
bun run dev edd wapp   # combine slices
bun run dev logs edd | ps | down | reset | compose <args>

Slices: edb, cdb, s3, edd, aapi, wapp, all.

  • compose.dev.yaml: databases extends their own compose.yaml; apps are defined there so a slice never needs another app's required vars. One-shots create cDb's curriculum database, the S3 bucket, and run edb-migrate / cdb-migrate. Apps start after them (service_completed_successfully).
  • Attached (default), like docker compose up: follows logs of the slice's own long-running services; Ctrl-C stops the slice and every service it depends on (passed explicitly, since attached up only stops the services it is given).
  • -d, like docker compose up -d: one-shots (restart: "no") must exit 0, then long-running services must be healthy. Not up --wait alone: it fails on a one-shot that has already exited, and returns before a slow one finishes.
  • SeaweedFS on s3.localhost:18333: a network alias inside Docker and loopback in browsers, so presigned URLs work from both. Dev-only keys in dev/seaweedfs-s3.json.
  • eDd builds with CARGO_PROFILE=dev and runs with MOCK_AUTH=true, so no OAuth credentials: log in through POST /auth/dev/login. eDd does not use cDb, so edd does not start it; all does.
  • apps/examiner-dashboard/Dockerfile: new CARGO_PROFILE arg, default release. Deploy builds unchanged.
  • dev/dev.ts: creates missing databases/*/.env with random passwords, passes them to compose. compose <args> passes arguments through unchanged.
  • package.json: dev now runs slices; previous dev (wApp + eDd client HMR) is dev:client.
  • Docs: CONTRIBUTING "Run", README cheatsheet, eDd S3 note.

Notes

  • Uses the same host ports as the per-directory compose projects: stop those first. Volumes are separate (project exam-platform-dev).
  • Code changes need the slice run again (rebuild). bun run dev:client alongside edd gives client HMR.
  • Volumes migrated before feat(eDd): add s3 object store + test page #38 renamed cDb migration 0002 fail migrate-cdb ("previously applied but has been modified"): bun run dev reset.

Test plan

  • compose.dev.yaml config resolves
  • bun run dev s3: Ctrl-C stops s3-init and s3, command returns after they stop
  • bun run dev -d s3: returns after s3-init exits 0
  • bun run dev -d cdb on fresh volumes: curriculum-db-init, migrate-cdb exit 0, returns 0; on stale volume reports failed: migrate-cdb, exits 1
  • bun run dev compose up -d s3 detaches
  • bun run dev edd after rebase onto feat(eDd): add s3 object store + test page #38: dev login, upload to /api/objects, presigned URL fetch
  • edb / aapi / wapp slices
  • Google login with real GOOGLE_* in the app .env

🤖 Generated with Claude Code

@ShaunSHamilton
ShaunSHamilton added this pull request to stack #40 November 6, 2026 12:37
Comment thread docs/CONTRIBUTING.md Resolved
Base automatically changed from feat_edd-s3 to main November 7, 2026 14:37
ShaunSHamilton and others added 2 commits November 7, 2026 21:22
compose.dev.yaml starts any slice (edb, cdb, s3, edd, aapi, wapp, all) with its
dependencies, migrations and a SeaweedFS curriculum bucket. eDd builds with the
`dev` cargo profile and MOCK_AUTH, so no OAuth credentials are needed. The
Dockerfile's CARGO_PROFILE defaults to release, so deploys are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`bun run dev <slice>` now behaves like `docker compose up`: logs of the
slice's own services follow, Ctrl-C stops the slice and its
dependencies. `-d` behaves like `up -d`: one-shots must exit 0, then
long-running services must be healthy.

`compose` passthrough keeps `-d`/`--detach`.
@ShaunSHamilton
ShaunSHamilton merged commit 4400804 into main Nov 7, 2026
8 checks passed
@ShaunSHamilton
ShaunSHamilton deleted the dev_compose-slices branch November 7, 2026 19:51
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.

2 participants