-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (41 loc) · 1.92 KB
/
Makefile
File metadata and controls
55 lines (41 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Set the user and group IDs in docker compose to the same as the host user so new files belong to the host user
# instead of root.
# This can be changed to your own user/group ID here, though these defaults should be fine for most people.
export MY_UID := 1000
export MY_GID := 1000
sync: ## npm install and uv sync
cd backend && uv sync
cd frontend && pnpm i
build: ## Build backend and frontend Docker images
@echo "Building backend Docker image..."
docker build -f backend/Dockerfile --tag backend:latest backend
lint: ## Run linters
@cd backend && uv run python -c "from app import *" || (echo '🚨 import failed, this means you introduced unprotected imports! 🚨'; exit 1)
@cd backend && uv run ruff check . --fix
@cd backend && uv run black .
@cd backend && uv run isort .
openapi: ## Generate OpenAPI schema from FastAPI app
cd backend && uv run python -c "import app.main; import json; print(json.dumps(app.main.app.openapi()))" > ./openapi.json
cd frontend && pnpm run generate-client
migration: ## Create a new migration
cd backend && read -p "Enter migration name: " name && uv run alembic revision -m "$$name" --autogenerate
upgrade: ## Apply migrations
cd backend && uv run alembic upgrade head
downgrade: ## Apply downgrade migrations
cd backend && uv run alembic downgrade -1
start-frontend: ## Start the development frontend
cd frontend && npm run dev
start-backend: ## Start the development backend
cd backend && uv run fastapi dev app/main.py --port 8000 --host localhost
start-worker: ## Start arq worker
cd backend && uv run arq app.worker.WorkerSettings
test:
cd backend && uv run pytest -v 2>&1
.PHONY: help
.DEFAULT_GOAL := help
help:
@grep -hE '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
# catch-all for any undefined targets - this prevents error messages
# when running things like make npm-install <package>
%:
@: