How splitwisee/frontend works
Splitwise is a localized personal-finance platform. Its main workflow is profile completion, budgeting data entry and prediction, dashboard review, then investment planning and portfolio tracking. Authentication and the Drizzle-backed database support these flows. The README also describes shared expenses and PWA support; the tree has PWA assets, but no clearly identifiable shared-expense implementation, so that capability is not expanded into an unsupported subsystem. Connections below rely on shown excerpts, SOURCE INDEX references, or README statements; unsampled feature internals are represented at their directory paths.
Main entry points: auth.ts Auth sessions · db.ts Database client · route.ts Budget API · lib.ts Portfolio operations
Components 21
Identity and localization
- Login flow
app/[locale]/(auth)/login/page.tsx - Profile completion
app/api/user/complete-profile/route.ts - Auth sessions
lib/auth.ts - Locale routing
i18n/routing.ts
Budgeting
- Budget onboarding and audit
app/[locale]/feature/budgeting/components - Budget request handler
app/[locale]/feature/budgeting/utils/handler.ts - Financial estimates
app/[locale]/feature/budgeting/lib/financial-estimates.ts - Budget API
app/api/budgeting/route.ts
Dashboard
- Dashboard view
app/[locale]/(routes)/app/components/dashboard-client.tsx - Interactive chart
app/[locale]/(routes)/app/components/chart-interactive.tsx
Investment
- Investment screens
app/[locale]/feature/investment - Investment calculations
app/[locale]/feature/investment/lib/investment-calculations.ts - Investment plan API
app/api/investment-plan/route.ts - Portfolio API
app/api/investment-portfolios/route.ts - Portfolio detail API
app/api/investment-portfolios/[id]/route.ts - Portfolio operations
app/api/investment-portfolios/lib.ts - Instrument catalog API
app/api/investment-instruments/route.ts
Platform state
- Database client
lib/db/db.ts - Finance and user tables
lib/db/schema.ts - PWA service worker
public/sw.js
Other components
- User
Connections 34
- User → Login flow: signs in
- Login flow → Auth sessions: authenticates
- Auth sessions → Database client: uses adapter
lib/auth.ts - Auth sessions → Finance and user tables: reads profile
lib/auth.ts - User → Profile completion: completes profile
- Profile completion → Auth sessions: checks session
app/api/user/complete-profile/route.ts - Profile completion → Database client: updates profile
app/api/user/complete-profile/route.ts - User → Budget onboarding and audit: enters finances
- Budget onboarding and audit → Budget request handler: submits audit
app/[locale]/feature/budgeting/components/budgeting-audit-review.tsx - Budget request handler → Financial estimates: estimates profile
app/[locale]/feature/budgeting/utils/handler.ts - Budget request handler → Budget API: sends request
app/[locale]/feature/budgeting/utils/handler.ts - Budget API → Auth sessions: checks session
app/api/budgeting/route.ts - Budget API → Database client: reads and writes
app/api/budgeting/route.ts - Budget API → Finance and user tables: queries budget
app/api/budgeting/route.ts - Budget API → Financial estimates: builds prediction
app/api/budgeting/route.ts - Budget API → Budget onboarding and audit: returns audit data
- Dashboard view → Budget request handler: loads budget
app/[locale]/(routes)/app/components/dashboard-client.tsx - Dashboard view → Investment screens: loads investment
app/[locale]/(routes)/app/components/dashboard-client.tsx - Dashboard view → Interactive chart: renders chart
app/[locale]/(routes)/app/components/dashboard-client.tsx - User → Investment screens: plans investments
- Investment screens → Investment plan API: manages plan
app/api/investment-plan/route.ts - Investment plan API → Investment calculations: projects returns
app/api/investment-plan/route.ts - Investment plan API → Auth sessions: checks session
app/api/investment-plan/route.ts - Investment plan API → Database client: reads and writes
app/api/investment-plan/route.ts - Portfolio API → Portfolio operations: uses operations
app/api/investment-portfolios/route.ts - Portfolio API → Auth sessions: checks session
app/api/investment-portfolios/route.ts - Portfolio API → Database client: stores portfolio
app/api/investment-portfolios/route.ts - Portfolio detail API → Portfolio operations: loads details
app/api/investment-portfolios/[id]/route.ts - Portfolio operations → Investment calculations: calculates values
app/api/investment-portfolios/lib.ts - Portfolio operations → Database client: queries holdings
app/api/investment-portfolios/lib.ts - Instrument catalog API → Portfolio operations: uses catalog logic
app/api/investment-instruments/route.ts - Database client → Finance and user tables: configures schema
lib/db/db.ts - User → Locale routing: chooses language
- User → PWA service worker: installs app