How nyamwaya/tableties works
─────────────────────────────
Project Type and Purpose
─────────────────────────────
• The project is a Flutter-based mobile app (with multi-platform support: Android, iOS, macOS, Linux, Windows, and Web) for connecting strangers over dinner based on shared interests.
• Its primary goal is social interaction by pairing users with shared interests, addressing loneliness.
• The application uses the BLoC (Business Logic Component) pattern to manage state and handle user interactions.
─────────────────────────────
Main Components of the System
─────────────────────────────
A. Presentation Layer (UI)
• Located predominantly in the "lib/screens" and "lib/widgets" directories.
• Contains various screens such as Login, SignUp, Home, Profile, Match, and Settings.
• Implements the UI for diverse platforms (mobile, web, desktop) as seen by platform-specific directories (android, ios, etc.).
B. Business Logic Layer (BLoC)
• Found in the "lib/blocs" directory with subdirectories for home, login, profile, and signup.
• Manages events and state transitions:
• Events: Represent user interactions (e.g., login, signup, profile update).
• States: Represent UI updates after processing events.
• BLoCs: Act as controllers to bridge events and their resulting states.
C. Data Layer (Repositories/Models)
• Repositories are in "lib/repo" (login_repo, profile_repo, sign_up_repo, supabase_repo).
• Models representing data structures in "lib/data_models" and "lib/models".
• Communication with external services (like Supabase) is encapsulated here.
D. Configuration and Utilities
• Configuration files like "lib/config/routes.dart" and "lib/config/theme.dart" set up navigation and theming.
• Utility classes and services, including "lib/services" for dio_client and preferences_service, aid in API interactions and local data handling.
E. External Services
• Supabase integration for backend services (as noted in the README’s Supabase configuration section).
• Other potential external APIs or services can be included here as part of the repositories.
─────────────────────────────
Relationships and Interactions
─────────────────────────────
• The UI dispatches user actions (events) to the appropriate BLoC.
• BLoCs process events, interact with repositories for data (e.g., fetching, updating user data), and then emit new states.
• The UI listens to these state changes and updates the view accordingly.
• Repositories use service classes (like dio_client) for network/API communication with external systems such as Supabase.
─────────────────────────────
Architectural Patterns and Design Principles
─────────────────────────────
• The BLoC Pattern – Ensuring a clean separation between UI (presentation) and business logic.
• Separation of Concerns – Clear division between user interface, business logic, and data handling.
• Multi-Platform Support – The presence of platform-specific directories (android, ios, macos, etc.) signifies a design architecture that targets multiple form factors.
• Modularity – Organized folder structure (blocs, repo, models, screens) suggests that each functionality is encapsulated in a dedicated module.
─────────────────────────────
Final Touches
─────────────────────────────
• Use a clean layout with hierarchical flow from UI -> BLoC -> Repositories -> External Services.