How achrafsl/edimydar works
Project Type and Purpose
• This is an Android mobile ToDo application (“EdiMyDar”) written in Java.
• It provides user authentication, task management (today’s tasks and general tasks), AI-powered help via a REST API, and push/local notifications.
• The app uses Firebase (Auth, Firestore, FCM), OkHttp for AI API calls, and standard Android UI components (Activities, Fragments, RecyclerViews).
High-Level Architecture Components
A. Android Client
1. Presentation Layer
• Activities (Home, Login, Register, UserProfile, ForgotPassword flows)
• Fragments (MyDay, Task, AI Help)
• RecyclerView Adapters (MessageAdapter, TaskRecyclerViewAdapter, NormalTaskAdapter)
2. Business / Domain Layer
• Models (Message, DailyTask, NormalTask)
• ImageUtils (Base64 ↔ Bitmap conversions)
• NotificationReceiver (AlarmManager → BroadcastReceiver)
3. Data Access Layer
• Firebase Auth (login, registration, re-authentication)
• Firestore (CRUD operations on user profile and task collections)
• OkHttp (REST client for Gemini AI API)
• Local in-memory task lists (populated from Firestore at runtime)
B. External Services
• Firebase Cloud Firestore (persistent storage)
• Firebase Authentication (user management)
• Firebase Cloud Messaging (push notifications)
• Gemini AI REST API (task-assist chatbot)
Relationships and Data Flows
• User interacts with UI (Activities/Fragments) → event handlers invoke business logic.
• UI layer calls Data Access Layer:
• Auth calls → Firebase Auth endpoints
• CRUD tasks → Firestore collections
• Profile image → Firestore (Base64 blob)
• AI queries → OkHttp → Gemini API → message responses → UI
• Notification scheduling:
• TaskFragment schedules alarms via Android AlarmManager → NotificationReceiver → builds and posts notifications through FCM/local channels.
• Adapters bind models to RecyclerViews in Fragments.
Architectural Patterns and Principles
• MVC-like separation:
• View = XML layouts + Activities/Fragments
• Controller = Activities/Fragments + Adapters
• Model = Plain Java objects (Message, Task)
• Single Responsibility: each Activity or Fragment handles one screen/flow.
• Dependency inversion: external services invoked via wrapper classes (ImageUtils, NotificationReceiver).
• Modular packaging: clear separation between UI, models, adapters, utils.