-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
125 lines (100 loc) · 3.71 KB
/
Makefile
File metadata and controls
125 lines (100 loc) · 3.71 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
# CCDash Project Makefile
# Development and build automation for backend (Go) and frontend (Next.js)
.PHONY: all build run dev test clean help install deps backend-build backend-run backend-dev backend-test frontend-build frontend-run frontend-dev frontend-test frontend-install
# Default target
all: build
# Help target
help:
@echo "Available targets:"
@echo " all - Build both backend and frontend"
@echo " build - Build both backend and frontend"
@echo " run - Run both backend and frontend in production mode"
@echo " dev - Run both backend and frontend in development mode"
@echo " test - Run tests for both backend and frontend"
@echo " clean - Clean build artifacts"
@echo " install - Install dependencies for both backend and frontend"
@echo ""
@echo "Backend targets:"
@echo " backend-build - Build backend binary"
@echo " backend-run - Run backend in production mode"
@echo " backend-dev - Run backend in development mode"
@echo " backend-test - Run backend tests"
@echo ""
@echo "Frontend targets:"
@echo " frontend-build - Build frontend for production"
@echo " frontend-run - Run frontend in production mode"
@echo " frontend-dev - Run frontend in development mode"
@echo " frontend-test - Run frontend linting"
@echo " frontend-install - Install frontend dependencies"
# Combined targets
build: backend-build frontend-build
run: backend-run frontend-run
dev:
@echo "Starting development servers..."
@echo "Backend will run on http://localhost:6060"
@echo "Frontend will run on http://localhost:3000"
@echo "Press Ctrl+C to stop both servers"
@(make backend-dev &) && (make frontend-dev &) && wait
test: backend-test frontend-test
clean:
@echo "Cleaning build artifacts..."
cd backend && rm -rf bin/
cd frontend && rm -rf .next/ out/
@echo "Clean completed"
install: frontend-install
@echo "Installing backend dependencies..."
cd backend && go mod download && go mod tidy
@echo "All dependencies installed"
# Backend targets
backend-build:
@echo "Building backend..."
cd backend && go build -o bin/server cmd/server/main.go
@echo "Backend build completed: backend/bin/server"
backend-run: backend-build
@echo "Starting backend server on http://localhost:6060"
cd backend && ./bin/server
backend-dev:
@echo "Starting backend in development mode..."
cd backend && go run cmd/server/main.go
backend-test:
@echo "Running backend tests..."
cd backend && go test ./...
# Frontend targets
frontend-install:
@echo "Installing frontend dependencies..."
cd frontend && npm install --legacy-peer-deps
frontend-build: frontend-install
@echo "Building frontend for production..."
cd frontend && npm run build
frontend-run: frontend-build
@echo "Starting frontend in production mode on http://localhost:3000"
cd frontend && npm run start
frontend-dev: frontend-install
@echo "Starting frontend in development mode on http://localhost:3000"
cd frontend && npm run dev
frontend-test: frontend-install
@echo "Running frontend linting..."
cd frontend && npm run lint
# Dependency management
deps: install
# Development helpers
.PHONY: backend-logs frontend-logs
backend-logs:
@echo "Checking backend logs (if any)..."
frontend-logs:
@echo "Checking frontend logs (if any)..."
# Quick start for development
.PHONY: start
start: dev
# Production deployment preparation
.PHONY: prod-build
prod-build:
@echo "Building for production..."
@make clean
@make build
@echo "Production build completed"
# Fix session times
.PHONY: fix-session-times
fix-session-times:
@echo "Fixing session start times..."
cd backend && go run cmd/fix-session-times/main.go