How cuonvc/ex-money works
Project Type and Purpose
• This is a mobile-first expense tracking application built with Flutter. It targets both Android and iOS (with additional support for web, desktop, etc.). The project contains a well-organized UI and state management using the Bloc pattern, along with modular business logic located in the repository package.
• The README indicates that there is a separate backend (a Spring-based API or Docker image) that the mobile app communicates with. There’s also integration with Firebase for authentication (Google Sign-In) and likely push notifications.
Main Components
a. Mobile Frontend (Flutter Application):
• UI/Screens: All the views under lib/screens (authentication, main views, expense, wallet, etc.).
• State Management: Numerous Bloc modules (found under lib/screens/*/blocs) that handle events, states, and transitions.
• Reusable Widgets: Various widget files (lib/widgets) that provide common UI components.
• Utilities: Helper modules (lib/utils, lib/notification_service.dart) for platform-specific code and constants.
• External Assets: Assets directories for images and animations.
• Platform-Specific Directories: Directories for Android, iOS, web, etc., indicating platform customizations.
b. Repository/Business Logic:
• The packages/repository directory provides controllers, repositories, and models, encapsulating business logic and routing service calls (like expense, category, user, wallet, notifications, etc.). This forms the data integration layer in the app.
c. Backend Component (Separate):
• Although not within the current file tree, the README instructs to clone and run a separate backend (see provided GitHub link) using Spring or Docker image.
• A server-side component that exposes APIs for handling expense tracking, user authentication, notifications, and other CRUD operations.
• The backend is likely connected to one or more databases.
d. External Services:
• Firebase: Both for user authentication and client app configuration (google-services.json for Android, Info.plist configuration for iOS).
• Google Sign-In: Integrated as part of Firebase authentication.
Interactions and Relationships
• The Flutter App’s UI layer (screens, widgets) triggers user actions.
• These actions are managed by the Bloc layers (presentation/business logic) which then interact with the repository package.
• The repository package forms a client to interact with the backend’s RESTful APIs (or similar) to send or receive data (expense creation, category management, notifications, etc.).
• Firebase services, including authentication and possibly analytics or push notifications, interact with the mobile app directly.
• The Backend is standalone. It receives API calls from the mobile app and processes data requests/issues. It also interacts with a database for persistent storage.
Architectural Patterns and Design Principles
• MVC-like or layered architecture within the Flutter ecosystem: The separation between the UI (views/widgets), state management (BLoCs), and the data/service layer (repository).
• Repository Pattern: The “packages/repository” provides a clear abstraction over the backend APIs.
• Cross-Platform Development: Separate directories for Android, iOS, web, desktop all using the common business logic and UI components.
• Dependency Injection and Observer patterns: Notable with BLoC and utilities connections.
• Platform-specific configuration: Android, iOS, Linux, macOS, Windows directories hold their own build files and configurations, but share the core business logic.
Elements
• Clear Labels:
• “Flutter Mobile App” (with subcomponents: UI/Screens, BloC/State Management, Widgets)
• “Repository / Data Access Layer” (from the packages/repository)
• “Backend API” (Spring-based backend service, external to the current file tree)
• “Firebase Authentication & External Services”
• “Database” (connected to the backend)
• How the UI sends events to the BloCs.
• Communication between mobile service (Firebase integration) and the app.