How ldugaduga/lending-app works
This TanStack Start lending app manages borrowers, loan schedules, payments, collections, and a client trust-fund ledger. The main workflow runs from browser routes to server functions: loan terms are previewed or committed with an amortization schedule, payments are recorded against installments, and collections are derived from outstanding installments. The README and sampled files support these principal paths; unsampled server and route implementations are represented only where the README or source index documents their roles.
Main entry points: trustFund.ts Trust fund ledger · router.tsx App routing · clients.tsx Client management · loans.index.tsx Loan creation
Components 16
Web application
- App routing
src/router.tsx - Client management
src/routes/clients.tsx - Loan creation
src/routes/loans.index.tsx - Loan details
src/routes/loans.$loanId.tsx - Collections view
src/routes/collections.tsx - Fund contributions
src/routes/contribution.tsx - UI primitives
src/components/ui
Lending operations
- Client operations
src/server/clients.ts - Loan operations
src/server/loans.ts - Schedule engine
src/lib/loan-engine.ts - Payment recording
src/server/payments.ts - Installment collections
src/server/collections.ts
Trust fund
- Trust fund ledger
src/server/trustFund.ts - Balance utilities
src/lib/utils.ts
Persistence
- Lending database
src/db/schema.ts
Other components
- Lending staff
Connections 30
- Lending staff → App routing: uses
- App routing → Client management: routes to
src/routeTree.gen.ts - App routing → Loan creation: routes to
src/routeTree.gen.ts - App routing → Loan details: routes to
src/routeTree.gen.ts - App routing → Collections view: routes to
src/routeTree.gen.ts - App routing → Fund contributions: routes to
src/routeTree.gen.ts - Client management → Client operations: calls
src/routes/clients.tsx - Client management → Trust fund ledger: calls
src/routes/clients.tsx - Loan creation → Loan operations: calls
src/routes/loans.index.tsx - Loan creation → Client operations: calls
src/routes/loans.index.tsx - Loan creation → Trust fund ledger: calls
src/routes/loans.index.tsx - Loan details → Loan operations: calls
src/routes/loans.$loanId.tsx - Loan details → Payment recording: records payment
src/routes/loans.$loanId.tsx - Collections view → Installment collections: loads view
src/routes/collections.tsx - Fund contributions → Trust fund ledger: manages funds
src/routes/contribution.tsx - Loan operations → Schedule engine: generates schedule
src/server/loans.ts - Client operations → Lending database: reads and writes
src/server/clients.ts - Loan operations → Lending database: reads and writes
src/server/loans.ts - Payment recording → Lending database: records payments
src/server/payments.ts - Installment collections → Lending database: reads installments
src/server/collections.ts - Trust fund ledger → Lending database: reads and writes
src/server/trustFund.ts - Trust fund ledger → Loan operations: gets earnings
src/server/trustFund.ts - Trust fund ledger → Client operations: lists clients
src/server/trustFund.ts - Trust fund ledger → Schedule engine: distributes money
src/server/trustFund.ts - Client management → Balance utilities: calculates balances
src/routes/clients.tsx - Client management → UI primitives: renders controls
src/routes/clients.tsx - Loan creation → UI primitives: renders controls
src/routes/loans.index.tsx - Loan details → UI primitives: renders controls
src/routes/loans.$loanId.tsx - Collections view → UI primitives: renders controls
src/routes/collections.tsx - Fund contributions → UI primitives: renders controls
src/routes/contribution.tsx