Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Expense Expert

Live Demo

Expense Expert is a full-stack expense sharing and settlement platform for trips, roommates, events, and teams. It helps groups track spending, split costs flexibly, and settle with the minimum number of transfers.

Screenshots

Landing Page
Landing Page

Main Dashboard
Main Dashboard

Split View
Split View

Analytics Dashboard
Analytics Dashboard

Why Expense Expert

  • Real-time multi-user session updates.
  • Smart settle-up recommendations.
  • Advanced split logic for real-world scenarios.
  • Rich analytics and what-if simulation.
  • Easy sharing and export workflows.

Feature Overview

Session and Collaboration

  • Create a session with trip/group name.
  • Add members one by one using chip-style input.
  • Join an existing session using session code.
  • Live member presence tracking with SSE.
  • Activity feed for expense and settlement events.

Expense Management

  • Add and delete expenses.
  • Payer tracking with paid-by payload.
  • Split type badges in expense list.
  • Expandable per-expense split breakdown.
  • Inline validation in add-expense flow.

Split Engine (Upgraded)

Unified backend split engine supports 4 modes:

  • EQUAL: even split with remainder handling.
  • EXACT: fixed amount per member.
  • PERCENTAGE: split by percentage values.
  • SHARE: split by integer share units.

Validation rules:

  • EXACT total must match expense amount (tolerance 0.01).
  • PERCENTAGE total must be 100 (tolerance 0.01).
  • SHARE values must be positive integers.
  • Session member integrity is enforced for split and payer data.

Structured backend validation response:

{
  "message": "Exact split total does not match expense amount.",
  "expected": 1000.00,
  "actual": 700.00,
  "delta": 300.00
}

Settlement and Payments

  • Net balance view per member.
  • Optimized settle-up suggestions.
  • Mark settlement payments as partial or complete.
  • Payment tracking visible in settle-up panel.

Simulation and Analytics

  • What-if simulator to preview the impact of a hypothetical expense.
  • Analytics dashboard with:
    • category breakdown,
    • member spending,
    • fairness/health indicators,
    • trip-level summary metrics.

Export and Sharing

  • Shareable session links.
  • WhatsApp-friendly settlement summary copy.
  • PDF export endpoint integration.

UX and UI Improvements

  • Premium, animated UI with Framer Motion and GSAP.
  • Smooth scrolling using Lenis.
  • Reusable shadcn-style UI primitives.
  • In-app name capture for presence (replaces browser prompt).

Settlement Algorithm

Settlement optimization uses a greedy debtor-creditor matching strategy to reduce transaction count.

1. Compute net balance for each member:
   net = total_paid - total_owed

2. Split members into:
   - debtors (net < 0)
   - creditors (net > 0)

3. Repeatedly match largest debtor with largest creditor.

4. Transfer min(abs(debtor), creditor), update balances.

5. Continue until all balances reach zero.

Tech Stack

  • Frontend: React, Vite, Tailwind CSS, Framer Motion, GSAP, Lenis, Axios, React Router.
  • UI Layer: Custom shadcn-style primitives (Button, Card, Input, Badge).
  • Backend: Java 21, Spring Boot, Maven.
  • Database: PostgreSQL.
  • Realtime: Server-Sent Events (SSE).

Project Structure

  • Expense_Expert: Spring Boot backend.
  • frontend: React frontend.
  • UI_REFACTOR_PLAN.md: UI design and migration planning notes.

Local Setup

Prerequisites

  • Node.js 18+
  • Java 21+
  • Maven 3.9+
  • PostgreSQL 14+

1. Clone Repository

git clone https://github.com/Team-Zemo/Expense_Expert.git
cd Expense

2. Configure Database

Update Expense_Expert/src/main/resources/application.properties:

server.port=8080
spring.datasource.url=jdbc:postgresql://localhost:5432/expense_expert
spring.datasource.username=postgres
spring.datasource.password=your_password
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true

3. Run Backend

cd Expense_Expert
mvn clean install
mvn spring-boot:run

Backend URL: http://localhost:8080

4. Run Frontend

cd frontend
npm install
npm run dev

Frontend URL: http://localhost:5173

5. Validate Build and Tests

# backend tests
cd Expense_Expert
mvn test

# frontend production build
cd frontend
npm run build

Engineering Notes

  • Backward compatibility for legacy split JSON is maintained while new expenses are saved in normalized split-array structure.
  • Split engine behavior is covered by tests in Expense_Expert/src/test/java/com/teamzemo/exp/SplitEngineTest.java.
  • Core split processing lives in backend service utilities and ExpenseService orchestration.

Built by Team Zemo.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages