Skip to content

About

A Flutter-based shared expense and settlement platform for flatmates, featuring expense splitting, obligations, payments, automatic offsetting, and person-to-person balances.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ  FlatLedger

A private shared-expense and settlement platform for flatmates, roommates, and small groups.

Live Demo Flutter Dart Firebase Firestore Riverpod Platform

A shared expense management platform that helps flatmates and small groups track expenses, split costs fairly, and settle balances through a transparent, ledger-based financial model.

Instead of manually calculating who owes whom, FlatLedger maintains individual obligations between users and derives balances directly from them โ€” so nothing gets lost as the transaction history grows.

๐Ÿ”— Live Application: https://flatledger-keshav.web.app/


๐Ÿ“– Project Overview

FlatLedger is a shared expense management application designed for flatmates, roommates, and small groups.

It provides a structured way to record shared expenses, calculate individual shares, track outstanding obligations, record payments, and maintain a transparent financial history between group members.

The application supports:

  • Villa / group based expense management
  • Shared expense splitting
  • Equal and exact amount splits
  • Individual balance tracking
  • Payment recording
  • Obligation tracking
  • Automatic balance calculation
  • Payment and expense history
  • Member management
  • Invitation-based group joining
  • Dark and light themes
  • Real-time Firebase-backed data
  • Cached application state with explicit refresh/invalidation

๐Ÿง  Problem Statement

Managing expenses between flatmates often becomes difficult when there are many transactions.

For example:

  • One person pays for groceries
  • Another pays for electricity
  • Someone pays for a cab
  • Multiple people participate in each expense
  • Partial payments happen later
  • Old obligations may already have been settled

Manually calculating the final balance becomes increasingly error-prone as the number of transactions grows.

FlatLedger solves this by maintaining individual obligations between users and deriving balances from those obligations.

The goal is to make group finances:

Simple โ€ข Transparent โ€ข Trackable


๐Ÿ“ธ Project Preview

๐Ÿ  Home & Villa Dashboard

The home dashboard gives members a quick view of their Villa, group balance, and members at a glance.


๐Ÿ’ฐ Personal Balance & Activity

Each member can drill into their one-on-one balance with another user, view the running activity feed, and switch between dark and light themes.


๐Ÿš€ Core Features

๐Ÿ’ฐ Expense Management

  • Create shared expenses
  • Expense title and description
  • Expense categories
  • Select participating members
  • Record who actually paid
  • Support equal splitting
  • Support exact-amount splitting

๐Ÿงฎ Smart Expense Splitting

For equal expenses:

Total Expense
      โ†“
Participants
      โ†“
Equal Individual Shares

For exact expenses:

Total Expense
      โ†“
Custom Amount Per Member
      โ†“
Validated Total

Exact split amounts are validated against the original expense total before the expense is created.


๐Ÿ“’ Obligation Ledger

Every expense creates financial obligations only for participants who owe the person who paid.

Example:

Rahul pays โ‚น1000

Rahul's share       โ‚น250
Keshav's share      โ‚น250
Aman's share        โ‚น250
Rohan's share       โ‚น250

Keshav  โ†’ Rahul     โ‚น250
Aman    โ†’ Rahul     โ‚น250
Rohan   โ†’ Rahul     โ‚น250

This creates a structured ledger instead of directly modifying a user's final balance.


๐Ÿ”„ Obligation Offsetting

FlatLedger also handles opposing obligations between two users.

Example:

Keshav โ†’ Rahul     โ‚น500
Rahul  โ†’ Keshav    โ‚น200

The ledger can offset the opposing obligations so that the remaining relationship becomes:

Keshav โ†’ Rahul     โ‚น300

This prevents unnecessary back-and-forth settlement between users.


๐Ÿ’ณ Payments

Users can record payments against their outstanding obligations.

Supported behavior includes:

  • Partial payments
  • Full payments
  • Remaining balance calculation
  • Payment history
  • Automatic obligation updates
  • Updated personal balances

Payments are treated as actual money movements, rather than blindly reversing or rewriting an entire expense.


๐Ÿ“Š Personal Balance

Each member can view their financial relationship with another member.

The personal ledger displays:

  • Net balance
  • Amount they owe you
  • Amount you owe
  • Total paid by each person
  • Individual shares
  • Related transactions
  • Outstanding payment amount

Example:

NET BALANCE
-โ‚น248

They owe you     โ‚น0
You owe          โ‚น248

Pay โ‚น248

๐Ÿ  Villa / Group Management

FlatLedger organizes expenses inside shared groups called Villas.

Each Villa provides:

  • Members
  • Shared expenses
  • Group balance
  • Activity history
  • Invitations
  • Villa settings

Users can create or join multiple Villas.


๐Ÿ‘ฅ Member Management

  • View Villa members
  • Owner/member roles
  • Invite members
  • Join requests
  • Member-specific balances
  • Individual transaction history

๐Ÿ“œ Activity & History

FlatLedger maintains a chronological activity feed for important financial actions.

Tracked activities include:

  • Expense creation
  • Payments
  • Other ledger events

The history provides a transparent record of what happened inside the Villa.


๐ŸŽจ Dark & Light Mode

The application supports both:

  • ๐ŸŒ™ Dark Mode
  • โ˜€๏ธ Light Mode

The same application workflow is available in both themes.


๐Ÿ— Application Architecture

FlatLedger follows a layered Flutter architecture.

                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚          UI Layer       โ”‚
                    โ”‚  Screens / Widgets      โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                 โ”‚
                                 โ–ผ
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚    Riverpod Providers   โ”‚
                    โ”‚  State / Cache / Refreshโ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                 โ”‚
                                 โ–ผ
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚    Action Controllers   โ”‚
                    โ”‚  Expense / Payment etc. โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                 โ”‚
                                 โ–ผ
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚      Repository Layer   โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                 โ”‚
                                 โ–ผ
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚       Service Layer     โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                 โ”‚
                                 โ–ผ
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚      Cloud Firestore    โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

The architecture separates UI, state management, business actions, repositories, services, and Firebase persistence. The project also uses provider invalidation to refresh affected cached data after financial writes.


๐Ÿ’ธ Financial Data Flow

The core financial workflow is:

Create Expense
      โ†“
Calculate Individual Shares
      โ†“
Create Expense
      โ†“
Create Expense Splits
      โ†“
Create Obligations
      โ†“
Check Opposing Obligations
      โ†“
Apply Offset
      โ†“
Updated Balance

When a payment occurs:

Payment
   โ†“
Allocate Payment
   โ†“
Update Obligations
   โ†“
Create Payment Activity
   โ†“
Refresh Balance
   โ†“
Updated Personal Ledger

This keeps expenses, obligations, and payments as separate financial concepts.


๐Ÿ”„ State & Data Refresh

FlatLedger uses Riverpod to manage cached application state.

Financial writes trigger refreshes for affected data such as:

  • Villa balance
  • Expense history
  • Activity history
  • Personal ledgers

This allows the UI to reflect newly-created expenses and payments without requiring the user to restart the application.

The architecture specifically uses family-scoped data where appropriate and explicit invalidation after write operations.


โ˜๏ธ Backend

FlatLedger uses Firebase as its backend infrastructure.

Firebase Services

  • Firebase Authentication
  • Cloud Firestore

Firestore acts as the persistent source of truth for:

Users
   โ†“
Villa Memberships
   โ†“
Expenses
   โ†“
Expense Splits
   โ†“
Obligations
   โ†“
Payments
   โ†“
Activities

๐Ÿงฑ Data Model

The financial model is centered around separate entities:

Villa
 โ”‚
 โ”œโ”€โ”€ Members
 โ”‚
 โ”œโ”€โ”€ Expenses
 โ”‚     โ”‚
 โ”‚     โ””โ”€โ”€ Expense Splits
 โ”‚
 โ”œโ”€โ”€ Obligations
 โ”‚
 โ”œโ”€โ”€ Payments
 โ”‚
 โ””โ”€โ”€ Activities

An expense represents the original transaction.

An expense split represents each participant's share.

An obligation represents money one user owes another.

A payment represents an actual settlement between users.

This separation allows FlatLedger to handle partial settlements and changes without treating an expense itself as a payment.


โš™๏ธ Tech Stack

Layer Technology
Framework Flutter
Language Dart
State Management Riverpod
Authentication Firebase Authentication
Database Cloud Firestore
Navigation GoRouter
Architecture Repository + Service Layer
Platform Android / Web
UI Material-based responsive interface

๐Ÿ“ฑ Application

FlatLedger is also available as a mobile application.

App Download: Coming Soon


๐Ÿ“‚ Public Repository Structure

This repository contains a showcase version of the FlatLedger source code.

flatledger/
โ”‚
โ”œโ”€โ”€ assets/
โ”‚   โ””โ”€โ”€ branding/
โ”‚
โ”œโ”€โ”€ docs/
โ”‚
โ”œโ”€โ”€ lib/
โ”‚   โ”œโ”€โ”€ core/
โ”‚   โ”œโ”€โ”€ features/
โ”‚   โ”œโ”€โ”€ models/
โ”‚   โ”œโ”€โ”€ providers/
โ”‚   โ”œโ”€โ”€ repositories/
โ”‚   โ”œโ”€โ”€ services/
โ”‚   โ””โ”€โ”€ ...
โ”‚
โ”œโ”€โ”€ screenshots/
โ”‚   โ”œโ”€โ”€ home.webp
โ”‚   โ”œโ”€โ”€ dashboard-dark.webp
โ”‚   โ”œโ”€โ”€ people.webp
โ”‚   โ”œโ”€โ”€ person-balance.webp
โ”‚   โ”œโ”€โ”€ activity.webp
โ”‚   โ””โ”€โ”€ dashboard-light.webp
โ”‚
โ”œโ”€โ”€ pubspec.yaml
โ”œโ”€โ”€ analysis_options.yaml
โ””โ”€โ”€ README.md

๐Ÿ” Security & Repository Policy

This public repository intentionally does not contain production Firebase configuration or platform-specific deployment files.

Excluded from the public showcase include:

  • Firebase project configuration
  • Firebase application configuration
  • Android project files
  • iOS project files
  • Web deployment configuration
  • Windows / macOS / Linux platform files
  • Environment files
  • API credentials
  • Service account credentials
  • Signing keys
  • Generated build files

The public repository is therefore intended primarily for:

  • Architecture review
  • Portfolio presentation
  • Code reference
  • Project documentation

The public repository is provided as a portfolio and architecture showcase. Firebase configuration, production environment configuration, and platform-specific application files are intentionally excluded.


๐ŸŽฏ Project Goals

FlatLedger was built around a simple objective:

Make shared finances easier to understand and settle.

The project focuses on maintaining a clear separation between:

Expense
   โ‰ 
Share
   โ‰ 
Obligation
   โ‰ 
Payment

This allows the ledger to represent real financial relationships rather than simply storing a final balance.


๐Ÿ”ฎ Future Improvements

Potential future improvements include:

  • Advanced settlement optimization
  • More flexible split types
  • Improved notification system
  • Expanded analytics
  • Recurring expenses
  • Better offline support
  • More advanced expense filtering
  • Additional payment integrations

๐Ÿ‘จโ€๐Ÿ’ป Author

Keshav B.Tech CSE Bennett University


โญ Support

If you find FlatLedger interesting, consider giving the repository a star โญ on GitHub.

About

A Flutter-based shared expense and settlement platform for flatmates, featuring expense splitting, obligations, payments, automatic offsetting, and person-to-person balances.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages