Repository navigation
feat(dev): scripts/dev.sh — one-shot bootstrapper with cleanup-on-Ctrl+C - #83
Merged
Merged
Conversation
Single command from cold:
bash scripts/dev.sh
Brings up the whole local stack in 7 steps:
1. Prereq check (docker daemon, pnpm, node, ports 3000/4000 free)
2. Generate .env from a dev-safe template if missing
3. pnpm install (skipped if node_modules exists)
4. docker compose up -d (with override for remapped ports 15432/16379/19000/19001)
5. pnpm db:bootstrap (migrate + seed concepts + tracks + problems)
6. Start apps/api on :4000 and apps/web on :3000, logging to .dev-logs/
7. Wait for /health on both, then open browser to localhost:3000
Foreground tails both server logs with [api] / [web] color prefixes. Ctrl+C
fires the trap and stops servers + containers (volumes preserved unless
--fresh). --keep-docker leaves containers running. --down is an orphan-recovery
shortcut for when the bash process gets SIGKILLed without trap firing (kills
anything on 3000/4000, runs compose down).
Default .env wires no-LLM defaults so the app starts without an
ANTHROPIC_API_KEY (per CLAUDE.md self-hosted-first positioning); STORY-070
covers the remaining LLM-required surfaces.
Verified manually:
- Cold start from `docker compose down -v` + no .env + Docker daemon down → 7
steps green, browser opens, real problem renders in /session.
- --down recovers from an orphaned state (containers + servers running, parent
bash dead) — kills PIDs on 3000/4000 + compose down. Zero leftovers.
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.
Summary
One command, cold start to opened-in-browser:
```bash
bash scripts/dev.sh
```
Brings up the whole local dev stack in 7 steps. Ctrl+C cleanly tears everything down.
--downrecovers from orphan state if the bash got SIGKILLed without trapping.--freshwipes volumes.--keep-dockerleaves containers up.Default
.envis wired with no-LLM defaults so the app starts cleanly without anANTHROPIC_API_KEY(the LLM-dependent paths surface graceful empty-states or are filed as STORY-070 follow-ups).Test plan
docker compose down -v+ no.env+ Docker daemon stopped → 7 steps green, browser opens to localhost:3000, real problem renders in/session.--downrecovers from orphan state (containers + servers running, parent bash dead): kills PIDs on 3000/4000 +compose down. Zero leftovers verified.pnpm format:checkclean.🤖 Generated with Claude Code