Skip to content

Latest commit

 

History

197 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SmartPay

SmartPay is a full-stack expense sharing platform with:

  • a Next.js frontend (frontend/),
  • a Spring Boot backend (backend/), and
  • a FastAPI + Gemini bill parsing microservice (ai/).

This document lists what is currently implemented in the codebase.

Current Implemented Features

1) Authentication & Session Flow

  • User signup with fullName, email, phoneNumber, password.
  • User login via email or phone number + password.
  • JWT-based backend auth (Spring Security + JWT filter).
  • Frontend route protection via proxy.ts:
    • redirects unauthenticated users from protected routes to /login.
    • redirects authenticated users away from /, /login, /signup to /dashboard.
  • Logout support from profile page.

2) User Profile

  • Fetch current user profile (/users/me).
  • Profile screen shows:
    • full name,
    • email,
    • phone,
    • role,
    • user ID.

3) Friends Module

  • Send friend request by phone number.
  • View pending incoming requests.
  • Accept or reject friend requests.
  • View friends list.
  • Search friends by name/email/phone.

4) Groups Module

  • Create group (name + description).
  • Auto-generated group code for joining.
  • Join group via code.
  • Join flow supports direct invite-link handling (/groups/join?code=...).
  • List my groups.
  • Group search (name/description/creator/code for admin-visible codes).
  • Group details page with tabs:
    • Transactions,
    • Balances,
    • Members.
  • Group summary cards:
    • member count,
    • total group expenses,
    • current user net balance in that group.
  • Manual refresh in group detail page.

5) Expense Splitting

  • Group expense creation:
    • EQUAL split,
    • EXACT split.
  • Group expense form validations:
    • positive amounts,
    • split total matching validation for exact split.
  • Direct split flow (outside permanent groups) from /split:
    • select friends,
    • split equally or custom exact amounts,
    • create direct split transaction.

6) Ledger, Transactions & Balances

  • Group-level ledger APIs:
    • per-user balance in group,
    • all group balances,
    • group transactions,
    • simplified debts.
  • “My Transactions” feed for current user.
  • Transactions page features:
    • sent/received perspective,
    • totals (paid/received),
    • search/filter by description/person/type.

7) Bills AI Parsing (Frontend + AI Service)

  • Bills page supports multi-image upload.
  • Calls hosted parse endpoint (/parse-bills) and processes per-file result.
  • Duplicate hash fields handled in response model (file_hash, is_duplicate).
  • Parsed bills grouped by category.
  • Category totals + overall summary.
  • Remove individual parsed bill from grouped results.
  • Download generated expense PDF report.

8) PDF Report Generation

  • Client-side PDF generation using jsPDF.
  • Report includes:
    • overall total,
    • category summary table,
    • bill-level details,
    • itemized rows.

9) AI Microservice (FastAPI + Gemini)

  • Health endpoint with Gemini connectivity check.
  • Single bill parse endpoint (/parse-bill).
  • Batch parse endpoint (/parse-bills).
  • Debug parse endpoint (/parse-bill/debug) exposing raw response + image info.
  • In-memory duplicate cache management endpoints:
    • duplicate count,
    • clear duplicates.
  • File validation pipeline:
    • extension/type/size checks,
    • image decode verification,
    • SHA256 hashing.
  • Response post-processing pipeline:
    • markdown/JSON cleanup,
    • schema validation,
    • normalization (date/currency/category/amount/items),
    • confidence scoring + warnings.

10) Settlement & Payments (Backend APIs)

  • Settlement APIs exist:
    • initiate settlement (/settlements/initiate),
    • confirm settlement (/settlements/confirm).
  • Razorpay webhook endpoint exists (/payments/webhook) with signature verification + settlement confirmation path.

11) Backend Platform & Security

  • Spring Boot REST API with modular domains:
    • auth/users,
    • friends,
    • groups,
    • expenses,
    • ledger,
    • settlements/payments.
  • Common API response wrapper for consistent API payload shape.
  • Global exception handling setup.
  • Stateless security configuration.
  • Flyway enabled (currently only initial users migration present in source migration folder).

12) Frontend UX Foundation

  • Landing page sections implemented (hero/features/architecture/why/CTA/footer).
  • Protected navbar with theme toggle (light/dark).
  • Reusable modal/component-based UI for friends/groups/expenses.
  • Dashboard quick-action shortcuts.

Current Gaps / Notes (from code state)

  • blockchain/ does not currently contain implemented runtime features.
  • Dashboard chart currently uses generated/mock values (not wired to backend ledger analytics yet).
  • Settlement/payment flows are implemented in backend APIs; no complete frontend settlement UX is wired yet.

If needed, this README can be expanded next with:

  1. exact API endpoint reference table,
  2. setup instructions per service (frontend, backend, ai)

About

💵 SmartPay : An AI-powered fintech platform integrating payments, expense analytics, and ML-based scam detection with real-time insights and adaptive learning.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages