generated from coulomb/repo-seed
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:
13
Makefile
13
Makefile
@@ -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
|
COMPOSE = docker compose -f infra/docker-compose.yml --env-file .env
|
||||||
|
|
||||||
@@ -25,9 +25,6 @@ migrate:
|
|||||||
seed:
|
seed:
|
||||||
uv run python scripts/seed.py
|
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).
|
## 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
|
## 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).
|
## 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 "autossh.*$(TUNNEL_PORT)" 2>/dev/null && echo "autossh stopped" || true
|
||||||
@pkill -f "ssh.*-R $(TUNNEL_PORT)" 2>/dev/null && echo "ssh loop 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.
|
## Start (or restart) the full backend — db + migrate + uvicorn.
|
||||||
## If the API is already running it is stopped first; postgres wait is skipped if already up.
|
## Stops uvicorn on :8000 if already running, then starts fresh.
|
||||||
backend: db
|
api: db
|
||||||
@echo "Waiting for postgres..."; \
|
@echo "Waiting for postgres..."; \
|
||||||
for i in 1 2 3 4 5 6 7 8 9 10; do \
|
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; \
|
nc -z 127.0.0.1 5432 2>/dev/null && break; \
|
||||||
@@ -116,7 +113,7 @@ backend: db
|
|||||||
done
|
done
|
||||||
$(MAKE) migrate
|
$(MAKE) migrate
|
||||||
@fuser -k 8000/tcp 2>/dev/null && echo "Stopped running API" || true
|
@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 a project: make register-project DOMAIN=railiance PROJECT_PATH=/home/worsch/railiance
|
||||||
register-project:
|
register-project:
|
||||||
|
|||||||
13
README.md
13
README.md
@@ -36,13 +36,7 @@ make install # uv sync
|
|||||||
make db # docker compose up postgres
|
make db # docker compose up postgres
|
||||||
make migrate # alembic upgrade head (creates 5 tables)
|
make migrate # alembic upgrade head (creates 5 tables)
|
||||||
make seed # insert 6 canonical topics
|
make seed # insert 6 canonical topics
|
||||||
make api # uvicorn :8000 --reload
|
make api # db + migrate + uvicorn :8000 (restarts if running)
|
||||||
```
|
|
||||||
|
|
||||||
### Shortcut
|
|
||||||
|
|
||||||
```bash
|
|
||||||
make backend # db + migrate + api (restarts if already running)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Dashboard
|
### 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 db-tools` | Start postgres + pgadmin (http://127.0.0.1:5050) |
|
||||||
| `make migrate` | `alembic upgrade head` |
|
| `make migrate` | `alembic upgrade head` |
|
||||||
| `make seed` | Insert 6 canonical topics |
|
| `make seed` | Insert 6 canonical topics |
|
||||||
| `make api` | `uvicorn api.main:app --reload` |
|
| `make api` | `db` + wait + `migrate` + `uvicorn` (restarts if running) |
|
||||||
| `make dashboard` | Observable dev server |
|
| `make dashboard` | Observable dev server (restarts if running) |
|
||||||
| `make check` | `curl /state/health` |
|
| `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 register-project DOMAIN=x PROJECT_PATH=y` | Register a project |
|
||||||
| `make clean` | `docker compose down -v` (destroys DB volume) |
|
| `make clean` | `docker compose down -v` (destroys DB volume) |
|
||||||
|
|
||||||
|
|||||||
@@ -39,9 +39,7 @@ To restart the API:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd ~/the-custodian/state-hub
|
cd ~/the-custodian/state-hub
|
||||||
make api # starts uvicorn on 127.0.0.1:8000
|
make api # db + migrate + uvicorn (restarts if already running)
|
||||||
# or, if postgres is not running:
|
|
||||||
make backend # db + migrate + api (restarts if already running)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
Reference in New Issue
Block a user