refactor: move backend files to backend/ directory
Reorganize project structure: - backend/cmd/openteam/ — entry point - backend/internal/ — core packages - backend/middleware/ — HTTP middleware - backend/router/ — route setup - backend/wire/ — dependency injection - backend/pkg/ — shared utilities - backend/go.mod, go.sum — Go module files Updated Makefile to work from backend/ directory. Removed old lowercase makefile.
This commit is contained in:
@@ -2,10 +2,11 @@
|
||||
|
||||
BINARY_NAME=openteam
|
||||
BUILD_DIR=bin
|
||||
BACKEND_DIR=backend
|
||||
|
||||
# Build
|
||||
build:
|
||||
go build -o $(BUILD_DIR)/$(BINARY_NAME) ./cmd/openteam
|
||||
cd $(BACKEND_DIR) && CGO_ENABLED=1 go build -o ../$(BUILD_DIR)/$(BINARY_NAME) ./cmd/openteam
|
||||
|
||||
# Run
|
||||
run: build
|
||||
@@ -13,41 +14,41 @@ run: build
|
||||
|
||||
# Development run
|
||||
dev:
|
||||
go run ./cmd/openteam
|
||||
cd $(BACKEND_DIR) && go run ./cmd/openteam
|
||||
|
||||
# Test
|
||||
test:
|
||||
go test ./internal/... -v
|
||||
cd $(BACKEND_DIR) && go test ./internal/... -v
|
||||
|
||||
# Test with coverage
|
||||
test-cover:
|
||||
go test ./internal/... -coverprofile=coverage.out
|
||||
go tool cover -html=coverage.out -o coverage.html
|
||||
cd $(BACKEND_DIR) && go test ./internal/... -coverprofile=coverage.out
|
||||
cd $(BACKEND_DIR) && go tool cover -html=coverage.out -o coverage.html
|
||||
|
||||
# Format code
|
||||
fmt:
|
||||
go fmt ./...
|
||||
cd $(BACKEND_DIR) && go fmt ./...
|
||||
|
||||
# Lint
|
||||
lint:
|
||||
golangci-lint run
|
||||
cd $(BACKEND_DIR) && golangci-lint run
|
||||
|
||||
# Clean
|
||||
clean:
|
||||
rm -rf $(BUILD_DIR)
|
||||
rm -f coverage.out coverage.html
|
||||
cd $(BACKEND_DIR) && rm -f coverage.out coverage.html
|
||||
|
||||
# Tidy dependencies
|
||||
tidy:
|
||||
go mod tidy
|
||||
cd $(BACKEND_DIR) && go mod tidy
|
||||
|
||||
# Build for Linux
|
||||
build-linux:
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o $(BUILD_DIR)/$(BINARY_NAME)-linux-amd64 ./cmd/openteam
|
||||
cd $(BACKEND_DIR) && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ../$(BUILD_DIR)/$(BINARY_NAME)-linux-amd64 ./cmd/openteam
|
||||
|
||||
# Build for macOS
|
||||
build-mac:
|
||||
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o $(BUILD_DIR)/$(BINARY_NAME)-darwin-arm64 ./cmd/openteam
|
||||
cd $(BACKEND_DIR) && CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o ../$(BUILD_DIR)/$(BINARY_NAME)-darwin-arm64 ./cmd/openteam
|
||||
|
||||
# Build all platforms
|
||||
build-all: build-linux build-mac
|
||||
|
||||
Reference in New Issue
Block a user