refactor(makefile): rename backend → api, fold raw uvicorn target in

The old bare `api` target (uvicorn only) is subsumed into the new `api`
target (db + postgres-wait + migrate + fuser-restart + uvicorn). Updated
all doc references and cleaned up duplicate entries left by the rename.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-18 23:20:45 +01:00
parent 8ec8b22c88
commit ebf7c544f6
3 changed files with 9 additions and 21 deletions

View File

@@ -1,4 +1,4 @@
.PHONY: install install-cli db db-tools migrate seed api dashboard check test backend clean register-project validate-adr add-domain rename-domain add-repo list-repos register-path cleanup-stale tunnel tunnel-daemon tunnel-loop tunnel-status tunnel-stop install-hooks install-hooks-all gitea-inventory
.PHONY: install install-cli db db-tools migrate seed api dashboard check test clean register-project validate-adr add-domain rename-domain add-repo list-repos register-path cleanup-stale tunnel tunnel-daemon tunnel-loop tunnel-status tunnel-stop install-hooks install-hooks-all gitea-inventory
COMPOSE = docker compose -f infra/docker-compose.yml --env-file .env
@@ -25,9 +25,6 @@ migrate:
seed:
uv run python scripts/seed.py
api:
uv run uvicorn api.main:app --reload --host 127.0.0.1 --port 8000
## MCP server in SSE/HTTP mode for remote Claude Code sessions (e.g. COULOMBCORE).
## Exposes the same tools as the stdio server over HTTP at http://127.0.0.1:8001/sse
## Remote clients connect via the ops-bridge tunnel (port 18001 on the remote host).
@@ -106,9 +103,9 @@ tunnel-stop:
@pkill -f "autossh.*$(TUNNEL_PORT)" 2>/dev/null && echo "autossh stopped" || true
@pkill -f "ssh.*-R $(TUNNEL_PORT)" 2>/dev/null && echo "ssh loop stopped" || true
## Shortcut: start (or restart) the full backend — db + migrate + api.
## If the API is already running it is stopped first; postgres wait is skipped if already up.
backend: db
## Start (or restart) the full backend — db + migrate + uvicorn.
## Stops uvicorn on :8000 if already running, then starts fresh.
api: db
@echo "Waiting for postgres..."; \
for i in 1 2 3 4 5 6 7 8 9 10; do \
nc -z 127.0.0.1 5432 2>/dev/null && break; \
@@ -116,7 +113,7 @@ backend: db
done
$(MAKE) migrate
@fuser -k 8000/tcp 2>/dev/null && echo "Stopped running API" || true
$(MAKE) api
uv run uvicorn api.main:app --reload --host 127.0.0.1 --port 8000
## Register a project: make register-project DOMAIN=railiance PROJECT_PATH=/home/worsch/railiance
register-project:

View File

@@ -36,13 +36,7 @@ make install # uv sync
make db # docker compose up postgres
make migrate # alembic upgrade head (creates 5 tables)
make seed # insert 6 canonical topics
make api # uvicorn :8000 --reload
```
### Shortcut
```bash
make backend # db + migrate + api (restarts if already running)
make api # db + migrate + uvicorn :8000 (restarts if running)
```
### Dashboard
@@ -71,10 +65,9 @@ custodian register-project # register cwd as a Custodian project
| `make db-tools` | Start postgres + pgadmin (http://127.0.0.1:5050) |
| `make migrate` | `alembic upgrade head` |
| `make seed` | Insert 6 canonical topics |
| `make api` | `uvicorn api.main:app --reload` |
| `make dashboard` | Observable dev server |
| `make api` | `db` + wait + `migrate` + `uvicorn` (restarts if running) |
| `make dashboard` | Observable dev server (restarts if running) |
| `make check` | `curl /state/health` |
| `make backend` | `db` + wait + `migrate` + `api` (restarts if running) |
| `make register-project DOMAIN=x PROJECT_PATH=y` | Register a project |
| `make clean` | `docker compose down -v` (destroys DB volume) |

View File

@@ -39,9 +39,7 @@ To restart the API:
```bash
cd ~/the-custodian/state-hub
make api # starts uvicorn on 127.0.0.1:8000
# or, if postgres is not running:
make backend # db + migrate + api (restarts if already running)
make api # db + migrate + uvicorn (restarts if already running)
```
---