How trimulia02/kasbon works
Kasbon is a personal debt-tracking app. Users sign up or log in, then manage debts from a dashboard: add/edit, settle, delete, filter, search, sort, and view outstanding totals and a two-bar comparison chart. The dashboard loads list and summary data through separate API requests; API handlers validate input, authenticate the user, and read or mutate Supabase rows. The README documents user-scoped row-level security. Some wiring is supported only by the README or SOURCE INDEX; unsampled implementation details are not inferred.
Main entry points: DashboardClient.tsx Dashboard controller · debts/route.ts List and create · [id]/route.ts Update and delete · server.ts Server client
Components 24
Authentication
- Auth form
src/components/auth/AuthForm.tsx - Auth actions
src/lib/auth/actions.ts
Dashboard
- Dashboard header
src/components/layout/Header.tsx - Dashboard controller
src/components/dashboard/DashboardClient.tsx - Debt form
src/components/dashboard/DebtFormModal.tsx - Debt list
src/components/dashboard/DebtList.tsx - Debt row
src/components/dashboard/DebtRow.tsx - Filters and sort
src/components/dashboard/FilterBar.tsx - Summary cards
src/components/dashboard/SummaryCards.tsx - Debt chart
src/components/dashboard/DebtsChart.tsx - Delete confirmation
src/components/ui/ConfirmDialog.tsx - Modal shell
src/components/ui/Modal.tsx - Debt list hook
src/hooks/useDebts.ts - Summary hook
src/hooks/useDebtSummary.ts
Debt API
- List and create
src/app/api/debts/route.ts - Update and delete
src/app/api/debts/[id]/route.ts
Data and security
- Server client
src/lib/supabase/server.ts - Session refresh
src/lib/supabase/middleware.ts - Request gate
src/proxy.ts
Shared domain
- Input schemas
src/lib/validation.ts - Debt mapping
src/types/debt.ts - Date and currency
src/lib/format.ts
Other components
- User
- Supabase Auth and PostgreSQL
Connections 34
- User → Auth form: enters credentials
README.md - Auth form → Auth actions: submits form
src/components/auth/AuthForm.tsx - Auth actions → Server client: creates client
src/lib/auth/actions.ts - Server client → Supabase Auth and PostgreSQL: authenticates
- User → Dashboard controller: opens dashboard
README.md - Dashboard controller → Dashboard header: renders
src/components/dashboard/DashboardClient.tsx - Dashboard controller → Filters and sort: renders
src/components/dashboard/DashboardClient.tsx - Dashboard controller → Debt list: renders
src/components/dashboard/DashboardClient.tsx - Dashboard controller → Debt form: renders
src/components/dashboard/DashboardClient.tsx - Dashboard controller → Delete confirmation: renders
src/components/dashboard/DashboardClient.tsx - Dashboard controller → Summary cards: renders
src/components/dashboard/DashboardClient.tsx - Dashboard controller → Debt chart: renders
src/components/dashboard/DashboardClient.tsx - Debt form → Modal shell: uses shell
src/components/dashboard/DebtFormModal.tsx - Delete confirmation → Modal shell: uses shell
src/components/ui/ConfirmDialog.tsx - Debt list → Debt row: renders rows
src/components/dashboard/DebtList.tsx - Dashboard controller → Debt list hook: loads debts
src/components/dashboard/DashboardClient.tsx - Dashboard controller → Summary hook: loads totals
src/components/dashboard/DashboardClient.tsx - Summary hook → Debt list hook: loads unsettled
src/hooks/useDebtSummary.ts - Debt list hook → List and create: fetches list
src/hooks/useDebts.ts - Dashboard controller → List and create: creates debt
src/components/dashboard/DashboardClient.tsx - Dashboard controller → Update and delete: updates or deletes
src/components/dashboard/DashboardClient.tsx - List and create → Input schemas: validates input
src/app/api/debts/route.ts - Update and delete → Input schemas: validates updates
src/app/api/debts/[id]/route.ts - List and create → Server client: creates client
src/app/api/debts/route.ts - Update and delete → Server client: creates client
src/app/api/debts/[id]/route.ts - List and create → Supabase Auth and PostgreSQL: reads and inserts
src/app/api/debts/route.ts - Update and delete → Supabase Auth and PostgreSQL: updates and deletes
src/app/api/debts/[id]/route.ts - List and create → Debt mapping: maps rows
src/app/api/debts/route.ts - Update and delete → Debt mapping: maps rows
src/app/api/debts/[id]/route.ts - Request gate → Session refresh: refreshes session
src/proxy.ts - Session refresh → Supabase Auth and PostgreSQL: refreshes auth session
- Supabase Auth and PostgreSQL → User: authenticates session
- Debt mapping → Date and currency: formats display values
- Dashboard controller → Date and currency: formats delete amount
src/components/dashboard/DashboardClient.tsx