How harshpathak11/splitwise works
FairFare is a social expense-splitting app for friends and groups. A user enters through the React application, uses friend, trip, and expense features, and the backend handles authenticated requests against MongoDB-backed domain data; users then review balances, history, and analytics. The backend also provides AI assistance and expense categorization, financial snapshots, and notifications. The graph includes documented product capabilities whose implementations were not sampled, but omits unverified links to them; some frontend-to-backend wiring is likewise not shown in the excerpts.
Main entry points: App.jsx React application · user.js User and friend logic · index.js Express server · schema.js Domain records
Components 27
Web client
- React application
frontend/src/App.jsx - Expense workflows
frontend/src/components/PersonalExpense.jsx - Trips and groups
frontend/src/components/tripDetails.jsx - Friend management
frontend/src/components/addFriend.jsx - Transaction history
frontend/src/components/TransactionHistory.jsx - Spending analytics
frontend/src/components/Analytics.jsx - API client
frontend/src/utils/api.js
Backend API
- Express server
backend/index.js - User routes
backend/routes/user.js - Group routes
backend/routes/group.js - Expense routes
backend/routes/expense.js - AI routes
backend/routes/ai.js - JWT authentication
backend/middleware/auth.js
Expense domain
- User and friend logic
backend/controllers/user.js - Group expense logic
backend/controllers/groups.js - Expense endpoints
backend/controllers/expenses.js - Domain records
backend/models/schema.js
Insights and AI
- Financial snapshots
backend/controllers/snapshots.js - FAIR AI assistant
backend/controllers/ai.js - Expense categorizer
backend/service/expenseCategorizer.js - AI categorization worker
backend/service/categorizerWorker.js
External services
- Gemini AI
- Notification service
backend/service/notificationService.js - Firebase messaging
- Mail service
- Cloudinary media
Other components
- FairFare user
Connections 37
- FairFare user → React application: uses
README.md - React application → Expense workflows: routes to
frontend/src/App.jsx - React application → Trips and groups: routes to
frontend/src/App.jsx - React application → Friend management: routes to
frontend/src/App.jsx - React application → Transaction history: routes to
frontend/src/App.jsx - React application → Spending analytics: routes to
frontend/src/App.jsx - Transaction history → API client: requests data
frontend/src/components/TransactionHistory.jsx - Express server → User routes: mounts
backend/index.js - Express server → Group routes: mounts
backend/index.js - Express server → Expense routes: mounts
backend/index.js - Express server → AI routes: mounts
backend/index.js - User routes → JWT authentication: guards routes
backend/routes/user.js - Group routes → JWT authentication: guards routes
backend/routes/group.js - Expense routes → JWT authentication: guards routes
backend/routes/expense.js - AI routes → JWT authentication: guards routes
backend/routes/ai.js - User routes → User and friend logic: dispatches
backend/routes/user.js - User routes → FAIR AI assistant: dispatches
backend/routes/user.js - Group routes → Group expense logic: dispatches
backend/routes/group.js - Expense routes → Expense endpoints: dispatches
backend/routes/expense.js - AI routes → FAIR AI assistant: dispatches
backend/routes/ai.js - User and friend logic → Domain records: reads and writes
backend/controllers/user.js - Group expense logic → Domain records: reads and writes
backend/controllers/groups.js - Expense endpoints → Domain records: reads and writes
- FAIR AI assistant → Domain records: reads context
backend/controllers/ai.js - User and friend logic → Financial snapshots: updates snapshots
backend/controllers/user.js - Group expense logic → Financial snapshots: updates snapshots
backend/controllers/groups.js - Express server → Expense categorizer: starts
backend/index.js - Expense categorizer → AI categorization worker: delegates
backend/service/expenseCategorizer.js - Expense categorizer → Domain records: reads and writes
backend/service/expenseCategorizer.js - AI categorization worker → Domain records: reads and writes
backend/service/categorizerWorker.js - AI categorization worker → Gemini AI: categorizes with
backend/service/categorizerWorker.js - FAIR AI assistant → Gemini AI: answers with
backend/controllers/ai.js - User and friend logic → Notification service: sends alerts
backend/controllers/user.js - Group expense logic → Notification service: sends alerts
backend/controllers/groups.js - Notification service → Firebase messaging: sends push
backend/service/notificationService.js - User and friend logic → Mail service: sends email
backend/controllers/user.js - User and friend logic → Cloudinary media: uploads photos