arbret/Makefile
2025-12-19 00:12:43 +01:00

57 lines
1.2 KiB
Makefile

.PHONY: install-backend install-frontend install backend frontend db db-stop db-ready db-seed dev test test-backend test-frontend test-e2e typecheck
-include .env
export
install-backend:
cd backend && uv sync --all-groups
install-frontend:
cd frontend && npm install
install: install-backend install-frontend
backend:
cd backend && uv run uvicorn main:app --reload
frontend:
cd frontend && npm run dev
db:
docker compose up -d db
db-stop:
docker compose down
db-ready:
@docker compose up -d db
@echo "Waiting for PostgreSQL to be ready..."
@until docker compose exec -T db pg_isready -U postgres > /dev/null 2>&1; do \
sleep 1; \
done
@docker compose exec -T db psql -U postgres -tc "SELECT 1 FROM pg_database WHERE datname = 'arbret_test'" | grep -q 1 || \
docker compose exec -T db psql -U postgres -c "CREATE DATABASE arbret_test"
@echo "PostgreSQL is ready"
db-seed: db-ready
cd backend && uv run python seed.py
dev:
$(MAKE) db-seed
cd backend && uv run uvicorn main:app --reload & \
cd frontend && npm run dev & \
wait
test-backend: db-ready
cd backend && uv run pytest -v
test-frontend:
cd frontend && npm run test
test-e2e:
./scripts/e2e.sh
test: test-backend test-frontend test-e2e
typecheck:
cd backend && uv run mypy .