feat: Major system improvements and production deployment
✨ New Features: - Added view_orders route with proper table display - Implemented CSV upload with preview workflow and date parsing - Added production WSGI server configuration with Gunicorn - Created comprehensive production management scripts 🔧 Bug Fixes: - Fixed upload_data route column mapping for actual CSV structure - Resolved print module database queries and template rendering - Fixed view orders navigation routing (was pointing to JSON API) - Corrected barcode display width constraints in print module - Added proper date format parsing for MySQL compatibility 🎨 UI/UX Improvements: - Updated view_orders template with theme-compliant styling - Hidden barcode text in print module preview for cleaner display - Enhanced CSV upload with two-step preview-then-save workflow - Improved error handling and debugging throughout upload process 🚀 Production Infrastructure: - Added Gunicorn WSGI server with proper configuration - Created systemd service for production deployment - Implemented production management scripts (start/stop/status) - Added comprehensive logging setup - Updated requirements.txt with production dependencies 📊 Database & Data: - Enhanced order_for_labels table compatibility - Fixed column mappings for real CSV data structure - Added proper date parsing and validation - Improved error handling with detailed debugging 🔧 Technical Debt: - Reorganized database setup documentation - Added proper error handling throughout upload workflow - Enhanced debugging capabilities for troubleshooting - Improved code organization and documentation
This commit is contained in:
78
py_app/status_production.sh
Executable file
78
py_app/status_production.sh
Executable file
@@ -0,0 +1,78 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Production Status Script for Trasabilitate Application
|
||||
# This script shows the current status of the Gunicorn WSGI server
|
||||
|
||||
# Colors for output
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
print_success() {
|
||||
echo -e "${GREEN}✅ $1${NC}"
|
||||
}
|
||||
|
||||
print_warning() {
|
||||
echo -e "${YELLOW}⚠️ $1${NC}"
|
||||
}
|
||||
|
||||
print_error() {
|
||||
echo -e "${RED}❌ $1${NC}"
|
||||
}
|
||||
|
||||
echo -e "${BLUE}📊 Trasabilitate Application - Status Check${NC}"
|
||||
echo "=============================================="
|
||||
|
||||
PID_FILE="../run/trasabilitate.pid"
|
||||
|
||||
if [[ ! -f "$PID_FILE" ]]; then
|
||||
print_error "Application is not running (no PID file found)"
|
||||
echo "To start the application, run: ./start_production.sh"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PID=$(cat "$PID_FILE")
|
||||
|
||||
if ps -p "$PID" > /dev/null 2>&1; then
|
||||
print_success "Application is running (PID: $PID)"
|
||||
echo ""
|
||||
echo "📋 Process Information:"
|
||||
ps -p "$PID" -o pid,ppid,pcpu,pmem,etime,cmd --no-headers | while read line; do
|
||||
echo " $line"
|
||||
done
|
||||
echo ""
|
||||
echo "🌐 Server Information:"
|
||||
echo " • Listening on: 0.0.0.0:8781"
|
||||
echo " • Local URL: http://127.0.0.1:8781"
|
||||
echo " • Network URL: http://$(hostname -I | awk '{print $1}'):8781"
|
||||
echo ""
|
||||
echo "📁 Log Files:"
|
||||
echo " • Access Log: /srv/quality_recticel/logs/access.log"
|
||||
echo " • Error Log: /srv/quality_recticel/logs/error.log"
|
||||
echo ""
|
||||
echo "🔧 Quick Commands:"
|
||||
echo " • Stop server: ./stop_production.sh"
|
||||
echo " • Restart server: ./stop_production.sh && ./start_production.sh"
|
||||
echo " • View error log: tail -f /srv/quality_recticel/logs/error.log"
|
||||
echo " • View access log: tail -f /srv/quality_recticel/logs/access.log"
|
||||
echo ""
|
||||
|
||||
# Check if the web server is responding
|
||||
if command -v curl > /dev/null 2>&1; then
|
||||
echo "🌐 Connection Test:"
|
||||
if curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:8781 | grep -q "200\|302\|401"; then
|
||||
print_success "Web server is responding"
|
||||
else
|
||||
print_warning "Web server may not be responding properly"
|
||||
fi
|
||||
fi
|
||||
|
||||
else
|
||||
print_error "Process $PID not found (stale PID file)"
|
||||
print_warning "Cleaning up stale PID file..."
|
||||
rm -f "$PID_FILE"
|
||||
echo "To start the application, run: ./start_production.sh"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user