9119e2383e
- Introduced a new `config.yaml` file for managing server, database, cache, queue, AI, scraping, logging, and rate limiting configurations. - Updated `docker-compose.yml` to reflect the new server port (8081) and adjusted health check endpoints accordingly. - Modified `Dockerfile` to expose the new server port. - Updated `README.md` to reflect changes in server configuration and added documentation for the new configuration structure. - Added test scripts for server and Swagger documentation testing. - Refactored customer domain structure to align with new configuration settings and improve maintainability.
90 lines
1.9 KiB
Makefile
90 lines
1.9 KiB
Makefile
# Tender Management Backend Makefile
|
|
|
|
.PHONY: help build run test clean docker-build docker-run
|
|
|
|
# Default target
|
|
help:
|
|
@echo "Available targets:"
|
|
@echo " build - Build the web server"
|
|
@echo " run - Run the web server"
|
|
@echo " test - Run tests"
|
|
@echo " clean - Clean build artifacts"
|
|
@echo " docker-build - Build Docker image"
|
|
@echo " docker-run - Run Docker container"
|
|
|
|
# Build the web server
|
|
build:
|
|
@echo "Building web server..."
|
|
@mkdir -p bin
|
|
@go build -o bin/web ./cmd/web
|
|
@echo "Build completed successfully!"
|
|
|
|
# Run the web server
|
|
run: build
|
|
@echo "Starting web server..."
|
|
@./bin/web
|
|
|
|
# Run tests
|
|
test:
|
|
@echo "Running tests..."
|
|
@go test ./...
|
|
|
|
# Clean build artifacts
|
|
clean:
|
|
@echo "Cleaning build artifacts..."
|
|
@rm -rf bin/
|
|
@go clean
|
|
|
|
# Build Docker image
|
|
docker-build:
|
|
@echo "Building Docker image..."
|
|
@docker build -t tender-management-api .
|
|
|
|
# Run Docker container
|
|
docker-run:
|
|
@echo "Running Docker container..."
|
|
@docker run -p 8081:8081 tender-management-api
|
|
|
|
# Development with hot reload (requires air)
|
|
dev:
|
|
@echo "Starting development server with hot reload..."
|
|
@air
|
|
|
|
# Install development dependencies
|
|
install-dev:
|
|
@echo "Installing development dependencies..."
|
|
@go install github.com/cosmtrek/air@latest
|
|
|
|
# Format code
|
|
fmt:
|
|
@echo "Formatting code..."
|
|
@go fmt ./...
|
|
|
|
# Vet code
|
|
vet:
|
|
@echo "Vetting code..."
|
|
@go vet ./...
|
|
|
|
# Lint code (requires golangci-lint)
|
|
lint:
|
|
@echo "Linting code..."
|
|
@golangci-lint run
|
|
|
|
# Generate API documentation
|
|
docs:
|
|
@echo "Generating API documentation..."
|
|
@swag init -g cmd/web/main.go -o cmd/web/docs
|
|
@echo "Swagger documentation generated successfully!"
|
|
|
|
# Run server with documentation
|
|
run-docs: docs run
|
|
|
|
# Database migrations (placeholder)
|
|
migrate:
|
|
@echo "Running database migrations..."
|
|
@echo "TODO: Implement database migrations"
|
|
|
|
# Seed database (placeholder)
|
|
seed:
|
|
@echo "Seeding database..."
|
|
@echo "TODO: Implement database seeding"
|