gendesign/Makefile
lekss361 4f034bd86b ops: alembic baseline, pre-commit, TIGER cleanup, pg_dump scripts
- backend/alembic/* — alembic infra (env.py, script.py.mako). versions/ empty
  for now; first migration goes in Stage 2a when models are finalized.
- backend/Dockerfile: bake alembic.ini + alembic/ into the image so
  `docker compose exec backend alembic upgrade head` works in prod.
- backend/db/init/99_drop_unused_extensions.sql + bind-mount in both compose
  files: drops postgis-image's TIGER/topology/fuzzystrmatch on fresh volumes.
- .pre-commit-config.yaml + pre-commit in dev deps: ruff/prettier on commit
  to stop CI failures like UP035 from leaking out.
- ops/backup.sh, ops/restore.sh: pg_dump cron script with optional Selectel S3
  upload. 7-day local retention. Restore guard: requires RESTORE_CONFIRM=yes.
- Makefile: new targets `make migration NAME=...`, `make pre-commit-install`.
- backend/.env.example: SENTRY_DSN comment with sentry.io reference.
2026-04-26 13:08:51 +03:00

48 lines
1.5 KiB
Makefile

.PHONY: help up down logs backend-shell migrate migration test lint typecheck codegen pre-commit-install
help:
@echo "make up - start all services (Postgres, Redis, backend, frontend)"
@echo "make down - stop all services"
@echo "make logs - tail logs from all services"
@echo "make backend-shell - shell into backend container"
@echo "make migrate - run alembic upgrade head"
@echo "make migration NAME=... - autogenerate a new alembic migration"
@echo "make test - run backend pytest"
@echo "make lint - ruff check"
@echo "make typecheck - mypy on core modules"
@echo "make codegen - regenerate frontend TS types from backend OpenAPI"
@echo "make pre-commit-install - install local git hooks (runs ruff/prettier on commit)"
up:
docker compose up -d --build
down:
docker compose down
logs:
docker compose logs -f --tail=100
backend-shell:
docker compose exec backend bash
migrate:
docker compose exec backend alembic upgrade head
migration:
@if [ -z "$(NAME)" ]; then echo "Usage: make migration NAME=add_parcel_table"; exit 1; fi
docker compose exec backend alembic revision --autogenerate -m "$(NAME)"
test:
cd backend && uv run pytest -q
lint:
cd backend && uv run ruff check .
typecheck:
cd backend && uv run mypy app/services/generative app/services/site_finder/scorer.py
codegen:
cd frontend && npm run codegen
pre-commit-install:
pip install pre-commit && pre-commit install