Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

My Budget Scenario

Overview

The scenario mode lets visitors enter their personal financial details and see personalized affordability across all regions. No account needed – data is stored in the browser’s localStorage.

Inputs

FieldDefaultDescription
Net income(required)Monthly net income in CZK
Current savings0Existing savings in CZK
Flat size60 m2Target flat size
Mortgage rate5.0%Annual mortgage interest rate
LTV80%Loan-to-value ratio
Mortgage term30 yearsLoan duration
Monthly expenses17,000 CZKLiving expenses (excl. housing)
Investment return7%Expected annual return on savings

Outputs per region

  • Flat price: avg_price_m2 * flat_size_m2
  • Deposit needed: flat_price * (1 - LTV/100)
  • Deposit gap: max(deposit_needed - current_savings, 0)
  • Monthly payment: Standard mortgage amortization
  • Payment/income %: Affordability ratio (< 40% = affordable)
  • Monthly surplus: max(net_income - expenses, 0)
  • Years to deposit: Time to save the deposit gap (with investment returns)

Cross-page behavior

  • Index page: Full scenario form + personalized region cards sorted by affordability
  • Region page: Personalized hero stats + prefilled calculators
  • Compare page: Toggle between default view and personalized ranking table
  • Persistence: Form values auto-restore on page reload from localStorage

Implementation

  • Backend: src/compute/scenario.rs (engine) + src/server/api/scenario.rs (4 HTMX endpoints)
  • Frontend: static/scenario.js (localStorage + form management + cross-page sync)