Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
99 lines (76 loc) · 3.39 KB
/
Copy pathMakefile
File metadata and controls
99 lines (76 loc) · 3.39 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
.PHONY: help \
backend-install backend-makemigrations backend-migrate backend-run \
frontend-install frontend-run-dev frontend-build frontend-run-prod \
local-run local-check test-backend test-frontend test-e2e test-all \
docker-up docker-down docker-build docker-logs \
clean
help:
@echo "Local (no Docker):"
@echo " backend-install Create python venv and install backend requirements"
@echo " backend-makemigrations Create Django migration files from model changes"
@echo " backend-migrate Run Django migrations"
@echo " backend-run Run Django dev server"
@echo " frontend-install Install frontend dependencies"
@echo " frontend-run-dev Run Next.js dev server"
@echo " frontend-build Build Next.js for production"
@echo " frontend-run-prod Run Next.js production server"
@echo " local-run Run Django and Next.js together (ports 8001 and 3000)"
@echo " local-check Smoke-test startup, proxying, and clean shutdown"
@echo " test-backend Run Django tests and migration checks"
@echo " test-frontend Run frontend lint and production build"
@echo " test-e2e Run Playwright browser tests"
@echo " test-all Run all backend, frontend, and browser checks"
@echo ""
@echo "Docker:"
@echo " docker-up Build images (if needed) and start all services"
@echo " docker-build Force rebuild images and start all services"
@echo " docker-down Stop and remove containers"
@echo " docker-logs Tail logs from all services"
@echo ""
@echo " clean Remove backend venv and node_modules"
# ── Local ────────────────────────────────────────────────────────────────────
backend-install:
@if [ ! -d backend/venv ]; then \
cd backend && python3 -m venv venv; \
fi
cd backend && venv/bin/pip install -r requirements.txt
backend-makemigrations:
cd backend && venv/bin/python manage.py makemigrations
backend-migrate:
cd backend && venv/bin/python manage.py migrate
backend-run:
cd backend && venv/bin/python manage.py runserver
frontend-install:
cd frontend && npm install
frontend-run-dev:
cd frontend && npm run dev
frontend-build:
cd frontend && npm run build
frontend-run-prod:
cd frontend && npm start
local-run:
./scripts/run-local.sh
local-check:
./scripts/check-local.sh
test-backend:
cd backend && venv/bin/python manage.py test
cd backend && venv/bin/python manage.py makemigrations --check --dry-run
cd backend && venv/bin/python manage.py check
test-frontend:
cd frontend && npm run lint
cd frontend && npm run build
test-e2e:
cd frontend && npm run test:e2e
test-all: test-backend test-frontend test-e2e
# ── Docker ───────────────────────────────────────────────────────────────────
docker-up:
docker compose up
docker-build:
docker compose up --build
docker-down:
docker compose down
docker-logs:
docker compose logs -f
# ── Misc ─────────────────────────────────────────────────────────────────────
clean:
rm -rf backend/venv frontend/node_modules