Skip to content

Vedant-0102/Splitz

Repository files navigation

Splitzz - Expense Splitting Made Easy

A modern expense splitting application built with Next.js, Convex, and Clerk authentication. Split bills with friends, track group expenses, and settle up easily.

Features

  • Secure Authentication - Powered by Clerk (Google OAuth, Email/Password)
  • 1-on-1 & Group Expenses - Split bills with individuals or groups
  • Flexible Splitting - Equal, percentage, or exact amount splits
  • Dashboard - View your balances and spending at a glance
  • Settlements - Record payments and track who owes what
  • User Search - Find and add friends easily
  • Email Notifications - Powered by Resend and Inngest
  • Responsive Design - Works on desktop and mobile
  • Modern UI - Built with Tailwind CSS and ShadCN UI

Tech Stack

  • Frontend: Next.js 15 , React 19
  • Backend: Convex (Real-time database and serverless functions)
  • Authentication: Clerk
  • Styling: Tailwind CSS v4
  • UI Components: ShadCN UI
  • Background Jobs: Inngest
  • Email: Resend
  • Charts: Recharts
  • Icons: Lucide React

Getting Started

Setup

  1. Clone and install:
git clone https://github.com/Vedant-0102/Splitz.git
cd splitz
npm install
  1. Set up Convex:
npx convex dev
  1. Configure environment variables:

Create .env.local:

# Convex (auto-generated by `npx convex dev`)
CONVEX_DEPLOYMENT=dev:your-deployment
NEXT_PUBLIC_CONVEX_URL=https://your-deployment.convex.cloud

# Clerk
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_your_key
CLERK_SECRET_KEY=sk_test_your_key
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
CLERK_JWT_ISSUER_DOMAIN=https://your-domain.clerk.accounts.dev

# Resend (for email notifications)
RESEND_API_KEY=re_your_key

# Gemini API 
GEMINI_API_KEY=your_gemini_key
  1. Run development server:
npm run dev

Project Structure

splitz/
├── app/
│   ├── (auth)/           # Authentication pages
│   ├── (main)/           # Main application
│   │   ├── contacts/     # Contacts & groups
│   │   ├── dashboard/    # Dashboard
│   │   ├── expenses/     # Expense management
│   │   ├── groups/       # Group details
│   │   ├── person/       # 1-on-1 expenses
│   │   └── settlements/  # Settlements
│   └── api/              # API routes
├── components/           # React components
│   └── ui/               # UI components
├── convex/               # Backend functions
│   ├── users.js
│   ├── expenses.js
│   ├── groups.js
│   ├── settlements.js
│   ├── dashboard.js
│   └── schema.js
├── hooks/                # Custom hooks
├── lib/                  # Utilities
│   └── inngest/          # Background jobs
└── public/               # Static files

API Endpoints

Users

  • users.current() - Get current authenticated user
  • users.store(userData) - Store/update user from Clerk
  • users.search(query) - Search users by name or email
  • users.all() - Get all users

Expenses

  • expenses.create(expenseData) - Create new expense
  • expenses.betweenUsers(userId) - Get expenses between two users
  • expenses.delete(expenseId) - Delete expense

Groups

  • groups.get(groupId) - Get group details
  • groups.expenses(groupId) - Get group expenses
  • groups.create(groupData) - Create new group

Settlements

  • settlements.create(settlementData) - Record payment
  • settlements.data(entityType, entityId) - Get settlement history

Dashboard

  • dashboard.balances() - Get user balances
  • dashboard.totalSpent() - Get total spent
  • dashboard.monthlySpending() - Get monthly spending data
  • dashboard.groups() - Get user's groups

Contacts

  • contacts.all() - Get all contacts
  • contacts.createGroup(groupData) - Create contact group

Key Features Explained

Balance Calculation

The app tracks:

  • What you owe to others (negative balance)
  • What others owe you (positive balance)
  • Net balance per person and group

Settlements

Record when someone pays you back:

  1. Go to person/group page
  2. Click "Settle up"
  3. Enter amount and note
  4. Submit - balances update automatically

Groups

Create groups for:

  • Trips and vacations
  • Roommate expenses
  • Events and parties
  • Regular shared expenses

Development

Building for Production

npm run dev

Deploying

Convex:

npx convex deploy

About

WebApp like Splitwise

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •