first
This commit is contained in:
commit
f4be03ceba
1826 changed files with 830924 additions and 0 deletions
71
Makefile
Normal file
71
Makefile
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
.PHONY: all dev-frontend dev-backend build build-frontend build-backend clean test lint
|
||||
|
||||
# Variables
|
||||
APP_NAME := imc-vibe
|
||||
FRONTEND_DIR := frontend
|
||||
BACKEND_DIR := backend
|
||||
BUILD_DIR := build
|
||||
|
||||
# Default target
|
||||
all: build
|
||||
|
||||
# Build everything (frontend + backend + embed)
|
||||
build: build-frontend build-backend
|
||||
|
||||
# Build frontend only
|
||||
build-frontend:
|
||||
@echo "Building frontend..."
|
||||
cd $(FRONTEND_DIR) && bun install --frozen-lockfile
|
||||
cd $(FRONTEND_DIR) && bun run build
|
||||
@echo "Frontend built successfully"
|
||||
|
||||
# Build backend only (copies frontend build into embed directory)
|
||||
build-backend: build-frontend
|
||||
@echo "Copying frontend to embed directory..."
|
||||
rm -rf $(BACKEND_DIR)/cmd/server/embed
|
||||
cp -r $(FRONTEND_DIR)/build $(BACKEND_DIR)/cmd/server/embed
|
||||
@echo "Building backend..."
|
||||
cd $(BACKEND_DIR) && go mod tidy
|
||||
cd $(BACKEND_DIR) && go build -ldflags "-s -w" -o ../$(BUILD_DIR)/$(APP_NAME) ./cmd/server
|
||||
@echo "Backend built successfully"
|
||||
|
||||
# Development targets
|
||||
dev-frontend:
|
||||
@echo "Starting frontend dev server..."
|
||||
cd $(FRONTEND_DIR) && bun run dev
|
||||
|
||||
dev-backend:
|
||||
@echo "Starting backend dev server..."
|
||||
cd $(BACKEND_DIR) && USE_EMBEDDED=false go run ./cmd/server
|
||||
|
||||
# Clean build artifacts
|
||||
clean:
|
||||
@echo "Cleaning..."
|
||||
rm -rf $(BUILD_DIR)
|
||||
rm -rf $(FRONTEND_DIR)/build
|
||||
rm -rf $(FRONTEND_DIR)/.svelte-kit
|
||||
rm -rf $(BACKEND_DIR)/cmd/server/embed
|
||||
cd $(BACKEND_DIR) && go clean
|
||||
@echo "Cleaned successfully"
|
||||
|
||||
# Test
|
||||
test:
|
||||
cd $(BACKEND_DIR) && go test ./...
|
||||
|
||||
# Lint
|
||||
lint:
|
||||
cd $(BACKEND_DIR) && go vet ./...
|
||||
|
||||
# Help
|
||||
help:
|
||||
@echo "Available targets:"
|
||||
@echo " all - Build frontend and backend (default)"
|
||||
@echo " build - Build frontend and backend"
|
||||
@echo " build-frontend - Build frontend only"
|
||||
@echo " build-backend - Build backend only"
|
||||
@echo " dev-frontend - Start frontend dev server"
|
||||
@echo " dev-backend - Start backend dev server"
|
||||
@echo " clean - Remove build artifacts"
|
||||
@echo " test - Run backend tests"
|
||||
@echo " lint - Run Go vet"
|
||||
@echo " help - Show this help"
|
||||
Loading…
Add table
Add a link
Reference in a new issue