AI-powered, real-time expense & settlement platform for groups and individuals. Keep shared spending tidy: clean net balances, directional settlements, automated reminders and AI monthly insights.
π Live Demo β’ License β’ LinkedIn
- About
- Why SmartSplit
- Key features
- Tech stack
- Screenshots & visuals
- Project structure
- Getting started
- How it works (Expense β Balance β Settlement)
- AI insight flow
- Usage examples
- Developer tips
- Contributing
- Contact
- License
- Acknowledgments & future ideas
SmartSplit simplifies group money-management by combining a robust split/settlement engine with server-authoritative validation and AI-generated monthly summaries. Designed for roommates, travel groups, teams and anyone sharing expenses.
Shared expenses get messy: partial repayments, duplicate settlements, changing participants. SmartSplit offers:
- Real-time, per-user and per-relationship net balances.
- Directional settlement UI that prevents invalid payments.
- Automated reminders and AI insights to reduce friction and surprise.
- Split modes: Equal / Percentage (with validation) / Exact amounts.
- Dynamic participants: auto-include creator; recompute splits when members change.
- Accurate aggregation: convex-style ledger for per-user and group balances.
- Optimistic UI + server authority: client pre-checks + server mutations enforce correctness.
- Directional (payer β payee) settlement UI only shows valid actions.
- Server rejects overpayments, reversed roles, or invalid amounts.
- Two-decimal truncation & tolerance thresholds to avoid floating rounding issues.
- Email notifications on settlement success.
- Weekly payment reminders (Inngest scheduled job).
- Monthly AI financial insights (Google Generative AI / Gemini) β trend deltas, category concentration, anomalies.
- Manual reminders with optional notes.
- Branded HTML templates for transactional emails (expense, reminder, settlement, group invitation).
- Accessible UI patterns (Radix, focus management) and smooth animation (Framer Motion).
- Toasts, adaptive layouts, and consistent currency formatting.
- Clerk for Email OTP, Google, Apple OAuth, magic links.
- Zod schemas + duplicate client/server validation.
- Server-side enforcement of all monetary and role constraints.
| Layer | Tech |
|---|---|
| Framework | Next.js (App Router, Turbopack) |
| Realtime backend / DB | Convex |
| Auth | Clerk |
| Jobs / Scheduling | Inngest |
| Nodemailer + branded HTML templates | |
| UI | Tailwind CSS, Radix UI, Framer Motion |
| Forms & validation | React Hook Form + Zod |
| Charts | Recharts |
| AI | @google/generative-ai (Gemini) |
| Misc | date-fns, clsx, Sonner toasts, lucide-react icons |
Database Schema
Person Page
Dashboard Page
Contacts Page
Create Group Page
Group Information Page
Add Expense Page
Settlement Page
Home Page
Monthly AI Insights Email
Weekly Payment Reminders
Settlement Mail
Payment Reminder Mail
New Expense Mail
Group Creation Mail
app/ # Next.js App Router pages & api routes
components/ # Reusable UI & domain components
convex/ # Convex functions (generated + custom queries/mutations)
lib/ # Utilities (formatting, email templates, AI helpers)
public/ # Static assets (logos, screenshots)
Key note: settlement logic lives in Convex mutations β server authoritative. UI mirrors validation for UX.
git clone https://github.com/lakshitcodes/smart-split.git
cd smart-splitpnpm install # or npm install / yarnCreate .env.local (never commit):
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_...
CLERK_SECRET_KEY=sk_...
CONVEX_DEPLOYMENT= # convex deployment id or use `npx convex dev`
INNGEST_EVENT_KEY=...
GOOGLE_GENERATIVE_AI_API_KEY=...
EMAIL_SMTP_HOST=smtp.yourprovider.com
EMAIL_SMTP_PORT=587
EMAIL_SMTP_USER=notifications@yourdomain.com
EMAIL_SMTP_PASS=your_smtp_password
EMAIL_FROM="SmartSplit Alerts <notifications@yourdomain.com>"
APP_BASE_URL=https://smartsplit-lakshit.vercel.appUse a dedicated sending mailbox and configure SPF/DKIM for deliverability.
npx convex devpnpm dev
# build
pnpm build && pnpm startpnpm lint- Create expense β choose split model (Equal / Percentage / Exact).
- Server stores raw splits and derives per-user net balances via aggregation.
- Settlement inserts settlement record via Convex mutation β server validates direction, outstanding exposure and clamps values.
- Notifications: email pipeline fires transactional messages for expense/settlement/reminders.
- Periodic jobs (Inngest) drive weekly reminders and monthly AI insight generation.
- Aggregate monthly spend by category & user.
- Build a structured prompt (month-over-month deltas, category concentration, anomalies).
- Generate narrative via Google Generative AI (Gemini).
- Curate & email as branded HTML to users.
- Record a settlement: Person page β Settle up β amount (auto-clamped) β confirm.
- Create group expense: Group β Add expense β Choose split β Save β notifications sent.
- Send manual reminder: Person page β Send Reminder β add note β send.
- Mirror settlement validations on client & server β never rely on client-only checks.
- Always include yourself as a participant when creating expenses (enforced).
- Use
formatCurrencyutil everywhere to maintain consistent formatting and avoid precision drift. - Centralize email templates in
lib/emailand use absolute asset paths for images in email HTML.
- Fork the repo
git checkout -b feat/your-feature- Implement, run lint/tests, commit with clear message
- Push & open a PR
Please run lint and verify no runtime errors before requesting review.
Author: Lakshit Jain LinkedIn: https://www.linkedin.com/in/jainlakshit
MIT β see LICENSE file.
Thanks to Convex, Clerk, Inngest, and Google Generative AI.
Future ideas: multi-currency support, mobile PWA offline mode, receipt OCR, expense tagging intelligence, predictive budgeting.