How santhoshk0409/budjet-buddy works
Purpose and Entry Points
Wallet Buddy is a mobile-first personal finance tracker with multi-wallet budgets, expenses, history, analytics, reports, backup/restore, offline storage, and Supabase-backed synchronization. The Vite/React client starts at src/main.tsx, mounts the application in src/App.tsx, and is hosted as a static SPA with deployment routing in vercel.json, netlify.toml, and public/_redirects.
Application Shell and Navigation
src/App.tsx is the primary UI orchestrator: it selects authenticated versus onboarding/auth states and switches among major finance views. src/components/layout/BottomNavigation.tsx provides the mobile-oriented navigation boundary for Home, History, Analytics, Reports, and Settings. Shared visual styling is rooted in src/index.css and src/App.css.
Authentication and User Scope
src/context/AuthContext.tsx owns the authenticated-user/session state exposed to the React tree. Authentication screens are separated into src/components/auth/LoginView.tsx, src/components/auth/SignUpView.tsx, and src/components/auth/SplashScreen.tsx. Supabase Auth is the external identity provider; finance data operations should be scoped by the active authenticated user.
Persistence, Offline-First, and Sync Boundary
src/db/database.ts defines the Dexie/IndexedDB local persistence layer, enabling immediate offline reads and writes. src/lib/supabase.ts initializes the Supabase client from Vite environment variables, while src/services/supabaseService.ts centralizes cloud CRUD/synchronization behavior. The Supabase PostgreSQL schema and likely row/security contract are captured in supabase_schema.sql; this is the principal boundary between local app state and the hosted backend.
Finance Domain and Data Flow
Shared domain contracts for wallets, expenses, categories, budgets, and related records live in src/types/index.ts. User actions flow from modal editors—src/components/wallet/WalletModal.tsx, src/components/expense/AddExpenseModal.tsx, and src/components/category/ExpenseTypeModal.tsx—to local storage and cloud service operations. Budget-period rollover is explicitly handled by src/components/budget/NewMonthResetModal.tsx.
Views, Analysis, and Reporting
src/views/HomeView.tsx presents the primary budget/wallet status and spending experience. Historical querying is handled by src/views/HistoryView.tsx, aided by src/components/common/CalendarDateSelector.tsx for single-date and range selection. Derived spending analysis is surfaced through src/views/AnalyticsView.tsx and src/views/ReportsView.tsx; src/views/SettingsView.tsx is the likely control point for preferences and data export/import.
Runtime and Infrastructure
The frontend is React 19 + TypeScript built and served by Vite (vite.config.ts, package.json). Browser IndexedDB is the local runtime datastore; Supabase supplies Auth, PostgreSQL, and real-time/cloud synchronization. Production deployment supports Vercel and Netlify, with VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY required for backend connectivity.
Main entry points: database.ts Dexie database · BottomNavigation.tsx Bottom navigation · App.tsx App shell · HomeView.tsx Home view
Components 20
React Client
- Vite entry
src/main.tsx - App shell · Selects auth/onboarding states and primary finance views.
src/App.tsx - Auth context
src/context/AuthContext.tsx - Auth screens
src/components/auth/LoginView.tsx - Bottom navigation
src/components/layout/BottomNavigation.tsx - Home view
src/views/HomeView.tsx - History view
src/views/HistoryView.tsx - Date selector
src/components/common/CalendarDateSelector.tsx - Analytics view
src/views/AnalyticsView.tsx - Reports view
src/views/ReportsView.tsx - Settings view
src/views/SettingsView.tsx - Wallet editor · Modal-based user actions create and update finance records.
src/components/wallet/WalletModal.tsx - New-month reset
src/components/budget/NewMonthResetModal.tsx - Finance contracts
src/types/index.ts
Offline Data
- Dexie database · Offline-first local reads and writes.
src/db/database.ts
Supabase Backend
- Supabase client
src/lib/supabase.ts - Sync service
src/services/supabaseService.ts - Supabase Auth
- Supabase PostgreSQL · Schema and row/security contract are defined in the SQL schema.
supabase_schema.sql
Other components
- Static SPA hosting
vercel.json
Connections 25
- Vite entry → App shell: mounts
- App shell → Auth context: reads session
- App shell → Auth screens: shows when unauthenticated
- App shell → Bottom navigation: renders
- Bottom navigation → Home view: opens
- Bottom navigation → History view: opens
- Bottom navigation → Analytics view: opens
- Bottom navigation → Reports view: opens
- Bottom navigation → Settings view: opens
- History view → Date selector: filters with
- Home view → Wallet editor: edits finance data
- Home view → New-month reset: triggers rollover
- Wallet editor → Finance contracts: uses records
- Wallet editor → Dexie database: writes offline
- New-month reset → Dexie database: updates budgets
- Home view → Dexie database: reads status
- History view → Dexie database: queries records
- Analytics view → Dexie database: derives spending
- Reports view → Dexie database: derives reports
- Auth context → Supabase client: uses
- Supabase client → Supabase Auth: authenticates
- Dexie database → Sync service: syncs changes
- Sync service → Supabase client: uses client
- Sync service → Supabase PostgreSQL: scoped cloud CRUD
- Static SPA hosting → Vite entry: serves SPA