How ayushwant/blood-donation-app works
Main Components
• Mobile Client (Android App): This is the bulk of the project and includes:
– UI Layer: Represented by a wide range of Activities (LoginActivity, SplashScreen, ProfileActivity, etc.), Fragments (FeedFragment, MapFragment, etc.), and layout resources.
– Presentation Components: Adapters (for displaying lists such as chats, feeds, and requests) and Admin-specific components (Admin Activities and Fragments).
– Domain Model: Model classes (Donor, Feed, RequestHistory, Notification, etc.) that encapsulate the business logic.
– Service Components: Utilities and classes handling location (LocationUtils, NearbyPlacesSearch), asynchronous responses, and the Cloud Messaging service (MyFirebaseMessagingService).
• Backend Services:
– Firebase: For handling user authentication, data storage (user profiles, donation requests, feed information), and cloud messaging.
– Google Maps API: Integrated for displaying maps, locating nearby hospitals, pharmacies, etc.
• External Services & APIs:
– Google Services (google-services.json)
– Gradle build configurations for managing dependencies and build settings
Interactions and Relationships
• User Interactions: Users (donors and seekers) interact with the app through various screens (activities and fragments). For example, the DonorRegistrationFormActivity allows donors to register, and the PostBloodRequestFormActivity manages blood request submissions.
• Data Flow:
– Data is captured via user input in activities/forms.
– Model classes transform this data to be communicated to Firebase.
– Firebase handles authentication and data storage and sends notifications via the MyFirebaseMessagingService.
– The UI listens for push notifications and real-time updates to refresh the feed, chat, or list of available requests.
• Module Separation:
– The application is neatly divided into social (feed and chat), administrative, map/location, and registration modules.
– Activities and Fragments are distinguished by functionalities (regular user flow vs. admin-side for verifying donors and request details).
Important Architectural Patterns and Design Principles
• Layered Architecture: The project separates UI (activities, fragments, layouts), business logic (ModelClasses, Utilities), and external service interactions (Firebase, Google Maps API).
• Modularization: Different functionalities (donor registration, chat, feed, and maps) are split into separate folders and packages, indicating good separation of concerns.
• Use of Adapters: To mediate between the data (ModelClasses) and UI components (RecyclerViews/ListViews), demonstrating adherence to the Model-View pattern.
• Cloud Messaging: Integration with Firebase Cloud Messaging to enable push notifications is an important dynamic aspect of the system design.