A lightweight React + TypeScript web app to manage shared group expenses with:
- group and member management
- equal or custom expense splitting
- real-time balance and debt simplification
- settlement tracking
- AI-powered expense categorization and spending insights
- React + Vite + TypeScript
- LocalStorage for persistence
- Vitest for unit testing
- Optional Gemini API integration from the client
-
Group Setup
- Create groups
- Add members to each group
- Switch between groups
-
Expense Tracking
- Add expense description, amount, payer, participants
- Split equally or provide custom per-person amounts
- Validate custom totals before saving
-
Balance Calculation
- Auto-calculate per-member net balances
- Show simplified
who owes whomtransfers - Record settlements to adjust balances in real-time
-
AI Enhancements
- Category prediction from expense descriptions
- Spending insights generated from grouped expense patterns
- Deterministic fallback when API key is unavailable
src/types/expense.ts- domain modelssrc/lib/split.ts- split and validation logicsrc/lib/balance.ts- balance and debt simplification enginesrc/lib/insights.ts- analytics summary and fallback insightssrc/store/useExpenseStore.ts- app state and persistence logicsrc/services/ai.ts- categorization + AI insights layersrc/components/*- UI modulessrc/lib/__tests__/*- unit tests for core math logic
- Install dependencies:
npm install
- Copy env file:
copy .env.example .env
- Add your key (optional):
VITE_GEMINI_API_KEY=...
- Start the app:
npm run dev
npm run dev- start development servernpm run build- type-check and production buildnpm run lint- lint codenpm run test- watch testsnpm run test:run- run tests once
- Import repository in Vercel
- Framework preset:
Vite - Build command:
npm run build - Output directory:
dist - Add env vars from
.envin Vercel project settings
- Import repository in Netlify
- Build command:
npm run build - Publish directory:
dist - Add env vars from
.envin Netlify site settings
- Core financial logic is isolated from UI to keep behavior testable.
- Splits are computed at cent-level precision to reduce rounding drift.
- Balances are simplified into minimum transfers for clearer settlement output.
- AI service is optional and fault-tolerant via deterministic fallbacks.
- Create group and members
- Add equal split expense
- Add custom split expense
- Show live balances and debt summary
- Record a settlement
- Show category chips and AI insights panel
- Mention deployment URL