Web Interface¶
SimLab provides a web interface built with FastHTML for running simulations through a browser.
Installation¶
Make sure you have installed SimLab with the web dependencies:
Running the Web Server¶
Start the web server with:
By default, the server runs on http://localhost:8000.
For custom host and port:
Web Interface Features¶
Navigate to http://localhost:8000 in your browser to access the web interface, which provides:
- Interactive forms for configuring simulations
- Visual charts of simulation results (powered by Chart.js)
- Statistical analysis of simulation results
- Options to download simulation data as CSV
Simulation Types¶
Stock Market Simulation¶
Configure and run stock price simulations with parameters:
- Starting Price
- Days to simulate
- Volatility
- Drift (daily price trend)
- Event Day (optional)
- Event Impact
The simulation visualizes market events as markers on the chart, making it easy to see the impact of major events.
Resource Fluctuations Simulation¶
Model resource price changes with parameters:
- Starting Price
- Days to simulate
- Volatility
- Drift
- Supply Disruption Day (optional)
- Disruption Severity
Product Popularity Simulation¶
Coming soon!
Behind the Scenes - FastHTML¶
The SimLab web interface is built using FastHTML, which combines:
- Starlette for ASGI web server
- HTMX for interactive browser experiences
- FastTags (FT) for dynamic HTML generation
FastHTML allows SimLab to create a modern, interactive web interface without the complexity of a full JavaScript framework.
Deployment¶
For production deployment, we recommend using Uvicorn behind a reverse proxy like Nginx:
Or with Docker (see the project repository for the Dockerfile).