diff --git a/Makefile b/Makefile index 8848081..3cc570d 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,9 @@ help: @echo "Available targets:" @echo " build - Build the web server" + @echo " build-mac - Build for macOS (Intel)" + @echo " build-mac-arm64 - Build for macOS (Apple Silicon)" + @echo " build-all - Build for all platforms" @echo " run - Run the web server" @echo " test - Run tests" @echo " clean - Clean build artifacts" @@ -19,6 +22,24 @@ build: @go build -o bin/web ./cmd/web @echo "Build completed successfully!" +# Build for macOS (Intel) +build-mac: + @echo "Building web server for macOS (Intel)..." + @mkdir -p bin + @GOOS=darwin GOARCH=amd64 go build -o bin/web-mac ./cmd/web + @echo "macOS Intel build completed successfully!" + +# Build for macOS (Apple Silicon) +build-mac-arm64: + @echo "Building web server for macOS (Apple Silicon)..." + @mkdir -p bin + @GOOS=darwin GOARCH=arm64 go build -o bin/web-mac-arm64 ./cmd/web + @echo "macOS ARM64 build completed successfully!" + +# Build for all platforms +build-all: build build-mac build-mac-arm64 + @echo "All platform builds completed successfully!" + # Run the web server run: build @echo "Starting web server..." diff --git a/cmd/web/__debug_bin4016044904 b/cmd/web/__debug_bin4016044904 deleted file mode 100755 index e312160..0000000 Binary files a/cmd/web/__debug_bin4016044904 and /dev/null differ diff --git a/test_server.sh b/test_server.sh deleted file mode 100755 index 4e19124..0000000 --- a/test_server.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -echo "Testing Tender Management API Server..." - -# Check if MongoDB is running -if ! pgrep -x "mongod" > /dev/null; then - echo "Warning: MongoDB is not running. Starting server may fail." - echo "To start MongoDB: sudo systemctl start mongod" -fi - -# Build the server -echo "Building server..." -go build -o bin/web ./cmd/web - -if [ $? -ne 0 ]; then - echo "Build failed!" - exit 1 -fi - -echo "Build successful!" - -# Test the health endpoint (if server starts) -echo "Testing health endpoint..." -timeout 5s curl -s http://localhost:8081/health || echo "Server not responding (expected if MongoDB is not running)" - -echo "Test completed!" \ No newline at end of file diff --git a/test_swagger.sh b/test_swagger.sh deleted file mode 100755 index 6adfc26..0000000 --- a/test_swagger.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash - -# Test Swagger Documentation Script - -echo "🚀 Starting Tender Management API Server with Swagger Documentation..." -echo "" - -# Build the application -echo "📦 Building application..." -make build - -if [ $? -ne 0 ]; then - echo "❌ Build failed!" - exit 1 -fi - -echo "" -echo "✅ Build successful!" -echo "" - -# Start the server in background -echo "🌐 Starting server..." -./bin/web & -SERVER_PID=$! - -# Wait for server to start -echo "⏳ Waiting for server to start..." -sleep 3 - -# Check if server is running -if curl -s http://localhost:8081/health > /dev/null; then - echo "✅ Server is running!" - echo "" - echo "📚 Swagger Documentation is available at:" - echo " 🌐 http://localhost:8081/swagger/index.html" - echo "" - echo "🔍 Health Check endpoint:" - echo " 🌐 http://localhost:8081/health" - echo "" - echo "📋 Available API endpoints:" - echo " 🔐 Authentication:" - echo " POST /api/customers/login" - echo " POST /api/customers/refresh-token" - echo " 👤 Customer Profile:" - echo " GET /api/customers/profile" - echo " PUT /api/customers/profile" - echo " PUT /api/customers/change-password" - echo " 📱 Device Management:" - echo " POST /api/customers/device-token" - echo " DELETE /api/customers/device-token" - echo " 👥 Admin Operations:" - echo " POST /api/admin/customers/register" - echo " GET /api/admin/customers" - echo " GET /api/admin/customers/{id}" - echo " PUT /api/admin/customers/{id}/status" - echo "" - echo "🛑 To stop the server, press Ctrl+C or run: kill $SERVER_PID" - echo "" - - # Keep the script running - wait $SERVER_PID -else - echo "❌ Server failed to start!" - kill $SERVER_PID 2>/dev/null - exit 1 -fi \ No newline at end of file diff --git a/web b/web deleted file mode 100755 index 0fa4f04..0000000 Binary files a/web and /dev/null differ