How ekrajghimire/hisabkitab works
Project type and purpose
• This is a cross-platform full-stack mobile/web/desktop application built with Flutter.
• Purpose: group expense management—track, split, and settle expenses in real time, with features like multi-currency support, offline mode, receipt scanning, analytics, and export.
High-level architecture components
a. Clients (Flutter apps running on Android, iOS, Web, Windows, macOS, Linux)
b. Presentation Layer (Flutter UI widgets organized by feature under lib/features)
c. State Management Layer (Provider/BLoC classes under lib/features/*/providers)
d. Domain & Business Logic (Models under lib/models, utility classes in lib/core/utils)
e. Service Layer (FirebaseService in lib/core/services)
f. Backend as a Service (Firebase Auth, Cloud Firestore, Cloud Storage, optional Cloud Functions)
g. External Services (e.g., currency-conversion API if used)
Relationships and data flows
• Users interact with the UI (screens under lib/features/*/screens).
• UI widgets dispatch actions or listen to State Management providers (lib/features/*/providers).
• Providers call Domain/Business Logic and Service Layer methods.
• FirebaseService functions encapsulate calls to Firebase SDKs:
– Authentication (sign-up, login, password reset)
– Firestore (read/write group, expense, user, settlement documents)
– Storage (upload/download receipt images)
• Data flows back: Firestore real-time streams update providers → UI reflects changes instantly, supporting offline persistence.
• For analytics, providers aggregate Firestore data, compute charts, and feed UI.
• Exports (CSV/PDF) are generated locally on the client, optionally using third-party Dart packages.
Architectural patterns and principles
• Feature-based folder structure (lib/features) for modularity and scalability.
• Separation of concerns: UI, state management, domain models, services.
• Provider (or Bloc) pattern for reactive state and dependency injection.
• Single source of truth in Firestore with real-time synchronization and offline support.
• Core utilities and theming in lib/core for reuse across features.