-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
143 lines (105 loc) · 3.87 KB
/
Copy pathjustfile
File metadata and controls
143 lines (105 loc) · 3.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# Mithril Forge — task runner
# Run `just` to see all available recipes.
#
# Required tooling: bun, ./gradlew, docker
# Postgres comes up automatically via Spring Boot Docker Compose Support on `bootRun`.
set shell := ["bash", "-cu"]
# Default: list all recipes
default:
@just --list
# --- Development ---------------------------------------------------------
# Start backend + frontend in parallel (Postgres auto-managed by Spring Boot)
# Ctrl+C cleanly shuts down both processes via SIGTERM propagation.
dev: sync-assets
#!/usr/bin/env bash
set -euo pipefail
trap 'echo "Shutting down..."; kill 0' EXIT INT TERM
./gradlew :backend:bootRun --console=plain &
(cd frontend && bun run dev) &
wait
# Backend only
dev-backend:
./gradlew :backend:bootRun
# Frontend only (assumes backend already on :8080)
dev-frontend:
cd frontend && bun run dev
# --- Build ---------------------------------------------------------------
# Build the deployable Single-JAR (frontend bundled into backend)
build: sync-assets
./gradlew :backend:bootJar
# Clean build from scratch
build-clean:
./gradlew :backend:clean :backend:bootJar
# --- Testing -------------------------------------------------------------
# Run all tests (backend + frontend)
test: test-backend test-frontend
test-backend:
./gradlew :backend:test
test-frontend:
cd frontend && bun run test
# Run End-to-End Tests via Playwright
test-e2e:
cd frontend && bun run test:e2e
# Start backend + frontend with E2E Profile for isolated testing
test-e2e-stack:
#!/usr/bin/env bash
set -euo pipefail
trap 'echo "Shutting down..."; kill 0' EXIT INT TERM
./gradlew :backend:bootRun --args='--spring.profiles.active=e2e' --console=plain &
(cd frontend && VITE_BACKEND_URL=http://localhost:8081 bun run dev --port 5174) &
wait
# --- Quality -------------------------------------------------------------
lint: lint-backend lint-frontend lint-docs
lint-backend:
./gradlew :backend:ktlintFormat
lint-frontend:
cd frontend && bun run lint
lint-docs:
cd documentation && bun run lint
format-docs:
cd documentation && bun run format
typecheck: typecheck-frontend typecheck-docs
typecheck-frontend:
cd frontend && bun run typecheck
typecheck-docs:
cd documentation && bun run check
# Run everything CI checks locally
check: lint typecheck build-docs test test-e2e
# --- Database ------------------------------------------------------------
# Manually start the Postgres dev container (usually unnecessary — Spring
# Boot Docker Compose Support brings it up on `bootRun`).
db-up:
docker compose up -d postgres
db-down:
docker compose down
# Wipe volumes and restart fresh
db-reset:
docker compose down -v
docker compose up -d postgres
# --- Documentation -------------------------------------------------------
# Start the Starlight documentation dev server
dev-docs: sync-assets
cd documentation && bun run dev
# Build the documentation for production
build-docs: sync-assets
cd documentation && bun run build
# --- Assets --------------------------------------------------------------
# Sync shared assets to their respective application public folders
sync-assets:
mkdir -p frontend/public documentation/public
cp -r assets/* frontend/public/ 2>/dev/null || true
cp -r assets/* documentation/public/ 2>/dev/null || true
# --- Utilities -----------------------------------------------------------
# Install dependencies for all projects
install: sync-assets
cd frontend && bun install
cd frontend && bun run test:e2e:install
cd documentation && bun install
./gradlew --version
# Wipe everything build-related
clean:
./gradlew :backend:clean
rm -rf frontend/dist frontend/node_modules frontend/.vite
# Run the built JAR locally to test the production bundle
run-jar: build
java -jar backend/build/libs/backend-0.0.1-SNAPSHOT.jar