How boodyahmedhamdy/mealano works
Project Type and Purpose
• Mealano is an Android application to assist users in meal planning. The README shows that it has multiple screens (login/signup, onboarding, home, meal details, search, favorite meals, plans, profile, and about) and integrates various services such as Firebase for authentication and realtime data, Retrofit for network calls, and Room for local storage. Its architecture follows the MVP (Model-View-Presenter) pattern.
• The purpose of the application is to offer meal suggestions, enable meal searching (by ingredient, category, area), manage user favorites, and support meal planning through features like adding to calendars.
File Structure
• The file tree clearly separates the Android-specific components, with the “app/src/main” folder for the main application logic.
• Presentation Layer: Notice the plentiful fragments and activities under packages (e.g., “home”, “login”, “signup”, “splash”, “onboarding”, “profile”, “meal details”, “favorite”, “search”, “plans”, “about”).
• MVP Implementation: Each feature has its own “contract” package containing definitions for View and Presenter along with separate “presenter” and “view” implementation folders.
• Data Layer: The “datalayer” folder holds datasources defined separately for remote and local access. It further includes repositories for meals, plans, and users.
• Local Data Sources: Look for Room database classes (MealanoDatabase), DAOs, Entities, SharedPreferences management.
• Remote Data Sources: Retrofit API interfaces (MealsApi, MealsApiService) and corresponding implementations.
• Utility and Support: Libraries for networking callbacks, reactive programming (RxJava), UI and utility design, as well as file-based configuration (Gradle build scripts).
a. Main Components:
• Presentation Layer – Contains Activity/Fragment based UI components along with MVP contracts and presenters.
• Data Layer – Separated into:
• Local Data Sources (Room database, DAOs, SharedPreferences)
• Remote Data Sources (APIs via Retrofit, Firebase Authentication)
• Repository Layer – Acts as the mediator between the UI (through presenter classes) and the data sources (both local and remote).
• External Services – Includes Firebase for authentication and data sync, Google services for login, Calendar integration, and possibly external libraries for Reactive (RxJava) and networking (Retrofit).
b. Relationships and Interactions:
• The UI components (Fragments/Activities) interact with Presenters (from the MVP) via defined contracts.
• Presenters retrieve or update data via the Repository abstraction.
• The Repository directs calls to either the Local Data Sources (for caching, shared preferences, local queries) or the Remote Data Sources (to fetch data from APIs/Firebase).
• Utility classes (callbacks, network monitoring) support asynchronous or reactive operations between these layers.
c. Architectural Patterns/Design Principles:
• MVP – Clean separation between view interfaces and presenter logic.
• Repository Pattern – Abstracts data retrieval and persistence logic between remote and local sources.
• Separation of Concerns – Each feature (e.g., login, home, search) is organized into its own package with dedicated MVP, making components modular and maintainable.
d. Relevant Technologies:
• Programming Language: Java (with some Gradle Kotlin build scripts)
• UI Frameworks: XML for layout, Material Design Components
• Networking: Retrofit for API calls, RxJava for reactive programming
• Database: RoomDatabase for local storage; Firebase Realtime Database for online data
• Authentication: Firebase Authentication, along with support for Google-based login
• External integrations: Calendar sharing for meal plans