How juanmproyect/coinflow works
Project Overview
• CoinFlow is a full-featured mobile application built with Flutter/Dart and designed for real-time currency conversion.
• Its main functionalities include real-time conversion (via Exchangerate-API), favorite currencies management, conversion history, offline mode, and theme customization.
• It integrates with Firebase Firestore for storing user history and settings.
Main Components
• Frontend (Flutter UI/UX Layer):
• Screens: Located in lib/Screens (home, favorites, history, loading, settings).
• UX & Theme components: lib/UX (home_design.dart, theme_manager.dart) providing the presentation layer and theme controls.
• Services (Business Logic & Data Layer):
• API Service: lib/Services/api_service.dart handling calls to Exchangerate-API.
• Currency Data Service: lib/Services/currency_data.dart for managing conversion logic.
• Firebase Options: lib/Services/firebase_options.dart, including Firebase configuration details.
• External Systems:
• Exchangerate-API: The third-party currency conversion API.
• Firebase Firestore: For syncing conversion history, user settings, and possible offline data synchronization.
• Platform-specific Layers:
• Multiple folders (android, ios, linux, macos, windows, web) show how Flutter compiles to different platforms, though the core business logic resides in lib.
• State Management:
• Although not explicitly visible, the use of “Provider” in the requirements hints that state management is implemented to sync UI components with underlying data/services.
Relationships and Interactions
• UI components interact with the Services layer (API calls, state updates, theme switching).
• The API Service fetches conversion rates from Exchangerate-API and passes the data to the UI.
• The Firebase service saves and retrieves user data (conversion history, favorites, theme settings) ensuring real-time updates.
• An offline mode mechanism would likely cache data locally so that network interruptions do not cause a critical failure.
Architectural Patterns and Technologies
• Separation of Concerns: Clear distinction between UI (lib/Screens, lib/UX) and business logic/services (lib/Services).
• Use of Provider: Suggests a reactive programming model where UI reacts to state changes.
• Cross-Platform Design: The project structure indicates target exports on Android, iOS, web, and desktop, all driven by the same Flutter code in lib.
• Third-Party Integration: Firebase Firestore for database needs and Exchangerate-API for external data.
• Offline Handling: Although implementation details might reside in the business logic, the design should account for local caching.