Add configuration file and update server settings

- 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.
This commit is contained in:
n.nakhostin
2025-08-02 12:37:04 +03:30
parent 06dc1d5b7a
commit 9119e2383e
30 changed files with 7273 additions and 1106 deletions
+66
View File
@@ -0,0 +1,66 @@
#!/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