A modern, real-time expense splitting app built with Next.js and Supabase. Split bills effortlessly with friends, track expenses, and settle up with automatic calculations.
- 🔄 Real-time Sync - Changes sync across all devices instantly
- 👥 Multi-person Splitting - Add unlimited people to your group
- 💰 Flexible Split Types - Equal, custom amount, or percentage-based splits
- 💱 Multi-currency Support - Track expenses in USD, EUR, GBP, INR, AED, SGD
- 📊 Smart Settlements - Automatic calculation of who owes whom
- 📝 Expense Tracking - Add payment methods, notes, and categorize expenses
- 📥 Export Reports - Download Excel or PDF reports of all expenses
- 📱 QR Code Sharing - Easily share groups via QR code
- 🌓 Dark Mode - Beautiful dark/light theme support
- 💱 Currency Converter - Built-in converter for quick calculations
- 📜 Settlement History - Track completed settlements
- Node.js 18+ or Yarn
- A Supabase account (free tier works)
-
Clone the repository
git clone https://github.com/anshtrivediaiml/SplitEasy.git cd orchids-payment-splitter-app -
Install dependencies
npm install # or yarn install -
Set up Supabase
Create a new Supabase project at supabase.com
-
Configure environment variables
Create a
.env.localfile in the root directory:NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
-
Set up the database
Run these SQL commands in your Supabase SQL editor:
-- Create groups table CREATE TABLE groups ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), name TEXT NOT NULL, code TEXT UNIQUE NOT NULL, created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() ); -- Create people table CREATE TABLE people ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), group_id UUID REFERENCES groups(id) ON DELETE CASCADE, name TEXT NOT NULL, color TEXT NOT NULL, created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() ); -- Create expenses table CREATE TABLE expenses ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), group_id UUID REFERENCES groups(id) ON DELETE CASCADE, description TEXT NOT NULL, amount DECIMAL(10, 2) NOT NULL, paid_by UUID REFERENCES people(id) ON DELETE CASCADE, date TIMESTAMP WITH TIME ZONE DEFAULT NOW(), payment_method TEXT, notes TEXT, currency TEXT DEFAULT 'INR', created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() ); -- Create expense_splits table CREATE TABLE expense_splits ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), expense_id UUID REFERENCES expenses(id) ON DELETE CASCADE, person_id UUID REFERENCES people(id) ON DELETE CASCADE, split_type TEXT NOT NULL, split_value DECIMAL(10, 2), created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() ); -- Create settlements table CREATE TABLE settlements ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), group_id UUID REFERENCES groups(id) ON DELETE CASCADE, from_person UUID REFERENCES people(id) ON DELETE CASCADE, to_person UUID REFERENCES people(id) ON DELETE CASCADE, amount DECIMAL(10, 2) NOT NULL, completed BOOLEAN DEFAULT FALSE, completed_at TIMESTAMP WITH TIME ZONE, created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() ); -- Enable realtime for tables ALTER PUBLICATION supabase_realtime ADD TABLE people; ALTER PUBLICATION supabase_realtime ADD TABLE expenses; ALTER PUBLICATION supabase_realtime ADD TABLE expense_splits;
-
Run the development server
npm run dev # or yarn dev -
Open the app
Navigate to http://localhost:3000/payment-splitter
- Open the app - a new group is created automatically
- Share the group code or QR code with friends
- Click "Add Person"
- Enter their name
- Each person gets a unique color avatar
- Click "Add Expense"
- Enter description and amount
- Select who paid
- Choose currency (optional)
- Select split method:
- Equal - Split evenly among selected people
- Custom - Set specific amounts or percentages
- Add payment method and notes (optional)
The Settlements card automatically calculates who owes whom using an optimized algorithm to minimize transactions.
Click the download icon in Settlements to export:
- Excel - Multi-sheet workbook with expenses, settlements, and summary
- PDF - Formatted report ready to print or share
Click the checkmark on any settlement to mark it as paid. View settlement history by clicking the History icon.
- Framework: Next.js 15 (App Router)
- Database: Supabase (PostgreSQL)
- Styling: Tailwind CSS
- UI Components: shadcn/ui
- Animations: Framer Motion
- Forms: React Hook Form
- Export: xlsx, jsPDF
- QR Codes: qrcode
src/
├── app/
│ ├── layout.tsx # Root layout with theme provider
│ ├── globals.css # Global styles
│ └── payment-splitter/
│ └── page.tsx # Main app page
├── components/
│ ├── ui/ # shadcn/ui components
│ ├── theme-provider.tsx # Theme context
│ └── theme-toggle.tsx # Dark mode toggle
└── lib/
└── supabase.ts # Supabase client
- RLS (Row Level Security) is currently disabled for simplicity
- For production, consider enabling RLS policies
- Never commit
.env.localto version control - Use environment variables for all sensitive data
- Push your code to GitHub
- Import the project in Vercel
- Add environment variables in Vercel project settings
- Deploy!
The app works on any platform that supports Next.js:
- Netlify
- Railway
- Render
- AWS Amplify
Just ensure environment variables are configured correctly.
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - feel free to use this project for personal or commercial purposes.
For issues or questions, please open an issue on GitHub.
Built with ❤️ using Next.js and Supabase