SafarSplit
About the project
SafarSplit β Safar bhi, hisaab bhi π§³π°
Open-source collaborative trip planner & expense splitter for Indian groups. Plan day-wise itineraries, vote on stops live, scan restaurant bills into diet-aware splits, and settle up with the fewest UPI payments. Includes a Hinglish multi-turn AI assistant running on open-weight models.
Built because trips get planned on WhatsApp, but the hisaab never does.
β¨ Features
- Collaborative itineraries β day-wise stops with maps, times, cost estimates, and live voting.
- Expense splitting β equal, exact, percentage, or shares, with per-member exclusions. All amounts in integer paise (no float drift).
- Scan bill β snap a restaurant bill; items get auto-classified as veg / egg / non-veg / Jain-friendly using an Indian-menu dictionary + LLM fallback.
- Hinglish AI assistant β understands βRahul ne 1200 diye dinner ke liye, Amit ko chhod ke 4 mein splitβ. Fuzzy name matching, coreference (βuska bhi add kar doβ), one-question clarifications with quick-reply chips.
- Minimum settle-up β greedy + optimal bitmask-DP that cuts n people to β€ nβ1 payments, with an SVG debt graph and one-tap UPI deep links.
- Next-payer suggestion β βwho should pay next?β with projected balances before/after.
- Budget burn-rate alerts β real-time pacing, projected overspend, AI-suggested cheaper swaps.
- Safar Wrapped β shareable recap per completed trip (awards + category pie), fully deterministic.
- Community & forking β publish completed trips, browse by tags/budget, fork one with dates auto-shifted.
- Packing list β communal, race-safe claims, AI suggestions by destination + season.
- Offline sync β idempotent batch ops with last-write-wins conflict resolution.
- Open-weight models only β Ollama locally or any OpenAI-compatible endpoint. No vendor lock-in.
π Stack
Backend: Node.js Β· Express Β· PostgreSQL (raw pg) Β· Socket.io Β· JWT Β· Zod Β· Multer
AI: Ollama (Gemma / Qwen / DeepSeek / Llama) Β· OpenAI-compatible fallback Β· OSRM
Frontend: React 18 Β· Vite Β· Tailwind Β· Redux Toolkit Β· React Router Β· Axios Β· Leaflet Β· lucide-react
Deploy: DigitalOcean App Platform
π Architecture
-
Integer paise everywhere β
BIGINT, no floats. - Row-locked transactions for wallet transfers, vote counts, packing claims.
-
Migrations on boot β
schema.sql+migration_*.sqlapplied in order, tracked inschema_migrations. Seed only whenSEED=true. -
AI never authoritative β Zod-validated, one retry, logged to
ai_requests. Model explains; code calculates. -
Public views stay safe β
community_tripsexposes first names, destinations, tags, counts only.
π Run locally
# Backend
cd backend && npm install && cp .env.example .env
createdb safarsplit && npm run migrate && npm run dev
# Frontend
cd frontend && npm install && cp .env.example .env && npm run dev
# AI (optional)
ollama pull gemma2:9b
Backend β http://localhost:5000 Β· Frontend β http://localhost:5173
π§ͺ Tests
npm test # all
npm run test:assign # item assignment engine
npm run test:settlement # min-cash-flow + optimal
npm run eval:assistant # NLU accuracy β docs/eval.md
π Deploy
DigitalOcean App Platform ready: TLS Postgres via PGSSL=true, migrations on npm start, binds 0.0.0.0:$PORT, /health returns 200 after SELECT 1, CORS from CORS_ORIGIN, frontend reads VITE_API_URL (full URL ending /api/v1) and derives the socket origin from it β no hardcoded hosts.
π License
Safar bhi, hisaab bhi. π§‘
Built with
AI tools
Prize Categories Entered
- Submitted

Best Open-Source AI Project