-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
81 lines (64 loc) · 2.88 KB
/
Makefile
File metadata and controls
81 lines (64 loc) · 2.88 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
.PHONY: run dev-frontend clean collect install-frontend format format-backend format-frontend lint lint-backend lint-frontend makemigrations migrate shell createsuperuser help
# Default target when 'make' is run without arguments
.DEFAULT_GOAL := help
help:
@echo "Available commands:"
@echo " run - Starts the Django development server (formats backend code first)"
@echo " dev-frontend - Starts the frontend development server (formats frontend code first)"
@echo " clean - Clears Django session data"
@echo " collect - Collects Django static files"
@echo " install-frontend - Installs frontend dependencies using bun"
@echo " format - Formats both backend (Python) and frontend (JS/TS/CSS) code"
@echo " format-backend - Formats Python code using ruff check and format"
@echo " format-frontend - Formats frontend code using prettier"
@echo " lint - Lints both backend (Python) and frontend (JS/TS/CSS) code"
@echo " lint-backend - Lints Python code using ruff"
@echo " lint-frontend - Lints frontend code using eslint"
@echo " makemigrations - Creates new Django model migrations"
@echo " migrate - Applies Django database migrations"
@echo " shell - Opens a Django shell"
@echo " createsuperuser - Creates a Django superuser account"
run: format-backend
@echo "Starting Django development server..."
uv run manage.py runserver
dev-frontend: format-frontend
@echo "Starting frontend dev server from frontend/ folder..."
cd frontend && bun run dev
clean:
@echo "Clearing Django session data..."
uv run manage.py clearsession
collect:
@echo "Collecting Django static files (confirming 'yes')..."
echo 'yes' | uv run manage.py collectstatic
install-frontend:
@echo "Installing frontend dependencies with bun..."
cd frontend && bun install
format: format-backend format-frontend
@echo "All code formatted successfully!"
format-backend:
@echo "Formatting backend (Python) code with ruff check and format..."
uv run ruff check --select I . --fix && \
uv run ruff format
format-frontend:
@echo "Formatting frontend code with prettier..."
cd frontend && bun run format | grep -v -F '(unchanged)' || true
lint: lint-backend lint-frontend
@echo "All code linted successfully!"
lint-backend: format-backend
@echo "Linting backend (Python) code with ruff..."
uv run ruff check
lint-frontend: format-frontend
@echo "Linting frontend code with eslint..."
cd frontend && bun run lint
makemigrations:
@echo "Creating Django database migrations..."
uv run manage.py makemigrations
migrate:
@echo "Applying Django database migrations..."
uv run manage.py migrate
shell:
@echo "Opening Django shell..."
uv run manage.py shell
createsuperuser:
@echo "Creating Django superuser account..."
uv run manage.py createsuperuser