-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
87 lines (73 loc) · 2.28 KB
/
Copy pathMakefile
File metadata and controls
87 lines (73 loc) · 2.28 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
.PHONY: help install dev build test lint type-check clean docker-build docker-run
# ===== Help =====
help:
@echo "Makefile for Maparr development"
@echo ""
@echo "Usage:"
@echo " make install Install backend and frontend dependencies"
@echo " make dev Run both backend and frontend in development mode"
@echo " make build Build production assets (frontend) and backend wheel"
@echo " make test Run backend tests"
@echo " make lint Run linters (backend + frontend)"
@echo " make type-check Run TypeScript type checking"
@echo " make docker-build Build the Docker image"
@echo " make docker-run Run the Docker container (requires .env)"
@echo ""
@echo "Development:"
@echo " make backend-dev Run backend dev server (uvicorn)"
@echo " make frontend-dev Run frontend dev server (vite)"
@echo ""
@echo "Quality:"
@echo " make format Format code (backend: ruff, frontend: prettier)"
# ===== Installation =====
install:
pip install -e "./backend[dev]"
npm ci --prefix frontend
# ===== Development =====
dev:
@echo "Starting development servers..."
@echo "Backend: http://localhost:8000"
@echo "Frontend: http://localhost:5173 (proxied to backend)"
(@cd backend && uvicorn maparr.main:create_app --factory --reload --host 0.0.0.0 --port 8000) & \
cd frontend && npm run dev
backend-dev:
cd backend && uvicorn maparr.main:create_app --factory --reload --host 0.0.0.0 --port 8000
frontend-dev:
cd frontend && npm run dev
# ===== Build =====
build:
npm run build --prefix frontend
pip wheel --wheel-dir=dist ./backend
# ===== Testing =====
test:
cd backend && pytest
# ===== Linting & Type Checking =====
lint:
ruff check ./backend
npm run lint --prefix frontend
type-check:
npm run type-check --prefix frontend
format:
ruff check --fix ./backend
npm run format --prefix frontend
# ===== Cleaning =====
clean:
rm -rf ./backend/dist ./frontend/dist ./frontend/node_modules
pip cache purge
npm cache clean --force
# ===== Docker =====
docker-build:
docker build -t maparr:latest .
docker-run:
docker run -d \
--name maparr \
-p 8000:8000 \
-v $(PWD)/data:/app/data \
--env-file .env \
maparr:latest
# ===== Utilities =====
shell:
docker run -it --rm \
-v $(PWD):/app \
-w /app \
python:3.11-slim bash