arbret/Makefile

58 lines
1.2 KiB
Makefile
Raw Normal View History

2025-12-19 00:12:43 +01:00
.PHONY: install-backend install-frontend install backend frontend db db-stop db-ready db-seed dev test test-backend test-frontend test-e2e typecheck
2025-12-18 22:42:32 +01:00
-include .env
export
2025-12-18 21:37:28 +01:00
install-backend:
2025-12-18 21:48:41 +01:00
cd backend && uv sync --all-groups
2025-12-18 21:37:28 +01:00
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
2025-12-18 21:48:41 +01:00
db:
docker compose up -d db
db-stop:
docker compose down
2025-12-18 22:08:31 +01:00
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"
2025-12-18 22:42:32 +01:00
db-seed: db-ready
cd backend && uv run python seed.py
2025-12-18 21:48:41 +01:00
dev:
2025-12-18 22:42:32 +01:00
$(MAKE) db-seed
2025-12-18 21:48:41 +01:00
cd backend && uv run uvicorn main:app --reload & \
cd frontend && npm run dev & \
wait
2025-12-18 22:08:31 +01:00
test-backend: db-ready
2025-12-18 21:48:41 +01:00
cd backend && uv run pytest -v
test-frontend:
cd frontend && npm run test
test-e2e:
./scripts/e2e.sh
2025-12-18 23:54:51 +01:00
test: test-backend test-frontend test-e2e
2025-12-19 00:12:43 +01:00
typecheck:
cd backend && uv run mypy .