Back to projects
Mortgage calculator

Mortgage calculator

Magda Gozdalik/ 24 March 2025

This project is deployed on Vercel.

๐Ÿก Mortgage Repayment Calculator

๐Ÿš€ Live Demo:

Simple mortgage calculator

A simple, accessible, and responsive Mortgage Repayment Calculator built with React, TypeScript, Vanilla CSS and Zod.

The calculator allows users to estimate their monthly mortgage repayments and view a detailed breakdown including interest, monthly totals, and remaining balance over time โ€” all within a modal popup.


๐Ÿš€ Getting Started

These instructions will help you set up and run the project locally.

โœ… Prerequisites

  • Node.js (v16 or higher recommended)
  • npm (comes with Node.js)

๐Ÿ“ฆ Install dependencies

npm install

๐Ÿ’ป Start the development server

npm start

This will start the app at http://localhost:3000 and reload on changes.


๐Ÿงช Run tests

npm test

Runs unit tests using Jest and React Testing Library.


๐Ÿงน Lint your code

npm run lint

Uses ESLint and Prettier to enforce consistent code style and catch errors early.


๐Ÿ“ Project Structure

src/
โ”œโ”€โ”€ components/      # Reusable UI components
โ”œโ”€โ”€ hooks/           # Reusable hooks
โ”œโ”€โ”€ styles/          # Global and modular CSS
โ”œโ”€โ”€ tests/           # Unit and component tests
โ”œโ”€โ”€ utils/           # Mortgage calculation logic
โ””โ”€โ”€ App.tsx          # Main app component
types.ts

โœจ Features

  • โœ… Modal-based UI โ€“ Opens in a popup window sized 500x500px on desktop
  • โœ… Mobile-first responsive design
  • โœ… Fluid typography for responsive design
  • โœ… Accessible form fields with labels and hints
  • โœ… Strong TypeScript typing
  • โœ… Zod validation with cross-field rules
  • โœ… Reusable FormField and Modal component
  • โœ… Simple table with monthly breakdown
  • โœ… Tests using Jest + React Testing Library
  • โœ… Prettier & ESLint for clean code

๐Ÿ›  Built With


๐Ÿ“ฆ Build for Production

npm run build

Builds the app for production to the /build folder.


๐Ÿ“ Developer Notes

For implementation details, design decisions, or technical reasoning behind certain components (e.g., the modal), please refer to NOTES.md.

๐Ÿ“„ License

This project is for educational/demo purposes. No license currently applied.