How divo662/monity-mobile-banking-app works
Main Components
• Mobile Client (Flutter App):
• Represents the frontend, handling user interactions, UI, and navigation.
• Contains multiple screens that cover authentication (login, signup, verify, forgot/reset password), account management (profile setup, passcode setup), transactions (send money, view transactions), and onboarding.
• Separated by directories under "lib/" (e.g., lib/screens/auth, lib/screens/home, lib/screens/transaction).
• Core Flutter Services and Utilities:
• Mobile Platform-Specific Code:
• Android directory houses the Android-specific implementation.
• iOS directory contains iOS-specific configuration & platform code.
• Both platforms are leveraged by Flutter's cross-platform framework.
• Backend (Supabase Database and Functions):
• Supabase is used for user authentication (auth.users), profile management (profile_info), storing user passcodes (user_passcodes), and logging transactions (transaction_logs_with_names and transaction_receipt).
• Contains SQL functions and triggers such as generate_account_number and send_transaction_notification to manage domain logic automatically.
• The README details how Supabase tables are structured and how functions work (e.g., generating account numbers, sending notifications).
Relationships and Interactions
• The Mobile Client (Flutter App) interacts with the Supabase backend through API calls:
• Authentication endpoints (using auth.users).
• Data CRUD for user profiles and transaction records.
• Real-time notifications where a trigger (inspecting transaction logs) invokes server-side functions that send push notifications.
• Within the Mobile App:
• The UI layer is structured around multiple screens organized by function (auth, home, profile settings, etc.).
• The service layer in lib/core communicates with the backend for data fetching and processing (as illustrated by the Dart code samples in the README).
• The Supabase backend:
• Functions and triggers are used to ensure data integrity (e.g., generating unique account numbers) and provide event-driven communications (notifications).
Architectural Patterns and Design Principles
• Separation of Concerns: Clear division between the UI (Flutter screens) and backend data/business logic (Supabase functions, tables, and triggers).
• Modular Architecture: Screens and utilities are divided into folders which represent individual features (authentication, transactions, onboarding, etc.), making it easier to maintain and scale.
• Event-Driven Architecture: The Supabase triggers (especially for notifications) indicate an event-driven mechanism where database changes automatically invoke business logic.
• Cross-Platform Mobile Development: Flutter enables a unified codebase for Android and iOS, simplifying the mobile client design but still maintaining native configurations in the respective directories.
Relevant Technologies, Frameworks, and Libraries
• Flutter – For building the mobile UI and handling cross-platform development.
• Dart – The programming language used in Flutter.
• Supabase – For backend services (database, authentication, and real-time functionalities).
• SQL/PLpgSQL – For writing Supabase functions and triggers.
• Android & iOS Native Code – Specific configurations and project setups are managed in the android and ios directories.
Elements
• Clear Labels: Each module/component should have a clearly defined label (e.g., "Authentication Module," "Transaction Service").
• Backend services and database elements can use a different hue.