This is a Next.js project bootstrapped with create-next-app
.
First, run the development server:
npm run dev
# or
yarn dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying pages/index.tsx
. The page auto-updates as you edit the file.
To run tests:
npm run test
To learn more about Next.js, take a look at the following resources:
Next.js Documentation - learn about Next.js features and API.
Learn Next.js - an interactive Next.js tutorial.
Your task is to develop a simple mortgage calculator application using React and Next.js. This app will calculate and display the monthly mortgage payments, total payments over the full term, and total interest payments based on user inputs. While UI design is not the primary focus, functionality, code quality, and your approach are crucial. This application will mirror our live mortgage calculator tool.
Property Price: £100,000
Deposit: £5,000
Mortgage Term: 15 years
Interest rate: 5.25%
Monthly Payment | £763.68 |
---|---|
Total Repayment | £137,463.09 |
Capital | £95,000.00 |
Interest | £42,463.09 |
Affordability check | £921.63 |
Monthly Payment: The amount due each month to repay the mortgage, including both principal and interest.
Total Repayment: The cumulative amount paid over the term of the mortgage, encompassing the loan amount and interest.
Capital: The original sum borrowed. This excludes any interest and deposit.
Interest: The cost of borrowing money, calculated as a percentage of the principal loan amount and accumulated over the term of the mortgage.
Affordability Check: A calculation that adjusts the interest rate by an additional 3% to assess the borrower's capability to afford the mortgage under potential future interest rate increases.
Yearly breakdown: The remaining mortgage balance at the end of each year for a given mortgage term
T = M * n
Where:
C = P - D
Where:
I = T - C
Where:
Functionality:
pages/index.tsx
file, which contains a basic calculator UI built using the React Bootstrap library:utils/MortgageCalculator/calculateMonthlyRepayment.ts
.TypeScript: Utilise TypeScript to its full potential for type safety and improved code quality.
Unit Tests: Develop comprehensive unit tests for both your components and logic.
Code Quality: Ensure your code is clean, well-commented (where necessary), and adheres to the DRY principle. Organise your code for maintainability and readability.
Please note, no additional UI work is required beyond the provided basic UI
Integrate functionality to dynamically fetch the interest rate from the Bank of England's website.
The interest rate output can be found at the following URL:
https://www.bankofengland.co.uk/boeapps/iadb/fromshowcolumns.asp?csv.x=yes&Datefrom=18/Jan/2024&Dateto=18/Feb/2024&SeriesCodes=IUMABEDR&CSVF=TN&UsingCodes=Y&VPD=Y&VFD=N
Implement a solution that allows the mortgage calculator to function even when JavaScript is disabled in the user's browser. This will ensure that the website remains accessible and usable for all users.
We look forward to your solutions and wish you the best of luck!