How prathameshsaraf/babynama works
Main Components
• UI Layer (Views): Represented by the screens and widgets (located in lib/Views). This is where the user interacts with the application.
• Business Logic Layer (ViewModels): Found in lib/viewModel. These components handle the logic, listen to user input from the UI, and update the state.
• Service Layer: Although the folder is named “servies” in the file tree, these provide external services management (e.g., local_storage_service.dart, snackbar_service.dart). They are responsible for operations like API calls, storage, and notifications.
• Data Models: Found in lib/Model. These are classes representing the data structures (e.g., service_model.dart, vaccine_model.dart).
• App Configuration and Routing: The lib/app folder includes files such as app.dart, app.router.dart, and dependency injector setup (app.locator.dart) which orchestrate dependency management and app-level routing logic.
Relationships and Data Flow
• The UI (Views) interacts directly with the respective ViewModels.
• ViewModels retrieve and manipulate data by interacting with the Service layer and update corresponding Models.
• The Service layer may handle tasks like reading/writing to local storage (using get_storage) or managing snackbars for feedback.
• Dependency injection (via packages like injectable) links these components together, ensuring that each component receives its required dependencies seamlessly.
• Routing and navigation are managed by auto_route and defined in the app/router files, coordinating transitions between various views.
Architectural Patterns and Principles
• The Stacked architecture pattern emphasizes separation of concerns, ensuring that the presentation layer (views) is cleanly separated from the business logic (viewmodels) and external services.
• Dependency injection is used for loose coupling between components.
• The auto_route package indicates a clear separation of the navigation layer.
• The project also uses reactive programming patterns with state management, an essential part of the Stacked pattern.
How to Represent This
• UI Layer (Views): List the key screens (Home, Account, Autism, Track Vaccination, Profile).
• Service Layer: Represent services like local storage and snackbar functionalities.
• Data Models: Show the data abstraction layer used by the viewmodels and services.
e. Label external libraries and frameworks (like auto_route for navigation, stacked_services for additional utilities, get_storage for local persistence) in separate annotations or legends.
• Rectangles for layers (UI, Business Logic, Services, Data Models).
• Ovals or circles for external integrations (e.g., dependency injection container, build_runner).