-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (42 loc) · 1.24 KB
/
Makefile
File metadata and controls
53 lines (42 loc) · 1.24 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
.PHONY: run run-pg up down test build build-web clean web-dev
# Run in in-memory mode
run:
@echo "Running in in-memory mode..."
@STORAGE=inmem go run cmd/api/main.go
# Run with PostgreSQL (requires DATABASE_URL)
run-pg:
@echo "Running with PostgreSQL..."
@STORAGE=postgres DATABASE_URL=postgres://learnforge:learnforge@localhost:5432/learnforge?sslmode=disable go run cmd/api/main.go
# Start Docker Compose services
up:
@echo "Starting Docker Compose services..."
docker-compose up -d
# Stop Docker Compose services
down:
@echo "Stopping Docker Compose services..."
docker-compose down
# Run tests
test:
@echo "Running tests..."
go test -v ./...
# Build the web UI
build-web:
@echo "Building web UI..."
@cd web && npm install && npm run build
# Build the application (includes web UI)
build: build-web
@echo "Building application..."
go build -o bin/api cmd/api/main.go
# Run web dev server
web-dev:
@echo "Starting web dev server..."
@cd web && npm install && npm run dev
# Clean build artifacts
clean:
@echo "Cleaning..."
rm -rf bin/ web/dist/ web/node_modules/
# Run tests with coverage
test-coverage:
@echo "Running tests with coverage..."
go test -v -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html