-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (28 loc) · 1.29 KB
/
Makefile
File metadata and controls
39 lines (28 loc) · 1.29 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
.PHONY: setup setup-backend setup-frontend seed backend frontend test reset clean check-python
PYTHON ?= python3
# First-time setup: install deps, create DB, seed data
setup: check-python setup-backend setup-frontend seed
check-python:
@$(PYTHON) -c 'import sys; v=sys.version_info; assert (3,10) <= (v.major,v.minor) <= (3,13), f"Python 3.10-3.13 required, found {sys.version.split()[0]}"' \
|| (echo ""; echo "Error: Python 3.10-3.13 required. Override with: make setup PYTHON=/path/to/python3.12"; exit 1)
setup-backend:
cd backend && $(PYTHON) -m venv venv && . venv/bin/activate && pip install -r requirements.txt
cd backend && . venv/bin/activate && python manage.py migrate
setup-frontend:
cd frontend && npm install
seed:
cd backend && . venv/bin/activate && python manage.py shell < seed_data.py
# Run the backend (port 8000)
backend:
cd backend && . venv/bin/activate && python manage.py runserver 0.0.0.0:8000
# Run the frontend (port 3000)
frontend:
cd frontend && npm start
# Run backend tests
test:
cd backend && . venv/bin/activate && python manage.py test tasks
# Reset DB and re-seed
reset:
cd backend && rm -f db.sqlite3 && . venv/bin/activate && python manage.py migrate && python manage.py shell < seed_data.py
clean:
rm -rf backend/venv backend/db.sqlite3 frontend/node_modules