Skip to content
/ centi Public

๐Ÿ’ฐ Advanced personal finance tracker built with Flutter, Firebase and Clean Architecture

License

Notifications You must be signed in to change notification settings

CLopes86/centi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

40 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸฆŠ Centi

The AI-Powered Finance Tracker

Flutter Firebase Riverpod Clean Architecture

Status: ๐Ÿšง In Development

Features โ€ข Tech Stack โ€ข Architecture โ€ข Progress โ€ข Getting Started


๐ŸŽฏ About

Centi is a comprehensive personal finance management application built with Flutter following Clean Architecture principles. This project demonstrates professional-grade code structure, SOLID principles, and modern Flutter development practices.

โœจ Key Highlights

  • ๐Ÿ—๏ธ Clean Architecture - Separation of concerns with Domain, Data, and Presentation layers
  • ๐Ÿ“Š Beautiful Visualizations - Interactive charts and graphs to understand spending patterns
  • ๐Ÿ’ฐ Budget Management - Set and track budgets per category
  • ๐Ÿ”ฅ Firebase Integration - Cloud sync, authentication, and real-time updates
  • ๐Ÿ“ฑ Cross-Platform - Works on Android, iOS, and Web
  • ๐Ÿ”’ Secure - Firebase Authentication with email/password
  • โ˜๏ธ Cloud Sync - Data synced across all devices
  • ๐ŸŽจ Material Design 3 - Modern and intuitive UI

๐Ÿš€ Features

โœ… Completed

  • Project Setup

    • Clean Architecture structure (Domain/Data/Presentation)
    • Firebase integration (Auth, Firestore)
    • Git workflow with professional commits
  • Domain Layer (Auth Feature)

    • User Entity with validation and immutability
    • AuthRepository Interface (login, register, logout, getCurrentUser)
    • 4 Use Cases: LoginUser, RegisterUser, LogoutUser, GetCurrentUser
    • Dependency Injection pattern
  • Data Layer (Auth Feature - In Progress)

    • UserModel with JSON and Firebase conversion
    • fromFirebase, fromJson, toJson methods
  • Data Layer (Auth Feature)

    • AuthRemoteDataSource (Firebase calls)
    • AuthRepositoryImpl (Repository implementation)
  • Presentation Layer (Auth Feature)

    • Splash Screen (Animated)
    • Login Screen (UI + Logic)
    • Register Screen (UI implementation)
    • State management with Riverpod
  • Core

    • App Theme (Indigo + Gold palette)
    • GoRouter (Centralized navigation)
  • Dashboard (UI completo โ€” dados placeholder)

    • BalanceCard widget (estilo fintech โ€” efeito vidro, setas nรฉon)
    • TransactionItem widget (รญcones, cores receita/despesa)
    • Transactions list (placeholder data)
    • Header com gradiente indigo/roxo
    • SingleChildScrollView (sem overflow)
    • Pacote intl instalado (datas em portuguรชs)

๐Ÿšง In Progress

  • Transactions Feature (Domain Layer) โœ…
    • Transaction entity (id, amount, type, category, date, userId)
    • TransactionRepository interface
    • Use Cases: AddTransaction, GetTransactions, DeleteTransaction
  • Transactions Feature (Data Layer)
    • TransactionModel (fromFirestore, toFirestore)
    • TransactionRemoteDataSource (Firestore calls)
    • TransactionRepositoryImpl
  • Dashboard โ€” Pendente apรณs Transactions
    • Data dinรขmica + nome real do utilizador
    • Drawer lateral moderno (perfil, definiรงรตes, MVP Portugal)
    • Speed Dial FAB (โ†‘ Receita / โ†“ Despesa)
    • Dados reais do Firestore

๐Ÿ”ฎ Planned (MVP Portugal)

๐Ÿ† Differentiators (Why users switch)

  • ๐Ÿ‡ต๐Ÿ‡น IRS Refund Gamification - Live progress bar for tax benefits (15% VAT)
  • ๐Ÿ’ณ MB WAY Smart Decoder - Aliases for phone numbers (e.g. 9123... -> "Landlord")
  • ๐Ÿฝ๏ธ Meal Card Tracker - Separated balance with "Quick Lunch" button
  • ๐Ÿ“ˆ Savings Certificates - Auto-calculation for Series E/F interest

๐Ÿ›ก๏ธ Essentials (Trust & Security)

  • ๐Ÿ”’ Privacy First - Local-only database (SQLite/Isar) option
  • ๐Ÿฆ Open Banking - Connect to PT Banks (CGD, BCP, Activo) via GoCardless
  • ๐Ÿ” Biometric Security - FaceID / TouchID
  • ๐Ÿ’ถ Multi-Currency - Auto-convert GBP/CHF/PLN to EUR

โš“ Retention (Daily Use)

  • ๐Ÿ“… Subscription Detector - Alerts for tomorrow's Netflix/Spotify charge
  • ๐Ÿšฆ Traffic Light Budgets - Visual limits (Green/Yellow/Red)
  • ๐Ÿ“Š Smart Analytics - Spending by category & evolution charts

๐Ÿ” Security & Compliance (EU/GDPR)

  • Database Encryption: AES-256 via Isar/Hive + flutter_secure_storage for keys.
  • SSL Pinning: Prevent Man-in-the-Middle attacks for API calls.
  • Biometric Enforcement: Mandatory FaceID/TouchID via local_auth.
  • Legal: In-app Privacy Policy & "Not Financial Advice" Terms.

๐Ÿ› ๏ธ Tech Stack

Core

  • Framework: Flutter 3.x
  • Language: Dart 3.x
  • State Management: Riverpod 3.x
  • Navigation: GoRouter 17.x
  • Architecture: Clean Architecture

Backend & Database

  • Authentication: Firebase Auth
  • Cloud Database: Cloud Firestore
  • Storage: Firebase Storage (planned)
  • Local Cache: Hive (planned)

Development Practices

  • Version Control: Git & GitHub
  • Code Style: Dart conventions
  • Architecture Patterns: Repository Pattern, Dependency Injection, Use Cases
  • Principles: SOLID, DRY, Clean Code

UI Polish Packages (Phase 3 โ€” apรณs funcionalidade completa)

Regra: Funcionalidade โ†’ Dados reais โ†’ Polimento UI

Package Uso no Centi Prioridade
salomon_bottom_bar Bottom navigation animada (estilo fintech) โญ Alta
loading_animation_widget Substituir CircularProgressIndicator no login/register โญ Alta
awesome_snackbar_content SnackBars animados de sucesso/erro ๐Ÿ”ถ Mรฉdia
top_snackbar_flutter โŒ Duplica awesome_snackbar_content โ€” nรฃo usar โ€”
animated_bottom_navigation_bar โŒ salomon_bottom_bar รฉ melhor para fintech โ€”
card_swiper Onboarding swipe โ€” nรฃo estรก no roadmap atual ๐Ÿ”ท Baixa
avatar_glow Glow animado em avatares/รญcones ๐Ÿ”ท Baixa

๐Ÿ—๏ธ Architecture

This project follows Clean Architecture principles with strict separation of concerns:

lib/
โ”œโ”€โ”€ core/                       # Shared code
โ”‚   โ”œโ”€โ”€ constants/             # App constants
โ”‚   โ”œโ”€โ”€ theme/                 # โœ… App Theme & Colors
โ”‚   โ”œโ”€โ”€ utils/                 # Utility functions
โ”‚   โ””โ”€โ”€ errors/                # Custom errors
โ”‚
โ””โ”€โ”€ features/
    โ”œโ”€โ”€ auth/                   # Authentication feature
    โ”‚   โ”‚
    โ”‚   โ”œโ”€โ”€ domain/             # โœ… COMPLETE - Business Logic Layer
    โ”‚   โ”‚   โ”œโ”€โ”€ entities/
    โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ user.dart                    # User entity with validation
    โ”‚   โ”‚   โ”œโ”€โ”€ repositories/
    โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ auth_repository.dart         # Repository interface
    โ”‚   โ”‚   โ””โ”€โ”€ usecases/
    โ”‚   โ”‚       โ”œโ”€โ”€ login_user.dart              # Login use case
    โ”‚   โ”‚       โ”œโ”€โ”€ register_user.dart           # Register use case
    โ”‚   โ”‚       โ”œโ”€โ”€ logout_user.dart             # Logout use case
    โ”‚   โ”‚       โ””โ”€โ”€ get_current_user.dart        # Get current user use case
    โ”‚   โ”‚
    โ”‚   โ”œโ”€โ”€ data/               # โœ… COMPLETE - Data Layer
    โ”‚   โ”‚   โ”œโ”€โ”€ models/
    โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ user_model.dart              # User model with conversions
    โ”‚   โ”‚   โ”œโ”€โ”€ datasources/
    โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ auth_remote_datasource.dart  # Firebase calls
    โ”‚   โ”‚   โ””โ”€โ”€ repositories/
    โ”‚   โ”‚       โ””โ”€โ”€ auth_repository_impl.dart    # Repository implementation
    โ”‚   โ”‚
    โ”‚   โ””โ”€โ”€ presentation/       # ๐Ÿšง IN PROGRESS - UI Layer
    โ”‚       โ”œโ”€โ”€ controllers/    # Riverpod Notifiers (AuthController)
    โ”‚       โ”œโ”€โ”€ providers/      # Dependency Injection
    โ”‚       โ””โ”€โ”€ screens/        # Login, Register, Splash
    โ”‚
    โ””โ”€โ”€ dashboard/              # ๐Ÿšง IN PROGRESS - Dashboard Feature
        โ””โ”€โ”€ presentation/
            โ”œโ”€โ”€ screens/        # DashboardScreen
            โ””โ”€โ”€ widgets/        # BalanceCard, TransactionItem

Architecture Benefits

โœ… Testability - Each layer can be tested independently
โœ… Maintainability - Clear structure, easy to navigate
โœ… Scalability - Easy to add new features
โœ… Flexibility - Can change implementations without affecting other layers
โœ… Independence - Domain layer has zero dependencies on external frameworks

Layer Responsibilities

๐ŸŽฏ Domain Layer (Business Logic)

  • Defines what the app does
  • Contains entities (business objects)
  • Defines repository contracts
  • Implements use cases (business rules)
  • Framework-independent (pure Dart)

๐Ÿ’พ Data Layer (Data Management)

  • Implements repository contracts
  • Handles data sources (Firebase, APIs, local DB)
  • Converts between models and entities
  • Manages caching and synchronization

๐ŸŽจ Presentation Layer (User Interface)

  • Displays data to users
  • Handles user interactions
  • Manages UI state with Riverpod
  • Calls use cases, never repositories directly

๐Ÿ“Š Current Progress

Domain Layer - Auth Feature โœ… 100%

User Entity

  • Immutable data class with id, email, displayName
  • Constructor validation (empty checks, email format)
  • copyWith method for updates
  • Proper equals and hashCode

Repository Interface

  • login(email, password) โ†’ Future
  • register(email, password, displayName?) โ†’ Future
  • logout() โ†’ Future
  • getCurrentUser() โ†’ Future<User?>

Use Cases

  • LoginUser - Handles user login
  • RegisterUser - Handles user registration
  • LogoutUser - Handles logout
  • GetCurrentUser - Gets currently logged in user
  • All use cases implement Dependency Injection

Concepts Applied

  • Clean Architecture principles
  • SOLID principles
  • Repository Pattern
  • Dependency Injection
  • Use Case Pattern
  • Future/async/await
  • Immutability

Data Layer - Auth Feature โœ… 100%

UserModel

  • Extends User entity
  • fromFirebase(firebase_auth.User) - Converts Firebase user
  • fromJson(Map) - Converts from JSON
  • toJson() - Converts to JSON
  • Factory constructors for conversions

Repositories & DataSources

  • AuthRemoteDataSource - Implemented with Firebase Auth
  • AuthRepositoryImpl - Connects Domain to Data layers

Presentation Layer - Auth Feature โœ… 100%

Screens

  • Splash Screen: Animated with auth check, Timer dispose โœ…
  • Login Screen: UI, Validation, GoRouter, mounted guard โœ…
  • Register Screen: UI, Validation, GoRouter, mounted guard โœ…

State Management

  • AuthController (AsyncNotifierProvider) handles all logic
  • Global Error Handling via SnackBars
  • GoRouter centralized navigation

Domain Layer - Transactions Feature โœ… 100%

Transaction Entity

  • TransactionType enum (income / expense)
  • Immutable data class com 7 campos
  • Validaรงรตes: id, userId, amount > 0, category
  • copyWith para atualizaรงรตes imutรกveis

Repository Interface

  • addTransaction(Transaction) โ†’ Future
  • getTransactions(userId) โ†’ Stream<List>
  • deleteTransaction(transactionId) โ†’ Future

Use Cases

  • AddTransaction โ€” guarda transaรงรฃo via repository
  • GetTransactions โ€” Stream em tempo real por userId
  • DeleteTransaction โ€” apaga pelo id

Presentation Layer - Dashboard Feature ๐Ÿšง 70%

Widgets

  • BalanceCard: efeito vidro, gradiente, setas nรฉon, formato europeu โœ…
  • TransactionItem: รญcone circular, cor por tipo โœ…

Screens

  • DashboardScreen: header gradiente + scroll + lista placeholder โœ…
  • Data dinรขmica + nome utilizador ๐Ÿšง
  • Drawer lateral + Speed Dial FAB ๐Ÿšง (aguarda Transactions)

๐Ÿ—บ๏ธ Roadmap

Phase 1 - Foundation (Week 1-2) โœ… 100%

  • Project setup with Clean Architecture
  • Firebase configuration and integration
  • Domain Layer complete (Entity, Repository, Use Cases)
  • UserModel with conversions
  • DataSource and Repository implementation
  • Authentication screens (Login/Register/Splash)
  • GoRouter centralized navigation

Phase 2 - Core Features (Week 3-4) ๐Ÿšง 60%

  • Dashboard base with BalanceCard and TransactionItem
  • Dashboard redesign moderno (gradiente + scroll + fintech style)
  • Transactions Domain Layer (entity + repository + use cases)
  • Transactions Data Layer (Firestore + model)
  • Transactions Presentation (Speed Dial + formulรกrio + providers)
  • Dashboard com dados reais + Drawer + Perfil
  • Category system
  • Basic statistics

Phase 3 - Advanced Features (Week 5-6)

  • Budget tracking and alerts
  • Charts and visualizations
  • Data export (PDF, CSV)
  • Dark mode

Phase 4 - Polish & Deploy (Week 7-8)

  • Animations and UI polish
  • Testing (Unit, Widget, Integration)
  • Performance optimization
  • Deploy to Google Play / App Store

๐Ÿš€ Getting Started

Prerequisites

  • Flutter SDK (>= 3.0.0)
  • Dart SDK (>= 3.0.0)
  • Firebase project configured
  • Android Studio / VS Code
  • Git

Installation

  1. Clone the repository
git clone https://github.com/CLopes86/centi.git
cd centi
  1. Install dependencies
flutter pub get
  1. Configure Firebase

    • Create a Firebase project at Firebase Console
    • Enable Email/Password authentication
    • Create Firestore database
    • Download and add google-services.json (Android) to android/app/
    • Download and add GoogleService-Info.plist (iOS) to ios/Runner/
  2. Run the app

flutter run

๐Ÿ“š Learning Journey

This project showcases professional Flutter development practices:

Concepts Mastered โœ…

  • Clean Architecture - Three-layer separation (Domain/Data/Presentation)
  • SOLID Principles - Single Responsibility, Dependency Inversion, etc.
  • Repository Pattern - Abstract data sources behind interfaces
  • Use Cases - Isolated business logic
  • Dependency Injection - Loose coupling between layers
  • Factory Constructors - Object creation patterns
  • async/await - Asynchronous programming
  • Future & Stream - Reactive programming concepts

Currently Learning ๐Ÿšง

  • Riverpod - Modern state management
  • Firebase Integration - Auth, Firestore, Storage
  • Testing - Unit tests, widget tests
  • Error Handling - Either type, custom exceptions

Next Steps ๐Ÿ”ฎ

  • Advanced UI - Animations, custom painters
  • ML Kit - OCR for receipt scanning
  • Performance - Optimization techniques
  • CI/CD - Automated testing and deployment

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


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

Cesaltino Lopes

Cesaltino Lopes

๐ŸŽ“ 3rd Year - Informatica & Multimedia @ IPCB
๐Ÿ’ป Mobile Developer | Flutter Enthusiast
๐Ÿš’ Volunteer Firefighter since 2023
๐Ÿš€ Building professional-grade applications

GitHub LinkedIn Email

๐Ÿ“ Portugal | ๐ŸŒ Open to opportunities


๐Ÿ’ก "Building the future, one line of code at a time"

Made with ๐Ÿ’™, Flutter, and Clean Architecture

โญ Star this repo if you find it useful!


๐Ÿ“ˆ Project Stats

Commits Last Commit Code Size

About

๐Ÿ’ฐ Advanced personal finance tracker built with Flutter, Firebase and Clean Architecture

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors