-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·80 lines (63 loc) · 1.78 KB
/
Makefile
File metadata and controls
executable file
·80 lines (63 loc) · 1.78 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
.PHONY: build run test clean docker-up docker-down migrate build-frontend seed-db
# Build the application
build:
go build -o server ./cmd/server
# Run the application
run:
go run ./cmd/server
# Run tests
test:
go test -v ./...
# Run tests with coverage
test-coverage:
go test -v -coverprofile=coverage.out ./...
go tool cover -html=coverage.out
# Clean build artifacts
clean:
rm -f server
rm -f coverage.out
# Start Docker services
docker-up:
docker-compose up -d
# Stop Docker services
docker-down:
docker-compose down
# Start Docker services with logs
docker-logs:
docker-compose up
# Download dependencies
deps:
go mod download
go mod tidy
# Format code
fmt:
go fmt ./...
# Lint code
lint:
golangci-lint run
# Migrate database (if using migrations)
migrate:
@echo "Note: GORM auto-migrates on startup. See migrations/ for SQL reference."
# Seed database with test data
seed-db:
@echo "🌱 Seeding database with test data..."
go run ./cmd/seed
@echo "Done! You can now run 'make run' to start the server."
# Seed database and reset all data
seed-db-reset:
@echo "🔄 Resetting database and seeding with fresh test data..."
go run ./cmd/seed --reset
@echo "Done! You can now run 'make run' to start the server."
# Generate GraphQL code
generate-graphql:
@echo "Generating GraphQL code..."
cd internal/graph && go run github.com/99designs/gqlgen generate
@echo "GraphQL code generated successfully!"
@echo "Note: You may need to update internal/graph/handler.go after generation"
# Run full setup
setup: deps
@echo "Dependencies downloaded. Don't forget to:"
@echo "1. Copy .env.example to .env"
@echo "2. Update .env with your configuration"
@echo "3. Start PostgreSQL and Redis (docker-compose up -d postgres redis)"
@echo "4. Generate GraphQL code: make generate-graphql"