How cookethorg/cooketh-flow works
Project Type & Purpose
• Cooketh Flow is a Flutter-based application used to design, collaborate, and organize ideas visually. It supports customizable nodes, workflow management, and has cloud sync integration through Supabase.
• The multi-platform nature is evident from dedicated directories for Android, iOS, Linux, macOS, Windows, and even web support. This indicates that the system design should capture both the Flutter UI core and platform-specific adaptations.
Key Components to Highlight
• User Interface (UI) Layer:
• Built primarily with Flutter.
• Contains screens (found under lib/screens) for various views (dashboard, login, sign-up, workspace, etc.).
• Reusable widgets (under lib/core/widgets) such as nodes, connectors, toolboxes, and custom components.
• State Management & Routing:
• Providers (under lib/providers) handle authentication, dashboard state, workspace, and flow management.
• The routes files (lib/core/routes) configure in-app navigation, suggesting a modular routing structure.
• Core Business Logic & Services:
• Services (lib/core/services) provide platform file operations, Supabase integrations, etc.
• Utility functions and update management (in lib/core/utils) that support application logic.
• Data Models:
• Models (under lib/models) such as user, connection, flow_manager, and flow_node represent the core data entities.
• External & Cloud Services:
• Integration with Supabase for cloud sync, as described in the README and implemented in Supabase service code.
• The project also appears to support file-based configurations and possibly offline storage because of file_services.
• Platform-Specific Modules:
• Separate directories for each platform (android, ios, linux, macos, windows, web) contain build configurations, native integration files, and assets.
• Assets & Theming:
• Assets (including custom fonts in the assets/fonts directory) and theme definitions (under lib/core/theme) ensure a consistent UI across platforms.
Relationships & Interactions
• User Interaction:
• Users interact with the visual interface provided by Flutter. Touch events, drag-and-drop actions (for nodes), and clicks invoke changes in the UI.
• State Management:
• The Provider-based architecture mediates between UI widgets and underlying business logic. For example, user actions trigger state updates that, in turn, use services to sync with Supabase.
• Data Flow & External Integration:
• When a user updates a workflow, the change is captured by relevant UI components, processed by providers, and then dispatched to the Supabase service, ensuring real-time cloud sync.
• Navigation:
• Routing is managed by the app_route_config and app_route_const files, ensuring a clear pathway for navigation across different screens.
• Platform Layers:
• Platform-specific code (Android, iOS, etc.) interacts with the common Flutter code, enabling native performance and behavior.
Architectural Patterns & Design Principles
• Modular Architecture:
• Clear separation of concerns dividing UI components, state management/providers, core services, and data models.
• Provider Pattern for State Management:
• Helps in decoupling UI from state and business logic.
• Cross-Platform Abstraction:
• Flutter provides a unified UI layer while platform-specific directories ensure native integration.
• Layered Architecture:
• The design can be visualized in layers (Presentation, Business Logic, Data/Services, and Platform Specific Integrations).