-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (48 loc) · 1.54 KB
/
Copy pathMakefile
File metadata and controls
66 lines (48 loc) · 1.54 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
.PHONY: proto backend frontend test clean install dev docker-build docker-run docker-up docker-down frontend-deps frontend-build frontend-dev
# Generate Protocol Buffers with Connect
proto:
@echo "Generating protobuf code with Connect..."
@mkdir -p backend/pkg/proto
PATH="$$HOME/go/bin:$$PATH" protoc --go_out=backend/pkg/proto --go_opt=paths=source_relative \
--connect-go_out=backend/pkg/proto --connect-go_opt=paths=source_relative \
-I proto proto/*.proto
# Backend commands
backend-deps:
cd backend && go mod download && go mod tidy
backend-build: proto
cd backend && go build -o bin/server ./cmd/server
backend-run: proto
cd backend && go run ./cmd/server
backend-test:
cd backend && go test ./... -v
frontend-test:
bun frontend/test/import-validator.test.ts
# Frontend (Svelte + Vite + TypeScript SPA, outputs to frontend/static/)
frontend-deps:
cd frontend && bun install
frontend-build: frontend-deps
cd frontend && bun run build
frontend-dev: frontend-deps
cd frontend && bun run dev
# Development - runs backend which serves both API and static frontend
dev: backend-run
dev-backend: backend-run
# Install dependencies
install: backend-deps proto frontend-deps
@echo "Setup complete!"
# Run all tests
test: backend-test frontend-test
# Cleanup
clean:
rm -rf backend/bin
rm -rf backend/data/*.db
rm -rf proto/gen
# Docker commands
docker-build:
podman build -t splitwiser .
docker-run:
podman run -p 9090:8080 -v splitwiser-data:/app/data splitwiser
docker-up:
podman compose up --build
docker-down:
podman compose down