Settle group expenses with ease, powered by Stellar for payments and unique NFT receipts for every settled event. This full-stack application provides a smooth way to track shared costs and finalize balances on the blockchain.
SettleUp is a monorepo project designed to simplify expense sharing for any event, from a weekend trip with friends to a team lunch. It combines a modern web interface with a robust backend and leverages the Stellar network for fast, low-cost settlements and optional commemorative NFTs.
- 💸 Easy Expense Splitting: Create events, invite members via QR code, and log shared expenses.
- 🚀 Stellar-Powered Payments: When it's time to settle, the app calculates who owes whom and guides users through payments on the Stellar network using the Freighter wallet.
- 🖼️ Unique NFT Receipts: As a unique memento, the event organizer can mint a commemorative NFT on the Stellar testnet for all participants once the event is settled.
- 🔔 Real-time Notifications: Users receive notifications to approve expenses and to pay their final balances.
| Backend | Frontend |
|---|---|
| Node.js / Express (Serverless) | Vite / React |
| Firebase Firestore (Database) | Stellar SDK |
| Vercel (Deployment) | Freighter (Wallet) |
Ready to run SettleUp locally? Let's get you set up in a few simple steps.
Make sure you have the following installed and set up:
- Node.js (v18 or higher)
- A Firebase project with Firestore enabled.
- Freighter Wallet browser extension for interacting with the frontend.
- (Optional) Two Stellar testnet accounts (an issuer and a distributor) if you want to test NFT minting.
You'll need to set up environment variables for both the backend and frontend.
Create a .env file in the root of the project and add your Firebase credentials:
# .env
FIREBASE_PROJECT_ID="your-firebase-project-id"
FIREBASE_CLIENT_EMAIL="firebase-adminsdk-....@your-project.iam.gserviceaccount.com"
FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nYourPrivateKeyHere\n-----END PRIVATE KEY-----\n"ℹ️ Important Note: When deploying to a CI/CD environment like Vercel, you'll need to escape the newlines in your
FIREBASE_PRIVATE_KEY. The application code is already set up to handle this by replacing\\nwith\n.
Create a .env file inside the SettleUpFrontend/ directory. These are only required if you want to test the NFT minting feature.
# SettleUpFrontend/.env
VITE_STELLAR_ISSUER_SECRET="S..."
VITE_STELLAR_DISTRIBUTOR_SECRET="S..."Open your terminal in the project's root directory:
# 1. Install dependencies
npm install
# 2. Build the project
npm run build
# 3. Start the server
npm startYour backend API will now be running locally!
Open a new terminal and navigate to the frontend directory:
# 1. Go to the frontend directory
cd SettleUpFrontend
# 2. Install dependencies
npm install
# 3. Start the Vite development server
npm run devYou can now open your browser to the local address provided by Vite to use the app.
This project is optimized for serverless deployment on Vercel.
- Push your code to a Git repository (GitHub, GitLab, etc.).
- Import the repository into your Vercel account.
- Vercel should automatically detect the Node.js backend. The included
vercel.jsonfile properly routes all/apirequests to the serverless backend. - Crucially, add your
FIREBASE_PROJECT_ID,FIREBASE_CLIENT_EMAIL, andFIREBASE_PRIVATE_KEYas environment variables in your Vercel project settings. - Deploy! Vercel will build both the backend and frontend and handle all routing.
<details> <summary><strong>Click to expand for technical details</strong></summary>
.
├── SettleUpFrontend/ # Vite + React Frontend App
└── src/ # Node.js + Express Backend App
GET /api/events/:eventId- Get details for a specific event.GET /api/events/user/:userId- Get all events a user is a member of.POST /api/events- Create a new event.POST /api/events/:eventId/add_user- Add a user to an event.POST /api/events/:eventId/finish- Settle an event and generate the payment plan.GET /api/expenses/:expenseId- Get details for a specific expense.POST /api/expenses/create- Create a new expense.GET /api/notifications/:userId/get- Get all notifications for a user.POST /api/notifications/answer_expense- Accept or reject an expense notification.
- events: Stores event information, including
name,members[],expenses[],totalAmount, andstatus. - expenses: Stores individual expense details like
amount,eventreference, andnAccepted. - notifications: Manages all user notifications for expenses and final settlements.
- CORS Enabled: The server is configured with CORS to allow requests from the frontend.
- Vercel Compatibility: The main server file (
src/server.ts) exports the Expressappinstance without callingapp.listen(), as required by Vercel's serverless environment. - SPA Fallback: The server is configured to serve the frontend's
index.htmlfor any non-API routes, allowing client-side routing to work seamlessly.
</details>
This project is licensed under the MIT License. Feel free to adapt it and make it your own!