A Streamlit-based Rent vs Buy financial simulator with a premium dark fintech UI and both deterministic + Monte Carlo analysis.
Disclaimer: This tool is for educational purposes only and is not financial, tax, or legal advice.
- Deterministic and Monte Carlo evaluation of rent vs buy outcomes
- Before-tax and after-tax reporting
- Breakeven solvers (deterministic + volatility-aware)
- Heatmap exploration with selectable comparison axes
- Scenario save/load with stable
st.session_statekeys - Custom dark tooltip system (avoids Streamlit native help popovers)
- Playwright snapshot harness for UI regression safety
- Expert mode hides advanced sensitivity toggles (hypothetical policy + registered shelter approximation)
The Taxes & Cash-out panel includes an Expert mode switch. When off (default), the app hides advanced sensitivity knobs like hypothetical capital-gains inclusion changes and the registered-shelter approximation, ensuring baseline behavior stays conservative.
- Python 3.10+ recommended
pip install -r requirements.txtFor reproducible builds (CI / production):
pip install -r requirements.lockstreamlit run app.pyBuild and run with Docker:
docker build -t rbv-simulator .
docker run -p 8501:8501 rbv-simulatorOr use Docker Compose:
docker-compose upThen open http://localhost:8501.
Run the full QA suite:
python run_all_qa.pyRuns repo sanity checks + QA (and optionally visual smoke snapshots).
python scripts/preflight.py
# or
make preflight-fastTo also run Playwright smoke snapshots:
python scripts/preflight.py --run-vr-smoke
# or
make preflightThis repo includes a lightweight Playwright harness to prevent "fixed → regressed" UI loops.
Install dev deps:
pip install -r requirements-dev.txt
python -m playwright install --with-deps chromiumUpdate baselines (writes into tools/visual_regression/baseline/):
python tools/visual_regression/vr_playwright.py --update-baselineCompare against baselines:
python tools/visual_regression/vr_playwright.pySmoke snapshots only (no baseline compare):
python tools/visual_regression/vr_playwright.py --smokeSee docs/RELEASE_CHECKLIST.md for the full checklist (preflight, baselines, tagging, and GitHub release automation).
app.py: Streamlit UI orchestratorrbv/: modular core (engine, UI theme, helpers)rbv/qa/+run_all_qa.py: QA gatestools/visual_regression/: Playwright snapshot harnessscripts/preflight.py: repo sanity + QA checks before pushing
Note: Screenshots are captured from the live app. To update, run the Playwright snapshot harness:
python tools/visual_regression/vr_playwright.py --smoke
The dark fintech-themed interface with all core inputs visible:
Net worth trajectories with confidence bands from correlated Monte Carlo simulation:
Dual-axis parameter sweep showing buy vs rent outcomes across different scenarios:
Advanced configuration including province selection, mortgage parameters, and economic assumptions:
MIT — see LICENSE.



