SplitBuddy is a full-stack expense-sharing web application designed to simplify group finances. Whether you're splitting bills with friends, roommates, or colleagues, SplitBuddy ensures transparency, fairness, and minimal transactions with an optimized settlement system.
-
π± Fully Responsive Modern UI
Clean, intuitive, and mobile-friendly interface for seamless usage across devices. -
π Google OAuth Authentication
Secure and hassle-free login using Google accounts. -
π₯ Add Friends via Email
Easily connect and manage expenses with your network. -
π° Expense Splitting System
Add expenses, split equally or unequally, and track balances in real-time. -
β‘ Intelligent "Settle Up" Algorithm
Minimizes the number of transactions using an optimized approach based on priority queues. -
π Real-Time Notifications
Get instant updates for new expenses, settlements, and friend activity. -
π‘οΈ Rate Limiting for Security
Prevents abuse and ensures API stability.
Frontend
- React.js
- Tailwind CSS / CSS Modules
- Axios
Backend
- Node.js
- Express.js
Database
- MongoDB (Mongoose ORM)
Authentication
- Google OAuth 2.0
- JWT (JSON Web Tokens)
Other Tools
- Redis (for rate limiting / caching)
- Nodemailer (email services)
- WebSockets / Socket.io (for real-time notifications)
- Users can create expenses and split them among participants.
- Each transaction updates a balance sheet representing who owes whom.
- The system maintains a net balance for each user.
SplitBuddy uses a Priority Queue (Min Heap / Max Heap) based approach to minimize the number of transactions:
- Creditors (positive balances) are stored in a Max Heap
- Debtors (negative balances) are stored in a Min Heap
- The system repeatedly matches the highest creditor with the highest debtor
- Transactions are settled greedily until all balances reach zero
- A naive greedy approach may not minimize the number of transactions.
- Using heaps ensures:
- Efficient selection of largest debts/credits
- Reduced total transactions
- Time complexity optimization
This results in a cleaner and more practical settlement experience.
# π SplitBuddy Project Structure
βββ π backend/ # Node.js + Express Backend
β βββ π src/
β β βββ π controllers/ # Request handlers/Logic (e.g., authController.js)
β β βββ π models/ # MongoDB database schemas (User, Expense, Notification)
β β βββ π routes/ # API Endpoints layout (e.g., authRoutes.js, settleRoutes.js)
β β βββ π services/ # Core business logic (e.g., AuthService, NotificationService)
β βββ π .env # Backend environment variables (DB Uri, JWT Secret)
β βββ π package.json # Backend dependencies
β
βββ π src/ # Frontend (React + Vite + Tailwind)
β βββ π api/ # Axios instance and API call wrappers
β βββ π components/ # Reusable UI & Mascot components (e.g., NotificationDropdown.jsx)
β βββ π context/ # React Context Providers
β βββ π hooks/ # Custom React hooks
β βββ π integrations/ # Configuration for third-party setups (like Supabase, etc)
β βββ π lib/ # Utility functions
β βββ π pages/ # Main Application Views (Dashboard.jsx, LoginPage.jsx, etc.)
β βββ π store/ # Zustand State Management (authStore, dashboardStore, settleupStore)
β βββ π App.jsx # Main React Router & Component Wrapper
β βββ π main.jsx # React DOM entry point
β βββ π index.css # Main styling, Tailwind directives
β
βββ π public/ # Static non-compiled assets (favicons, images)
βββ π package.json # Frontend dependencies and npm scripts
βββ π tailwind.config.ts # Tailwind CSS styling and theme configuration
βββ π vite.config.ts # Vite bundler configuration
βββ π vercel.json # Vercel configuration for client-side routing
βββ π .env # Frontend environment variables (Vite Google Client ID)
git clone https://github.com/your-username/splitbuddy.git
cd splitbuddyFrontend
cd frontend
npm installBackend
cd backend
npm installCreate a .env file in the backend and frontend directories.
Start Backend
cd backend
npm run devStart Frontend
cd frontend
npm startPORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
EMAIL_USER=your_email
EMAIL_PASS=your_email_password
REDIS_URL=your_redis_urlREACT_APP_API_URL=http://localhost:5000/api
REACT_APP_GOOGLE_CLIENT_ID=your_google_client_idPOST /api/auth/googleGET /api/auth/user
POST /api/expensesGET /api/expensesPOST /api/expenses/settle
POST /api/friends/addGET /api/friends
GET /api/notificationsPATCH /api/notifications/read
- π« Rate Limiting
- π JWT Authentication
- π§± Secure API Handling
- π Advanced analytics and spending insights
- π± Native mobile app (React Native)
- π Multi-currency support
- π§Ύ Receipt scanning with OCR
- π€ Group management enhancements
SplitBuddy is built with a focus on clean architecture, scalability, and real-world usability. It demonstrates strong full-stack development practices along with algorithmic optimization in a practical application.
If you found this project useful, consider giving it a β