-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (44 loc) · 1.21 KB
/
Makefile
File metadata and controls
54 lines (44 loc) · 1.21 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
.PHONY: dev dev-db dev-backend dev-frontend build test clean migrate
# Start everything for local development
dev: dev-db
@echo "Starting Prism development environment..."
@make dev-backend &
@make dev-frontend
@wait
# Start PostgreSQL with pgvector
dev-db:
docker compose up -d
@echo "Waiting for PostgreSQL..."
@sleep 2
# Start Go backend with live reload (via go run)
dev-backend:
cd prism && DATABASE_URL="postgres://prism:prism_dev@localhost:5432/prism?sslmode=disable" go run ./cmd/server
# Start Next.js dev server
dev-frontend:
cd prism-web && pnpm dev
# Build everything
build:
cd prism && go build ./...
cd prism-web && pnpm build
# Run all tests
test:
cd prism && go test ./...
# Run migrations (useful when DB already exists)
migrate:
@for f in prism/migrations/*.sql; do \
echo "Running $$f..."; \
PGPASSWORD=prism_dev psql -h localhost -U prism -d prism -f "$$f" 2>/dev/null || true; \
done
# Clean build artifacts
clean:
rm -rf prism-web/.next
rm -rf prism-web/node_modules/.cache
# Stop docker containers
stop:
docker compose down
# Reset database (WARNING: destroys all data)
reset-db:
docker compose down -v
docker compose up -d
@echo "Database reset. Waiting for init..."
@sleep 3