This is a 🌐 web application built using Django 🐍 for calculating mortgage payment details, including amortization, interest payments, and tax deductions. The app provides a detailed breakdown of the loan balance and payment details, along with 📊 informative charts to help visualize the mortgage situation.
I had need to calculate mortgage payments for me to facilitate my financial choices. Many banks already provide this information but I wanted to have a tool that would allow me to see the impact of different choices on my mortgage easily. I also wanted to have a tool that would allow me to see the impact of reinvesting tax deductions on my mortgage. This is why I decided to build this tool. Such tool, especially if expanded is to facilitate informed financial choices for people who are struggling with deciding what to do with their money.
- 📅 Mortgage Payment Calculator: Calculate monthly payments including interest, amortization, and association fees.
- 💸 Tax Deduction Reinvestment Option: Option to reinvest tax deductions back into the loan to reduce the remaining balance.
- 📈 Visual Analysis: Interactive charts and tables for easy visualization of the mortgage situation.
- 📊 Yearly and Monthly Breakdown: Detailed table and yearly summaries.
- Backend: Django 🐍
- Frontend: HTML, CSS, Bootstrap, jQuery, Chart.js
- Database: PostgreSQL 🗄️ (for deployment)
- Deployment Tools: Railway 🚄, Render, or PythonAnywhere 🐍
- Python 3.8+ 🐍 installed on your machine.
- pip: 📦 Package installer for Python.
- Virtualenv (optional but recommended).
-
📂 Clone the repository:
git clone https://github.com/horotat/mortgage_calculator.git cd mortgage-calculator
-
💻 Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
⬇️ Install dependencies:
pip install -r requirements.txt
-
🔧 Set up environment variables:
Create a
.env
file and add the following:DEBUG=True SECRET_KEY=your_secret_key_here ALLOWED_HOSTS=* DATABASE_URL=postgres://user:password@localhost:5432/dbname
-
🗃️ Apply migrations:
python manage.py migrate
-
🚀 Run the development server:
python manage.py runserver
-
🌐 Access the application:
Open your browser and navigate to
http://127.0.0.1:8000/
.
To deploy the application, you can use a platform like Railway 🚄, Render, or PythonAnywhere 🐍. Make sure to update the settings for production, including setting DEBUG=False
and properly configuring ALLOWED_HOSTS
and the database connection.
- Create a Railway Account and link your GitHub repository.
- Configure environment variables in Railway.
- Deploy the project. Railway will build and deploy the container for you.
- Enter Mortgage Details: 📝 Fill in the interest rate, purchase price, deposit, monthly amortization, and association fees.
- Calculate: Click the "Calculate" button to generate a detailed breakdown.
- View Results: 📊 See a table with monthly breakdowns, yearly summaries, and visual charts.
- Form Page: 📝 Clean form layout to input mortgage details.
- Results Page: 📊 Detailed summary, informative tables, and beautiful charts.
See requirements.txt
for dependencies.
🔮 I'd like to add the following features in the future:
- 📊 Comparison Tool: Compare different mortgage options side by side. Especially comparing taking out a mortgage to buy a house vs. renting and investing the money instead with expected returns 📈 and profits compared to real estate.
- 👥 User Authentication: Allow users to save mortgage details and compare different scenarios.
- 🔄 Slider in the Summary: Allow users to change the mortgage details in the summary box at the top of the results page, to see how the charts 📊 and the tables 📋 change with slight adjustments to the mortgage details.
Feel free to submit pull requests and report issues. Contributions are welcome!
- 🍴 Fork the repository.
- Create a feature branch (
git checkout -b feature-branch-name
). - Commit your changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature-branch-name
). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE
file for more information.