This project is a mortgage calculator API that you can use either through the provided UI or through an API request tool like Flashpost.
- Clone the repository.
- Navigate to the project folder.
- Install dependencies using either
pnpm
ornpm
:
pnpm install
# or
npm install
Start the server by running:
pnpm start
# or
npm start
The server will start on port 3001(http://localhost:3001/). The command line will provide a link to access the UI.
Start the tailwind by running:
pnpm tw
# or
npm tw
Start the test by running:
pnpm test
# or
npm test
You can use the API with any tool you like (e.g., Flashpost, Postman) to (http://localhost:3001/api/mortgage) a POST request as application/json. The API accepts the following payload:
{
"propertyPrice": 600000,
"downPayment": 60000,
"annualInterestRate": 4.49,
"amortizationPeriod": 25,
"paymentSchedule": "Monthly"
}
Input Ranges and Values:
- propertyPrice: Positive number (e.g., 600000).
- downPayment: Positive number. This can either be the dollar amount or a percentage of the property price.
- annualInterestRate: Number greater than 0.01.
- amortizationPeriod: One of the following values: 5, 10, 15, 20, 25, 30.
- paymentSchedule: One of the following values: "Monthly", "Bi-weekly", "Accelerated bi-weekly".