LINUS ROUND 1: Delete dead code (rust/c), generic Store[T], tests, slim main.go
- Removed rust-service/, c-runtime/, kafka stubs - Generic Store[T] pattern with real tests - Slimmed main.go from 324 to ~50 lines - Added config, middleware, store, ledger, pdf tests - Frontend SPA shell with router - Binary: 15.5MB -> 12MB
This commit is contained in:
@@ -1,66 +1,26 @@
|
||||
# BOC — Business Operations Center
|
||||
# Makefile for building and deploying the entire stack
|
||||
# Makefile
|
||||
|
||||
.PHONY: all build build-go build-rust build-c test test-go test-rust lint lint-go lint-rust clean docker-up docker-down docker-logs deploy dev
|
||||
.PHONY: all build test lint clean docker-up docker-down dev help
|
||||
|
||||
# Default target
|
||||
all: build
|
||||
|
||||
# Build all components
|
||||
build: build-go build-rust build-c
|
||||
|
||||
# Build Go backend
|
||||
build-go:
|
||||
build:
|
||||
@echo "🔨 Building Go backend..."
|
||||
cd backend && go build -o boc .
|
||||
|
||||
# Build Rust service
|
||||
build-rust:
|
||||
@echo "🔨 Building Rust service..."
|
||||
cd rust-service && cargo build --release
|
||||
|
||||
# Build C runtime
|
||||
build-c:
|
||||
@echo "🔨 Building C runtime..."
|
||||
cd c-runtime && \
|
||||
gcc -shared -fPIC -O3 -o libboc_ipc.so src/ipc.c -lpthread -lrt && \
|
||||
gcc -c -O3 -o ipc.o src/ipc.c && \
|
||||
ar rcs libboc_ipc.a ipc.o
|
||||
|
||||
# Run all tests
|
||||
test: test-go test-rust
|
||||
|
||||
# Run Go tests
|
||||
test-go:
|
||||
test:
|
||||
@echo "🧪 Running Go tests..."
|
||||
cd backend && go test ./...
|
||||
cd backend && go test ./... -v
|
||||
|
||||
# Run Rust tests
|
||||
test-rust:
|
||||
@echo "🧪 Running Rust tests..."
|
||||
cd rust-service && cargo test
|
||||
|
||||
# Lint all code
|
||||
lint: lint-go lint-rust
|
||||
|
||||
# Lint Go code
|
||||
lint-go:
|
||||
lint:
|
||||
@echo "🔍 Linting Go code..."
|
||||
cd backend && go vet ./...
|
||||
|
||||
# Lint Rust code
|
||||
lint-rust:
|
||||
@echo "🔍 Linting Rust code..."
|
||||
cd rust-service && cargo clippy -- -D warnings
|
||||
|
||||
# Clean build artifacts
|
||||
clean:
|
||||
@echo "🧹 Cleaning build artifacts..."
|
||||
@echo "🧹 Cleaning..."
|
||||
cd backend && rm -f boc
|
||||
cd rust-service && cargo clean
|
||||
cd c-runtime && rm -f *.o *.so *.a
|
||||
|
||||
# Docker commands
|
||||
docker-up:
|
||||
@echo "🐳 Starting Docker containers..."
|
||||
docker-compose up -d --build
|
||||
@@ -69,51 +29,17 @@ docker-down:
|
||||
@echo "🐳 Stopping Docker containers..."
|
||||
docker-compose down
|
||||
|
||||
docker-logs:
|
||||
@echo "📋 Showing logs..."
|
||||
docker-compose logs -f
|
||||
|
||||
# Development mode - run locally with hot reload
|
||||
dev:
|
||||
@echo "🚀 Starting development mode..."
|
||||
@echo "Make sure PostgreSQL is running on localhost:5432"
|
||||
cd backend && DB_URL="postgres://boc:boc@localhost:5432/boc?sslmode=disable" go run .
|
||||
@echo "🚀 Development mode..."
|
||||
cd backend && DB_URL="postgres://boc:boc@localhost:5432/boc?sslmode=disable" JWT_SECRET="dev-secret-do-not-use" go run .
|
||||
|
||||
# Deploy to production
|
||||
deploy: build
|
||||
@echo "🚀 Deploying to production..."
|
||||
# Add your deployment commands here
|
||||
# Example: rsync, scp, or kubectl apply
|
||||
|
||||
# Database migrations
|
||||
migrate:
|
||||
@echo "🗄️ Running database migrations..."
|
||||
cd backend && go run . migrate
|
||||
|
||||
# Generate API documentation
|
||||
docs:
|
||||
@echo "📚 Generating API documentation..."
|
||||
cd backend && go doc ./...
|
||||
|
||||
# Help
|
||||
help:
|
||||
@echo "BOC — Business Operations Center"
|
||||
@echo ""
|
||||
@echo "Available targets:"
|
||||
@echo " make build - Build all components"
|
||||
@echo " make build-go - Build Go backend only"
|
||||
@echo " make build-rust - Build Rust service only"
|
||||
@echo " make build-c - Build C runtime only"
|
||||
@echo " make test - Run all tests"
|
||||
@echo " make test-go - Run Go tests"
|
||||
@echo " make test-rust - Run Rust tests"
|
||||
@echo " make lint - Lint all code"
|
||||
@echo " make clean - Clean build artifacts"
|
||||
@echo " make docker-up - Start Docker containers"
|
||||
@echo " make docker-down - Stop Docker containers"
|
||||
@echo " make docker-logs - Show Docker logs"
|
||||
@echo " make dev - Run in development mode"
|
||||
@echo " make deploy - Deploy to production"
|
||||
@echo " make migrate - Run database migrations"
|
||||
@echo " make docs - Generate API documentation"
|
||||
@echo " make help - Show this help"
|
||||
@echo " make build - Build Go backend"
|
||||
@echo " make test - Run all tests"
|
||||
@echo " make lint - Lint Go code"
|
||||
@echo " make clean - Clean build artifacts"
|
||||
@echo " make docker-up - Start Docker containers"
|
||||
@echo " make docker-down- Stop Docker containers"
|
||||
@echo " make dev - Run in development mode"
|
||||
|
||||
Reference in New Issue
Block a user