Inspiration
As a student, I often paid for group meals, groceries, and shared expenses, then spent weeks chasing roommates for their share. It was awkward to ask repeatedly, and some never paid. I couldn’t afford to cover others, so I needed a better way.
Existing apps like Splitwise require manual entry of every expense, which is tedious and easy to forget. I wanted something that could read a receipt and handle the rest automatically. I built PayMi to solve this. Upload a receipt, let AI parse it, split costs with roommates, and track who owes what in real time. No more awkward conversations or forgotten IOUs. It automates the process so you can focus on what matters.
The goal is simple: make splitting bills as easy as taking a photo, so you get paid back without the hassle.
What it does
-PayMi automates bill splitting from receipt to payment. It uses AI to parse receipts, splits costs at the item level, tracks debts in real time, and enables instant payments via Solana.
Core Workflow:
- Receipt upload: User uploads a receipt image or PDF.
- AI parsing: Google Gemini extracts items, prices, quantities, taxes, and totals.
- Item selection: User selects items to split.
- Contact selection: User picks contacts and sets split amount (50%, 100%, or custom).
- Debt update: The system updates each participant’s debt record.
- Payment tracking: Progress bars show who owes what and how much has been paid.
- Settlement: Payments can be processed via Solana Pay using USDC.
Technical Architecture:
- Frontend: Next.js/React for the UI
Backend services:
- Receipt parser (FastAPI) : handles Gemini integration and receipt processing
- Contact manager (FastAPI) : manages contacts and debt records
- Authentication (FastAPI) : handles user login/registration
- Solana service (Node.js) : blockchain payment integration
Database: MongoDB stores receipts, contacts, and debt records, user information Key Features:
- Automatic categorization: Contacts are grouped into "Owes Me", "I Owe", or "Neutral" based on net debt
- Real-time tracking: Progress bars update as payments are made
- Item-level splitting: Split specific items, not just the total
- Instant payments: Solana Pay enables near-instant, low-fee USDC transfers
The Problem It Solves:
Traditional apps like Splitwise require manual entry. PayMi automates the process: upload a receipt, select items, split with friends, and track payments. The AI parsing removes manual data entry, and Solana Pay enables instant settlement.
In short, PayMi turns bill splitting from a manual, time-consuming task into an automated, real-time process.
How we built it
How We Built PayMi
- We built PayMi as a full-stack app. The frontend is Next.js/React, and we have four Python FastAPI backends plus a Node.js service for Solana. The Receipt Parsing Part:
- We use Google Gemini to parse receipts. You upload an image or PDF, it goes to our FastAPI backend, and Gemini extracts items, prices, quantities, and taxes. The backend saves the parsed data to - MongoDB and returns it to the frontend. The Split Bill Feature:
- On the frontend, you can select items from the parsed receipt. Clicking "Split Bill" opens a modal where you pick contacts and choose how much to split (50%, 100%, or custom). When you confirm, it calls our contact backend, which updates debt records for each participant. Each contact gets their share added to their "owes_me" field. The Debt Tracking System:
- We store contacts and debts in MongoDB. The debt collection tracks owes_me, i_owe, paid_back_to_me, and paid_back_by_me. We calculate net debt (net_owes_me = owes_me - paid_back_to_me) and categorize contacts into "Owes Me", "I Owe", or "Neutral" based on whether the net is positive, negative, or zero. The Frontend:
- The contacts page shows three sections with progress bars. We fetch contacts from the backend, calculate progress percentages, and display them. When someone pays, we update the paid_back_to_me field and the progress bars update automatically. The Hard Parts: The biggest issue was MongoDB SSL with Python 3.13. We had to downgrade to 3.11.9. We also had to handle JSON serialization for datetime and ObjectId. The item expansion logic for quantities was tricky, splitting prices per unit while keeping selection state. Connecting all the services and making sure CORS was set up correctly took some time. The Architecture: We run everything locally for now. The frontend is on port 3000, receipt backend on 8002, contact backend on 8005, auth backend on 8003, and Solana backend on 8004. They all talk to the same MongoDB database. We use environment variables for the MongoDB connection string and API keys. Overall, it works end-to-end: upload receipt, AI parses it, select items, split with friends, debts update automatically, track payments in real time. The hardest part was getting all the pieces to work together smoothly.
Challenges we ran into
MongoDB SSL Handshake Failure We kept getting SSL handshake errors when connecting to MongoDB Atlas. Turned out Python 3.13 changed OpenSSL in a way that broke compatibility with MongoDB's TLS. The error messages weren't helpful, so it took a while to figure out. We fixed it by downgrading to Python 3.11.9 and setting up a new virtual environment with the right SSL config.
Debt Calculation and Categorization Logic We needed to automatically categorize contacts into "Owes Me", "I Owe", or "Neutral" based on net debt. The tricky part was handling edge cases like when someone fully pays back or overpays. We used net_owes_me = owes_me - paid_back_to_me to calculate the actual outstanding debt and built logic to move contacts between categories as debts change.
Item Expansion for Quantities When items had quantity > 1, we needed to expand them into individual selectable items. This meant calculating per-unit prices, subtotals, and tax amounts, plus keeping track of which items were selected. We built an expansion function that creates unique IDs for each instance and preserves the original item data.
Split Bill Integration (End-to-End) Connecting receipt parsing to contact selection to debt updates was tricky. We had to make sure data flowed correctly through multiple systems and handle multiple participants at once. We created a /confirm_split endpoint that processes everyone and updates all debt records in one go.
JSON Serialization Errors (datetime & ObjectId) MongoDB returns datetime and ObjectId objects that can't be converted to JSON directly. We kept getting errors when trying to return data from our API. We fixed it by converting datetime to ISO strings and ObjectId to strings before sending responses.
Multi-Service Coordination Running four backend services plus the frontend was a pain. We had to manage different ports, set up CORS properly, and make sure all the API endpoints matched up. We documented how to start everything and configured CORS middleware so the services could talk to each other.
Accomplishments that we're proud of
-> Multi backend architecture implementation
- Receipt parser
- Contact management
- Authentication
- Solana payments
- Frontend (Next.js)
-> AI receipt parsing : debt tracking pipeline
- Parsing receipts with Gemini AI
- Selecting individual items from parsed data
- Splitting costs item-by-item across contacts
- Automatically updating debt records when splits are confirmed
->Automatic debt categorization system
- The logic that categorizes contacts into "Owes Me", "I Owe", and "Neutral" based on net debt calculations:
- Calculating net_owes_me = owes_me - paid_back_to_me
- Moving contacts between categories as debts change
- Showing progress bars with real-time payment tracking
- Handling edge cases (fully paid, overpaid, etc.)
What we learned
- Solana payment system: Integrated Solana Pay for instant USDC transfers with near-zero fees, enabling real-time settlement between users.
- Google Gemini NLP integration: Used Gemini as an LLM to parse receipts, extract structured data (items, prices, quantities, taxes), and automate data entry.
- Database schema design and MongoDB hosting: Designed schemas for contacts, debts, and receipts; set up and configured a MongoDB Atlas cluster with proper indexing and relationships.
- Error handling and debugging: Troubleshot SSL handshake failures, JSON serialization issues, and multi-service communication problems, improving debugging skills.
- Version control strategies: Used Git for collaboration, handled merge conflicts, managed feature branches, and maintained a clean commit history.
- Full-stack architecture: Built and coordinated a frontend (Next.js) with multiple backend services (FastAPI, Node.js), managing communication and data flow.
- API design and REST endpoints: Designed RESTful APIs with proper request/response handling, error codes, and CORS configuration for cross-origin communication.
- State management in React: Managed complex state across components, including form data, selected items, expanded items, and real-time updates from backend APIs.
What's next for PayMi
Receipt history with detailed splits and transaction tracking Users will be able to open any past receipt from their history and instantly see how every item was allocated, who paid for what, and what the final balances were. This includes a full breakdown of item-level splits, taxes, totals, and the exact amounts each person owed. The goal is to make PayMi feel like a financial “timeline,” where users can revisit shared expenses and track how their debts and payments evolved over time.
Smart notifications and payment reminders PayMi will send timely reminders when someone still owes money. Users will be able to ping a contact directly through friendly notifications to remind them to pay. This removes the awkwardness of chasing friends and keeps shared expenses running smoothly.
Automated recurring shared expenses For long term shared costs like rent, utilities, or subscriptions, PayMi will support scheduled recurring expenses. Users can set an expense to repeat on a monthly or custom cycle. PayMi will then automatically add each new cycle to everyone’s balance, keeping all shared costs accurate without manual effort.
Support for more cryptocurrencies PayMi will expand beyond Solana and allow users to send and receive payments using more cryptocurrencies and stablecoins. This gives users the freedom to settle balances using the networks and tokens they prefer.
Built With
- contact-management
- css
- express.js
- fastapi(node-parser-contact-management-authentication)
- google-gemini-api(receipt-parsing/nlp)
- javascript/jsx
- mongodb
- mongodb-api
- mongodb-atlas(cloud-hosting)
- motor(async-python-mongodb-driver)
- next.js
- node.js(solana-payment-service)
- pillow(image-processing)
- python-3.11.9
- python-dotenv(environment-variables)
- react
- solana-blockchain(usdc-transactions)
- solana-pay(blockchain-payments)
- uvicorn(asgi-server)
Log in or sign up for Devpost to join the conversation.