-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
96 lines (73 loc) · 2.87 KB
/
Makefile
File metadata and controls
96 lines (73 loc) · 2.87 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
.PHONY: build build-dev build-prod run dev dev-api dev-fe dev-watch \
test clean install build-fe fmt check kill-port \
docker-up docker-down docker-build docker-logs docker-clean
# ── Local Development ────────────────────────────────────────────────
#
# make dev → starts API + Vite in parallel (open http://localhost:5173)
# make dev-fe → frontend only (assumes API already running)
# make dev-api → backend only
# make dev-watch → backend with auto-reload (needs: cargo install cargo-watch)
## Run backend + frontend in parallel (recommended for local dev)
dev:
@echo "→ API on http://localhost:8473"
@echo "→ App on http://localhost:5173 (proxies /api → :8473)"
@$(MAKE) -j2 dev-api dev-fe
## Run only the backend (with dev seed data)
dev-api:
cargo run --bin fishnet --features dev-seed
## Run only the frontend (Vite dev server, proxies /api to backend)
dev-fe:
cd dashboard && npm run dev
## Run backend with auto-reload on file changes (with dev seed data)
dev-watch:
cargo watch -x 'run --bin fishnet --features dev-seed'
# ── Build ────────────────────────────────────────────────────────────
## Build the Rust backend (release)
build:
cargo build --release
## Build the Rust backend (debug, with dev seed data)
build-dev:
cargo build --features dev-seed
## Build single production binary with embedded dashboard
build-prod: build-fe
cargo build --release --features embed-dashboard
## Build the frontend for production
build-fe:
cd dashboard && npm run build
## Install frontend dependencies
install:
cd dashboard && npm install
# ── Quality ──────────────────────────────────────────────────────────
## Run Rust tests
test:
cargo test
## Format Rust code
fmt:
cargo fmt
## Run clippy lints
check:
cargo clippy -- -D warnings
## Kill any process using the Fishnet port (8473)
kill-port:
@lsof -ti :8473 | xargs kill 2>/dev/null || true
@echo "→ Port 8473 is free"
## Remove all build artifacts
clean:
cargo clean
rm -rf dashboard/dist
# ── Docker ───────────────────────────────────────────────────────────
## Build and start the container
docker-up:
docker compose up --build -d
## Stop the container
docker-down:
docker compose down
## Build Docker image without starting
docker-build:
docker compose build
## Tail container logs
docker-logs:
docker compose logs -f
## Remove container, volume, and image
docker-clean:
docker compose down -v --rmi local