- Repo-Struktur für Backend, Frontend, Dokumentation und Gitea-Workflows - FastAPI-Skeleton mit pydantic-settings und RFC-7807-artigem Fehlerformat - Vollständiges Datenmodell (15 Tabellen) als SQLAlchemy-2.0-Modelle - Alembic gegen die Async-Engine inklusive Erstmigration - Idempotenter Seed für den deutschen Kategoriebaum und Standardregeln - Endpunkte /api/health und /api/version - pytest-Infrastruktur mit transaktionsisolierten Fixtures Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014e7t8UpmoVNMtWivY5LiSH
50 lines
1.6 KiB
Makefile
50 lines
1.6 KiB
Makefile
# Entwicklungs-Helfer für moneyfy.
|
|
.DEFAULT_GOAL := help
|
|
BACKEND := backend
|
|
PY := $(BACKEND)/.venv/bin/python
|
|
UV := uv
|
|
|
|
.PHONY: help
|
|
help: ## Verfügbare Ziele anzeigen
|
|
@grep -hE '^[a-zA-Z_-]+:.*?## ' $(MAKEFILE_LIST) \
|
|
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}'
|
|
|
|
.PHONY: install
|
|
install: ## Backend-Abhängigkeiten in .venv installieren
|
|
$(UV) venv --python 3.12 $(BACKEND)/.venv
|
|
cd $(BACKEND) && ../$(BACKEND)/.venv/bin/python -m ensurepip --version >/dev/null 2>&1 || true
|
|
cd $(BACKEND) && $(UV) pip install -e ".[dev]"
|
|
|
|
.PHONY: migrate
|
|
migrate: ## Alembic-Migrationen auf den aktuellen Stand bringen
|
|
cd $(BACKEND) && .venv/bin/alembic upgrade head
|
|
|
|
.PHONY: revision
|
|
revision: ## Neue Migration erzeugen: make revision m="beschreibung"
|
|
cd $(BACKEND) && .venv/bin/alembic revision --autogenerate -m "$(m)"
|
|
|
|
.PHONY: seed
|
|
seed: ## Stammdaten (Kategoriebaum, Benachrichtigungsregeln) anlegen
|
|
cd $(BACKEND) && .venv/bin/python -m app.scripts.seed
|
|
|
|
.PHONY: dev
|
|
dev: ## Backend mit Hot Reload starten
|
|
cd $(BACKEND) && .venv/bin/uvicorn app.main:app --reload --port 8000
|
|
|
|
.PHONY: test
|
|
test: ## Backend-Tests ausführen
|
|
cd $(BACKEND) && .venv/bin/python -m pytest
|
|
|
|
.PHONY: lint
|
|
lint: ## ruff check und Formatprüfung
|
|
cd $(BACKEND) && .venv/bin/ruff check .
|
|
cd $(BACKEND) && .venv/bin/ruff format --check .
|
|
|
|
.PHONY: format
|
|
format: ## Code formatieren und automatisch behebbare Regelverstöße korrigieren
|
|
cd $(BACKEND) && .venv/bin/ruff check --fix .
|
|
cd $(BACKEND) && .venv/bin/ruff format .
|
|
|
|
.PHONY: check
|
|
check: lint test ## Lint und Tests zusammen
|