An interactive calculator to help understand UK student loan repayment under Plan 2/Plan 5 and Postgraduate loans.
- Calculate total repayment amounts based on salary
- Visualise repayment timelines and effective rates
- Compare Plan 2 (pre-2023) vs Plan 5 (post-2023)
- Account for Postgraduate loans running concurrently
- See personalised projections based on your salary
- Framework: Next.js 16 with App Router
- Language: TypeScript 5
- Styling: Tailwind CSS 4 + ShadCN components
- Charts: Visx
- State Management: Zustand with Immer
- Testing: Vitest + React Testing Library
- Node.js 18+
- pnpm
# Install dependencies
pnpm install
# Start development server
pnpm devOpen http://localhost:3000 to view the app.
| Command | Description |
|---|---|
pnpm dev |
Start development server |
pnpm build |
Build for production |
pnpm start |
Start production server |
pnpm lint |
Run ESLint |
pnpm test |
Run tests in watch mode |
pnpm test:coverage |
Run tests with coverage |
src/
app/ # Next.js App Router
layout.tsx # Root layout with metadata
page.tsx # Main calculator page
components/ # React components
ui/ # ShadCN UI components
hooks/ # Custom React hooks
utils/ # Utility functions
types/ # TypeScript types
lib/ # Shared utilities
store.ts # Zustand store
constants.ts # Application constants
The app is deployed on Vercel. Push to main to trigger a deployment.
- Repayment threshold: 2,274/month
- Repayment rate: 9% above threshold
- Interest: RPI to RPI+3% based on income
- Write-off: 30 years after first repayment
- Repayment threshold: 2,083/month
- Repayment rate: 9% above threshold
- Interest: RPI only (no sliding scale)
- Write-off: 40 years after first repayment
- Repayment threshold: 1,750/month
- Repayment rate: 6% above threshold
- Runs concurrently with undergraduate loan
MIT