Generic, privacy-safe mortgage planning app designed for public GitHub sharing.
License: MIT (LICENSE)
- Removed all personal-looking defaults and replaced them with generic sample values.
- No file/database writes other than optional CSV export initiated by the user.
- No secret keys required.
- Input validation blocks invalid, extreme, or non-finite values.
- Novice-friendly guided flow.
- Clear assumptions and transparent metrics.
- Scenario-based planning, not prediction.
- Testable architecture with separated calculation service from UI.
app.py: Streamlit UI and user guidance.mortgage_free_analysis/models.py: validated domain models.mortgage_free_analysis/service.py: pure analysis service (reusable in API/CLI).tests/test_service.py: strict calculation/validation tests.tests/test_ui_paths.py: automated UI path tests using Streamlit test harness.
- Rate is fixed for each scenario run.
- Overpayment is applied once every 12th month.
- Insurance and recurring fee are annual costs.
- Results are planning estimates only (not financial advice).
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
streamlit run app.py --server.port 8502Open the local URL shown in terminal.
pytest -qSecurity guidance is documented in SECURITY.md.
LICENSE(MIT)- CI workflow:
.github/workflows/ci.yml - Contribution guide:
CONTRIBUTING.md - PR template:
.github/pull_request_template.md - Issue templates:
.github/ISSUE_TEMPLATE/*
GitHub Pages cannot run Streamlit directly (Pages is static hosting only).
This repo includes a Pages launch site in docs/ that links to your deployed Streamlit app.
- In GitHub repo settings, go to
Pages. - Set source to:
- Branch:
main - Folder:
/docs
- Branch:
- Save and wait for Pages to publish.
- Deploy Streamlit app (Community Cloud or other host) and copy its URL.
- Edit
docs/index.html:- Set
STREAMLIT_URLto your deployed app URL.
- Set
- Commit and push.
Then your Pages URL will act as your public website, with a button (and optional embed) for the Streamlit UI.
- Use sidebar
Inputsfor property, loan, rate, term, and annual costs. - Check KPI cards at top (payment, payoff years, interest, deposit/LTV).
- Open
Scenario Labto inspect rate sensitivity and overpayment heatmap. - Open
Compare Plansfor side-by-side strategy decisions. - Use
Cashflow Tablesand CSV export for records.
- Guided quick-start text on page.
- Validation errors shown inline with clear fixes.
- All tabs available without hidden navigation.
- Defensive bounds on all numeric inputs.
- Labels avoid country-specific assumptions where possible.
- Ensure
.venv/, caches, and editor files are ignored. - Do not commit
.streamlit/secrets.toml. - Review staged files before push:
git status
git diff --staged- Optional: add branch protection and CI for
pytestbefore merging.