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.