Skip to content

Real‑time group expense splitter with QR joining, drag‑to‑pay settlements, and live multi‑currency support built with Next.js and Supabase.

Notifications You must be signed in to change notification settings

anshtrivediaiml/SplitEasy

Repository files navigation

SplitEasy 💸

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.

✨ Features

  • 🔄 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

🚀 Quick Start

Prerequisites

  • Node.js 18+ or Yarn
  • A Supabase account (free tier works)

Installation

  1. Clone the repository

    git clone https://github.com/anshtrivediaiml/SplitEasy.git
    cd orchids-payment-splitter-app
  2. Install dependencies

    npm install
    # or
    yarn install
  3. Set up Supabase

    Create a new Supabase project at supabase.com

  4. Configure environment variables

    Create a .env.local file in the root directory:

    NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
    NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
  5. 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;
  6. Run the development server

    npm run dev
    # or
    yarn dev
  7. Open the app

    Navigate to http://localhost:3000/payment-splitter

📖 Usage

Creating a Group

  1. Open the app - a new group is created automatically
  2. Share the group code or QR code with friends

Adding People

  1. Click "Add Person"
  2. Enter their name
  3. Each person gets a unique color avatar

Adding Expenses

  1. Click "Add Expense"
  2. Enter description and amount
  3. Select who paid
  4. Choose currency (optional)
  5. Select split method:
    • Equal - Split evenly among selected people
    • Custom - Set specific amounts or percentages
  6. Add payment method and notes (optional)

Viewing Settlements

The Settlements card automatically calculates who owes whom using an optimized algorithm to minimize transactions.

Exporting Reports

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

Marking Settlements Complete

Click the checkmark on any settlement to mark it as paid. View settlement history by clicking the History icon.

🛠️ Tech Stack

  • 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

📦 Project Structure

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

🔒 Security Notes

  • RLS (Row Level Security) is currently disabled for simplicity
  • For production, consider enabling RLS policies
  • Never commit .env.local to version control
  • Use environment variables for all sensitive data

🌐 Deployment

Deploy to Vercel

  1. Push your code to GitHub
  2. Import the project in Vercel
  3. Add environment variables in Vercel project settings
  4. Deploy!

Deploy to Other Platforms

The app works on any platform that supports Next.js:

  • Netlify
  • Railway
  • Render
  • AWS Amplify

Just ensure environment variables are configured correctly.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📝 License

MIT License - feel free to use this project for personal or commercial purposes.

💬 Support

For issues or questions, please open an issue on GitHub.


Built with ❤️ using Next.js and Supabase

About

Real‑time group expense splitter with QR joining, drag‑to‑pay settlements, and live multi‑currency support built with Next.js and Supabase.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published