Skip to content

harshad208/expense_tracker

Repository files navigation

💰 Expense Tracker App (Flutter + Clean Architecture)

A production-ready Expense Tracker built with Flutter using:

  • Provider (State Management)
  • Hive (Local Persistence)
  • Repository Pattern
  • Clean Architecture Principles
  • Animated Donut Chart
  • Monthly & Yearly Analytics
  • CRUD with Undo
  • Unit Tested Business Logic

📱 Features

✅ Core Features

  • Add Expense
  • Edit Expense
  • Delete Expense
  • Undo Delete
  • Persistent Local Storage (Hive)
  • Category-based analytics
  • Monthly filtering
  • Yearly summary view

📊 Advanced Analytics

  • Animated Donut Chart
  • Category percentage display
  • Dynamic month navigation
  • Year toggle mode

🏗 Architecture

UI → Provider → Repository → Hive

Clean separation of concerns:
  • UI handles rendering
  • Provider manages state
  • Repository handles storage
  • Hive handles persistence

🧱 Project Structure

lib/
│
├── models/
│   └── expense.dart
│
├── providers/
│   └── expense_provider.dart
│
├── repositories/
│   └── expense_repository.dart
│
├── screens/
│   └── home_screen.dart
│
├── widgets/
│   ├── add_expense_sheet.dart
│   └── category_chart.dart
│
└── main.dart

🛠 Tech Stack

  • Flutter
  • Provider
  • Hive
  • fl_chart
  • mocktail (testing)

🚀 Getting Started

1️⃣ Clone the repository

git clone https://github.com/YOUR_USERNAME/expense_tracker.git
cd expense_tracker

2️⃣ Install dependencies

flutter pub get

3️⃣ Generate Hive Adapter

flutter pub run build_runner build --delete-conflicting-outputs

4️⃣ Run the app

flutter run

🧪 Run Tests

flutter test

🧠 Architecture Decisions

Why Provider?

  • Lightweight, scalable, clean separation of UI and business logic.

Why Repository Pattern?

  • Allows swapping storage (Hive → Firebase/SQLite) without touching UI.

Why Hive?

  • Fast
  • Offline-first
  • No heavy SQL setup
  • Perfect for Flutter apps

🔮 Future Improvements

  • Firebase Sync
  • Budget Limits per Category
  • Export to CSV
  • Dark Mode
  • CI/CD Pipeline
  • Cloud Backup

📸 Screenshots

alt text

📄 License

MIT License

About

Flutter expense tracker with clean architecture — Provider state management, Hive local storage, animated donut charts, and monthly/yearly analytics.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors