Skip to content

SrihariTadala/Splitly

Repository files navigation

Splitly

A contemporary web application designed for dividing bills and receipts among companions, utilizing AI-driven receipt analysis. Constructed utilizing Next.js, Prisma, SQLite, and OpenAI GPT-4o Vision.

Features

  • 📸 Receipt Upload - Submit images or PDFs of receipts
  • 🤖 AI Parsing - Automated extraction of items and prices utilizing OpenAI GPT-4o Vision
  • 👥 Friend Management - Add and organize friends with persistent data storage
  • 🏷️ Smart Tagging - Assign friends to specific items using removable tags
  • 💰 Settlement Calculation - Automatically determine the debt obligations between parties - 📱 Mobile Optimized
  • Responsive design compatible with all devices - 📄 Local Database — SQLite database for durable data storagepatterns

Getting Started

  1. Clone the repository:
git clone <your-repo-url>
cd moneymanager
  1. Install dependencies:
npm install
  1. Set up environment variables:
    • Open .env file
    • Replace your-openai-api-key-here with your actual OpenAI API key:
OPENAI_API_KEY=your-actual-api-key-here
  1. Run database migrations:
npx prisma generate
npx prisma migrate dev
  1. Start the development server:
npm run dev
  1. Open http://localhost:3000 in your browser

Usage Guide

1. Add Contacts - Navigate to "Manage Contacts"

  • Add individuals with whom you regularly share expenses - Contacts are stored locally and remain available across sessions

2. Create a Session - Click on "New Session"

  • Enter the name of the payer (the individual who settled the bill) - Select the companions involved in sharing the expense - Click on "Create Session"

3. Upload Receipts - During the session, submit an image or PDF of the receipt

  • The AI will automatically extract items and prices
  • Multiple invoices may be uploaded within a single session

4. Assign Friends to Items - Select friend names to assign them to particular items

  • Click once more to remove them (tags are removable)
  • Distribute items among any selection of peers

5. View Settlement

  • Click "View Summary" to display the details of the amounts owed between parties. Review the overall total and detailed itemizations.
  • Obtain a comprehensive, itemized breakdown

Project Organization

moneymanager/
├── app/
│   ├── api/              # API routes
│   │   ├── friends/      # Friend CRUD operations
│   │   ├── sessions/     # Session management
│   │   ├── receipts/     # Receipt upload & parsing
│   │   └── items/        # Item split management
│   ├── friends/          # Friends management page
│   ├── sessions/         # Session pages
│   │   ├── new/          # Create new session
│   │   └── [id]/         # Session detail & summary
│   ├── layout.tsx        # Root layout
│   ├── page.tsx          # Home page
│   └── globals.css       # Global styles
├── components/
│   └── ui/               # Reusable UI components
├── lib/
│   ├── prisma.ts         # Prisma client
│   ├── settlements.ts    # Settlement calculation logic
│   └── utils.ts          # Utility functions
├── prisma/
│   └── schema.prisma     # Database schema
└── public/
    └── uploads/          # Uploaded receipt images

Database Schema

  • Friend - Store friend information
  • Session - Splitting sessions with payer info
  • SessionParticipant - Link sessions to friends
  • Receipt - Uploaded receipts with parsed data
  • Item - Individual items from receipts
  • ItemSplit - Track which friends share which items

API Endpoints

  • GET/POST /api/friends - List/create friends
  • GET/PUT/DELETE /api/friends/[id] - Get/update/delete friend
  • GET/POST /api/sessions - List/create sessions
  • GET/DELETE /api/sessions/[id] - Get/delete session
  • POST /api/receipts - Upload receipt
  • POST /api/receipts/parse - Parse receipt with AI
  • POST/DELETE /api/items/[id]/splits - Add/remove friend from item

Development

# Run development server
npm run dev

# Build for production
npm run build

# Start production server
npm start

# Run linter
npm run lint

# Access Prisma Studio (database GUI)
npx prisma studio

About

AI app that scans receipts, extracts items, and instantly splits bills among friends.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages