-
Notifications
You must be signed in to change notification settings - Fork 416
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (53 loc) · 2.04 KB
/
Copy pathMakefile
File metadata and controls
76 lines (53 loc) · 2.04 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
.PHONY: help setup dev server worker tailwind test lint format typecheck migrate migrations docker-up docker-down docker-build
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
# Setup
setup: ## Initial project setup (copy env, install deps, migrate)
@test -f .env || cp .env.example .env
pip install -r requirements.txt
cd theme/static_src && npm install
python manage.py migrate
@echo ""
@echo "Setup complete. Run 'python manage.py createsuperuser' to create an admin account."
@echo "Then run 'make dev' to start the app."
# Development
dev: ## Start Django server, worker, and Tailwind watcher (requires 3 terminals)
@echo "Start these in separate terminals:"
@echo " make server - Django dev server"
@echo " make worker - Background task worker"
@echo " make tailwind - Tailwind CSS watcher"
server: ## Start Django dev server
python manage.py runserver
worker: ## Start background task worker
python manage.py process_tasks
tailwind: ## Start Tailwind CSS watcher
cd theme/static_src && npm run start
# Database
migrate: ## Run database migrations
python manage.py migrate
migrations: ## Create new migrations
python manage.py makemigrations
# Code quality
test: ## Run tests
pytest
test-cov: ## Run tests with coverage
pytest --cov=apps --cov-report=term-missing
lint: ## Run linter and format check
ruff check .
ruff format --check .
format: ## Auto-fix lint and formatting issues
ruff check --fix .
ruff format .
typecheck: ## Run mypy type checker
mypy apps/ config/ providers/ tests/ --ignore-missing-imports
# Docker
docker-up: ## Start all Docker services
docker compose up -d
docker-down: ## Stop all Docker services
docker compose down
docker-build: ## Rebuild Docker images
docker compose build
docker-logs: ## Tail logs from all Docker services
docker compose logs -f
docker-prod: ## Start production Docker setup (with Caddy)
docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d