2.4 KiB
2.4 KiB
Development Setup
This document describes how to set up and run the Markov Economics application in a development environment.
Prerequisites
- Docker
- Docker Compose
Development Environment
For development purposes, we provide a separate Docker Compose configuration that runs the application without Caddy:
# Start the development environment
docker-compose -f docker-compose-dev.yml up -d
# Stop the development environment
docker-compose -f docker-compose-dev.yml down
The application will be available at http://localhost:5000
Differences from Production
The development setup differs from the production setup in the following ways:
- Direct access to the application on port 5000 (no Caddy reverse proxy)
- Development mode enabled (FLASK_ENV=development)
- Source code mounted as a volume for live reloading during development
- No SSL/TLS encryption (HTTP only)
Troubleshooting
If you encounter port conflicts:
-
Check what's running on port 5000:
lsof -i :5000
-
Stop any conflicting processes:
pkill -f "python.*run.py"
-
Stop any conflicting Docker containers:
docker-compose down
Testing
The project includes several test scripts to verify functionality:
- test_core.py - Tests core functionality including Markov chains, economic agents, and simulations
- test_charts.py - Tests charting functionality through the web API
- test_simulation.json - Sample parameters for testing
To run the core tests:
docker-compose -f docker-compose-dev.yml up -d
python test_core.py
To run the chart tests:
docker-compose -f docker-compose-dev.yml up -d
python test_charts.py
Testing the Wealth Distribution Fix
The recent fix for the wealth distribution histogram ensures that:
- The backend correctly calculates agent wealth using the proper accessor methods
- The frontend properly handles and displays distribution data
- Debug logging is available to troubleshoot data flow issues
To test the fix:
- Start the development environment
- Navigate to http://localhost:5000
- Start a simulation with default parameters
- Observe the wealth distribution histogram populating with data