How nathoyina/financial-goal-calculator works
This is a browser-only Singapore retirement-planning app: users enter personal, income, spending, CPF, loan, and education assumptions, then receive a retirement verdict, projected cash and gap, guidance, and a balance chart. The main runtime path runs from the planner UI through form parsing into the plan calculation; CPF projection and education/loan calculations support that result. The README documents the major outputs and inputs. Several subsystem links are based on README descriptions or index references because their full implementation was not sampled; no account or server-side persistence is documented.
Main entry points: planner-app.tsx Planner workflow · plan.ts Retirement projection · plan-form.ts Form validation · suggestion-preview.ts Gap suggestions
Components 21
Planner experience
- Planner workflow
src/components/planner-app.tsx - Number fields
src/components/number-field.tsx - Child education
src/components/child-education.tsx - Suggestion preview UI
src/components/suggestion-preview.tsx - Estimate labels
src/components/estimate-tag.tsx - In-memory analytics
src/lib/analytics/track.ts
Plan inputs
- Form validation
src/lib/finance/plan-form.ts - Education choices
src/lib/finance/education-choice.ts - Education presets
src/lib/education/constants.ts - Goal registry
src/lib/goals/registry.ts
Projection engine
- Retirement projection
src/lib/finance/plan.ts - CPF projection
src/lib/cpf/project.ts - CPF reference tables
src/lib/cpf/constants.ts - Housing loan
src/lib/finance/loan.ts - Education costs
src/lib/finance/education.ts - Return rates
src/lib/finance/rates.ts
Results and guidance
- Retirement guidance
src/lib/finance/guidance.ts - Gap suggestions
src/lib/finance/suggestion-preview.ts - Balance chart
src/components/balance-chart.tsx - Financial formatting
src/lib/finance/format.ts
Other components
- Planner user
Connections 25
- Planner user → Planner workflow: enters assumptions
README.md - Planner workflow → Number fields: renders fields
src/components/planner-app.tsx - Planner workflow → Child education: renders education
src/components/planner-app.tsx - Planner workflow → Estimate labels: renders labels
src/components/planner-app.tsx - Planner workflow → Form validation: parses plan
src/components/planner-app.tsx - Child education → Education choices: uses choices
src/components/child-education.tsx - Education choices → Education presets: reads presets
src/lib/finance/education-choice.ts - Form validation → Education choices: parses education
src/lib/finance/plan-form.ts - Form validation → Retirement projection: calculates plan
src/lib/finance/plan-form.ts - Retirement projection → CPF projection: projects CPF
src/lib/finance/plan.ts - CPF projection → CPF reference tables: reads tables
src/lib/cpf/project.ts - Retirement projection → Housing loan: uses loan schedule
src/lib/finance/plan.ts - Retirement projection → Education costs: projects withdrawals
src/lib/finance/plan.ts - Retirement projection → Return rates: computes returns
src/lib/finance/plan.ts - Planner workflow → Suggestion preview UI: renders suggestions
src/components/planner-app.tsx - Suggestion preview UI → Gap suggestions: builds previews
src/components/suggestion-preview.tsx - Gap suggestions → Form validation: reparses changes
src/lib/finance/suggestion-preview.ts - Gap suggestions → Retirement projection: recalculates preview
src/lib/finance/suggestion-preview.ts - Planner workflow → Balance chart: renders projection
src/components/planner-app.tsx - Balance chart → Financial formatting: formats values
src/components/balance-chart.tsx - Balance chart → Retirement guidance: converts balances
src/components/balance-chart.tsx - Retirement projection → Retirement guidance: uses guidance
src/lib/finance/plan.ts - Retirement guidance → CPF projection: uses contributions
src/lib/finance/guidance.ts - Planner workflow → In-memory analytics: tracks events
src/components/planner-app.tsx - Goal registry → Retirement projection: registers retirement
src/lib/goals/registry.ts