- Enhanced the materials endpoint to accept both single and multiple materials. - Added validation for each material's required fields. - Updated response to return all added materials and their count. - Adjusted frontend API base URL to point to the new server port (4031). - Improved logging for debugging purposes in CalculationView and MaterialsManager components. - Refactored labor and materials handling in ProjectFlow and other components to ensure state consistency. - Implemented incremental addition of materials without deleting existing ones. - Added calculation endpoint to compute project costs including labor and materials. - Enhanced error handling and logging throughout the application.
29 lines
838 B
Bash
Executable File
29 lines
838 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Quick Frontend Deploy Script with Basic Testing
|
|
# Fast deployment with essential health check
|
|
|
|
echo "🚀 Quick deploying frontend..."
|
|
|
|
# Build, copy, restart in one go
|
|
cd /home/alex/git/tilbudgivern/frontend && npm run build > /dev/null 2>&1 && \
|
|
cd /home/alex/git/tilbudgivern && cp -r frontend/build/* build/ && \
|
|
pm2 restart tilbudgivern-unified > /dev/null 2>&1
|
|
|
|
if [ $? -eq 0 ]; then
|
|
echo "✅ Frontend deployed successfully!"
|
|
|
|
# Quick health check
|
|
sleep 3
|
|
SERVER_RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:4031)
|
|
if [ "$SERVER_RESPONSE" = "200" ]; then
|
|
echo "✅ Health check passed"
|
|
echo "🌐 http://localhost:4031"
|
|
else
|
|
echo "⚠️ Health check failed (HTTP $SERVER_RESPONSE)"
|
|
fi
|
|
else
|
|
echo "❌ Deployment failed"
|
|
exit 1
|
|
fi
|