How wu4ngg/wellmate works
• Frontend (Flutter UI) – This is the primary presentation layer of the application. It covers all the various screens and components defined under the “lib/screen” and “lib/components” directories. Also, note the cross-platform support: Android, iOS, web, desktop (windows, macos, linux).
• State Management / Providers – Components contained in “lib/providers” handle business logic and state changes across the app’s UI.
• API Integration Layer – Organized under “lib/api”, this layer is responsible for interacting with backend services (e.g., for authentication, drug data, payment processing, hospital, and notification-related functions). Each API subdirectory (auth, address, cart, etc.) acts as a repository that abstracts external data communication.
• Data Models – Found under “lib/model”, these define the data structures used throughout the application. They serve as the intermediate form between the UI and data from external services.
• Local Storage and Utilities – Directories such as “lib/storage” (for secure storage) and “lib/utils” provide support for persisting user sessions, caching data, and handling common functions.
Relationships and interactions
• The UI components (screens, dialogs, widgets) interact with the state management providers, which in turn call the API layer to fetch or send data.
• The API layer communicates with external services (third-party servers for push notifications, payment gateways, etc.), which then deliver data back through defined repositories.
• Data models act as the shared contract throughout the layers—data received via API calls is converted to models which populate the UI.
• Local secure storage is used by both the API layer (e.g., token management) and state management to persist data across sessions.
Important architectural patterns and design principles
• Separation of Concerns – Each directory in “lib” is well-segregated: screens for UI, providers for state, API classes for data fetching, and models for data handling.
• Repository Pattern – Noticed in the “lib/api” folder, where each domain (auth, drug, hospital, etc.) has its own repository to manage external communication.
• Cross-Platform Development – The distinct directories under android, ios, web, etc. indicate platform-specific layers or configurations; however, the core logic resides within the “lib” folder.
• Modular and Scalable Design – The componentized structure allows for independent development and maintenance of features like medication scheduling or payment functionalities.
Relevant technologies and frameworks
• Flutter and Dart – The backbone of the application.
• Platform-Specific Configurations – Supported by native folders (android, ios, linux, macos, windows) which encapsulate build configurations and platform-specific integrations.
• External APIs – Although not detailed in the repository, the WellMate system integrates with services for push notifications, payment processing, and possibly barcode scanning.
• Individual components if needed, such as marking specific API repositories (auth, drug, schedule, etc.) and their relationship with corresponding UI screens.
• Don’t hesitate to detail subcomponents like push notifications, payment gateways, and barcode-based imports as standalone entities connected to the API layer.