How sedraalsabagh/salamhack works
Primary Components
• Cross-Platform Native Containers: Represent the native folders (android, ios, linux, macos, windows, web) as hosting environments. Although these are mostly boilerplate for Flutter deployment, they illustrate how the same codebase is adapted to run on different platforms.
• Core Flutter Application (in the “lib” folder): Divide this into:
• Presentation Layer: Includes screens, widgets, and routing (e.g., “presentaion/screen”, “app_router.dart”). This is the UI that the end users interact with.
• Business Logic Layer: Contains the state management components (all the cubits found under “lib/business_logic/cubit”) that manage application states such as authentication, CV/resume evaluation, job opportunities, quiz handling, recommendations, etc.
• Data Layer: Includes models (in “lib/data/models”), repositories (in “lib/data/repository”), and web services (in “lib/data/webService”). This layer is responsible for fetching, parsing, and processing data from external APIs or other sources.
Relationships and Data Flow
• The Presentation Layer’s screens and widgets send user interactions (such as navigation events or form submissions) to the Business Logic Layer.
• The Business Logic Layer (Cubit controllers) processes these inputs and, if needed, requests data from the Data Layer.
• The Data Layer communicates with external resources via Web Services, using Repository classes as an abstraction over API calls. Retrieved or updated data then flows back through the Cubit to update the UI.
• There should also be a clear separation when it comes to routing; the “app_router.dart” manages navigation between different screens.
• Optionally, highlight integration with platform-specific assets or native code by referencing the native directories.
Architectural Patterns and Technologies
• Use of Flutter as the cross-platform UI framework.
• Cubit (part of the Bloc state management pattern) for handling state.
• Repository pattern in the Data Layer, which abstracts the interaction with WebServices.
• Clear separation of concerns in line with MVC/MVVM principles, where the business logic and view layers are decoupled from data-fetching responsibilities.