A personal finance Ledger app (Flutter) used for tracking accounts, transactions, categories, and tags. This repository contains a Flutter mobile/tablet/desktop app with a small, dependency-injected service layer and a SQLCipher-backed database for encrypted local storage.
- Overview
- Quick start
- Development setup
- Running the app
- Testing
- Architecture and structure
- Contributing
- Code style & linting
- FAQ & Troubleshooting
ledger is a small Flutter app intended to demonstrate clean separation between UI and data layers (models and services) using a GetIt service locator, as well as secure local storage using sqflite_sqlcipher.
Key features
- Account management
- Transaction entry and listing
- Categories and tags
- Budgets and spending tracking
- Data import/export (JSON format)
- Encrypted local database
- Testable codebase with dependency injection
Requirements
- Flutter 3.x/4.x SDK and Dart 3.x (see
pubspec.yamlenvironment) - macOS / Windows / Linux for desktop; Android Studio or Xcode for device testing
Clone repository
git clone <your-repo-url> ledger
cd ledgerGet packages
flutter pub getRun on an emulator or device
flutter runBuild for specific platforms
- Android:
flutter build apkorflutter build appbundle - iOS:
flutter build ios - macOS:
flutter build macos - Windows:
flutter build windows - Web:
flutter build web
Note: iOS builds require a macOS host with Xcode installed.
- Install Flutter (https://docs.flutter.dev/get-started/install)
- Ensure
flutter doctorpasses and you can run device emulators. - Run
flutter pub getto fetch dependencies. - Optionally configure a code editor like VS Code or Android Studio.
Service locator and app init behaviour is implemented in lib/services/service_locator.dart and lib/services/app_init_service.dart. The encrypted DB uses sqflite_sqlcipher and opens during startup if the DB password is set (via UserPreferenceService). See lib/services for details.
This repository includes unit and widget tests. To run the test suite:
flutter test --reporter expandedFor database-backed tests that need to run in the VM you can use sqflite_common_ffi (see TESTING.md) or run them on a device/emulator.
Top-level folders
lib/— App source codelib/main.dart— App entry pointlib/services— DI service locator and app services (DB, accounts, transactions, etc.)lib/models— Data models used across the applib/components— Reusable UI widgetslib/screens— Page-level screens and routeslib/presets— Theme, routes and presetslib/modals— Popups and dialogslib/utilities— Helpers and utils
test/— Unit, service and widget tests
Design and patterns
- Service locator (GetIt) in
lib/services/service_locator.dartconfigures lazily instantiated services. - Services accept abstract DB interfaces so they are testable and can accept fakes for unit tests (see
TESTING.md). - Encrypted DB:
sqflite_sqlcipheris used for secure local storage;DatabaseServicemanages DB init/open/close.
We welcome contributions — see CONTRIBUTING.md for details on coding style, PR process, testing, and running the project locally.
This project uses analysis_options.yaml and flutter_lints for consistent linting. Please run flutter analyze and flutter test before submitting PRs.
flutter doctorshows an error about Xcode/Android SDK: make sure you meet the platform development requirements from Flutter's install documentation.- Database password missing: If your device does not have a DB password, the app initializes a fresh DB and continues without opening an encrypted DB. Set a password using
UserPreferenceServiceto test encrypted DB behavior.
See additional documentation in docs/ARCHITECTURE.md and docs/DEVELOPMENT.md for architecture details and development steps. If you want CI examples (GitHub Actions) or onboarding checklists, I can add docs/CI.md or docs/ONBOARDING.md.