27 Commits

Author SHA1 Message Date
0c095f7fcd Fix real-time chart updates by correcting function name mismatch in WebSocket event handlers 2025-08-27 08:33:09 +00:00
c81d0b780d Implement performance optimizations for chart updates: adaptive throttling, data sampling, dynamic bin adjustment, and request batching 2025-08-27 08:21:58 +00:00
f8bb35e5be Remove unnecessary debug outputs for production performance 2025-08-27 08:03:15 +00:00
cb1327a718 docker compose 2025-08-26 12:18:03 +00:00
be4c8cc2a5 Return to Flask 2025-08-26 10:52:13 +00:00
c59732aef3 Add project information box to about page with copyright, license and source code link 2025-08-26 10:10:11 +00:00
83e4fbf689 Add LICENSE 2025-08-26 09:57:18 +00:00
f03539ed22 Update README 2025-08-26 09:56:05 +00:00
a1c47136cf Update README-dev.md with information about test files and remove redundant test_distribution_fix.py 2025-08-26 09:40:33 +00:00
c245c05d0f Add development docker-compose file and documentation for testing without Caddy 2025-08-26 09:38:06 +00:00
52b8ab2248 Fix wealth distribution histogram issue by correcting wealth calculation and improving data handling 2025-08-26 09:32:30 +00:00
2fe272bd00 Configure Docker to use Gunicorn instead of Flask development server for production deployment. Updated SocketIO configuration for gevent compatibility. 2025-08-26 08:36:54 +00:00
eedaa253e4 Add comprehensive SEO improvements: meta tags, robots.txt, sitemap.xml, and favicon. Fix meta description rendering issues with proper HTML entity encoding. Update port configuration to use PORT environment variable. 2025-08-26 08:29:34 +00:00
ae9107705d Update CADDY.md documentation to reflect corrected Caddyfile configuration and optimizations 2025-08-25 21:06:15 +00:00
f6fe445876 Fix Caddyfile TLS directive syntax and optimize configuration for WebSocket support 2025-08-25 21:05:49 +00:00
b016d83c2f Add Caddy server configuration for domain markov.elpatron.me with Let's Encrypt SSL and WebSocket support. Includes: - Caddy service in docker-compose.yml - Caddyfile with SSL and WebSocket configuration - Enhanced Flask app for proxy compatibility - Documentation files (CADDY.md, updated README.md) 2025-08-25 20:28:41 +00:00
70bde3c015 Add enhanced distribution chart debugging functions
- Add testDistributionUpdate() for backend data integration testing
- Add testSimulationFlow() for complete simulation monitoring
- Enhance testDistributionChart() with comprehensive diagnostics
- These functions help isolate the specific failure point for the wealth distribution histogram issue
- Can be called from browser console for production debugging
2025-08-24 19:22:09 +00:00
dc6204068f Add: Advanced diagnostic tools for production debugging
New Diagnostic Endpoints:
- /test-simulation: Full simulation flow testing
- /api/test-websocket: WebSocket connectivity testing

Enhanced Browser Testing:
- testWebSocket(): Test real-time communication
- testDistributionChart(): Enhanced chart diagnostics
- WebSocket test message handler for live testing

Debugging Improvements:
- Real-time WebSocket message testing
- Manual chart update testing
- Complete simulation data flow validation
- End-to-end connectivity verification

These tools will help identify the exact failure point
in the wealth distribution histogram issue.
2025-08-24 19:01:01 +00:00
97e9e18ee5 Enhanced: Comprehensive production debugging and Nginx proxy support
Debugging Tools:
- Added /debug endpoint to verify deployment and test distribution functionality
- Added browser console test function: testDistributionChart()
- Enhanced SocketIO settings with better transport priorities
- Added comprehensive error tracking and status reporting

Nginx Configuration:
- Created NGINX_CONFIG.md with complete proxy setup guide
- Improved WebSocket transport settings and timeouts
- Better ping/pong settings for connection stability

Production Compatibility:
- Optimized SocketIO for proxy environments
- Enhanced fallback mechanisms
- Production-ready logging and error handling

This should resolve proxy-related issues and provide clear diagnostic tools.
2025-08-24 18:53:09 +00:00
6f94b1bd04 Fix: Wealth Distribution Histogram behind Nginx proxy
Production Environment Fixes:
- Enhanced SocketIO configuration for proxy compatibility
- Added fallback polling mechanism when WebSocket fails
- Fixed environment configuration (FLASK_ENV vs FLASK_CONFIG)
- Added production-friendly debug logging for distribution chart
- Improved connection status monitoring and error handling

Proxy-Specific Improvements:
- Enhanced CORS and transport settings for SocketIO
- Fallback to HTTP polling when WebSocket connections fail
- Better error handling and retry mechanisms
- Debug logging that works in production mode

This should resolve the wealth distribution histogram issue
when running behind Nginx proxy in Docker containers.
2025-08-24 18:45:55 +00:00
0fbee684f4 Clean up: Remove Python cache files from repository
- Removed __pycache__ directories from git tracking
- These files are now properly excluded by .gitignore
- Maintains repository cleanliness as per best practices
2025-08-24 18:36:35 +00:00
df95bca4b5 Fix: Wealth Distribution Histogram not showing data
- Enhanced debug logging in simulation.js to track distribution data flow
- Improved data handling in updateCharts() with proper validation
- Added fallback mechanisms in onSimulationComplete() for distribution data
- Enhanced updateSimulationProgress() with better array copying
- Added comprehensive error handling and debug output
- Created .gitignore to exclude Python cache files

The histogram should now properly display wealth distribution data during simulations.
2025-08-24 18:29:05 +00:00
1baf8421df Fix wealth distribution chart functionality 2025-08-24 20:12:52 +02:00
3a08de3a4a Fix wealth distribution chart functionality
- Add get_wealth_histogram() method to EconomicModel for histogram data
- Add new API endpoint /simulation/<id>/distribution for chart data
- Extend main data API with include_distribution parameter
- Update real-time progress updates to include distribution data
- Fix frontend updateCharts() to handle wealth distribution chart
- Add distribution data processing in simulation.js
- Update test_charts.py to verify histogram functionality

Resolves issue where wealth distribution chart was not updating during simulations.
2025-08-24 20:10:58 +02:00
27e185c2a6 Fix Markov simulation chart display issue
- Fix circular import issue by moving simulation_manager to app/__init__.py
- Enhance get_wealth_evolution to include inequality metrics data
- Add get_inequality_evolution method for complete chart data
- Update API to return top10_shares and capital_shares in evolution data
- Modify onSimulationComplete to fetch and populate charts with complete data
- Fix simulation threading to properly mark completion state
- Add test script to verify chart data generation

The charts now properly display simulation results by fetching complete
evolution data when simulation completes, resolving the empty diagrams issue.
2025-08-24 19:44:24 +02:00
bec913a599 Add Docker support: Dockerfile, docker-compose.yml, and production configuration
- Add Dockerfile with multi-stage build for Flask app containerization
- Include .dockerignore to optimize build context
- Add docker-compose.yml for easy deployment with health checks
- Update run.py to handle production mode with allow_unsafe_werkzeug
- Add DOCKER.md with comprehensive deployment instructions
- Configure health check endpoint at /health
- Run as non-root user for security
- Support for environment variables and proper port mapping
2025-08-24 19:20:38 +02:00
26c82959a2 Initial commit: Markov Economics Simulation App 2025-08-24 19:12:50 +02:00