How hasan-alhamwi/eventapp works
Project Type & Purpose
• This is an Android-based event booking application that implements Clean Architecture with the MVVM design pattern.
• The app’s purpose is to allow users to browse events, view event details, and perform simulated event booking and payment processes.
• It emphasizes secure authentication, offline support (with local Room persistence), and a well-structured separation of concerns.
File Structure
• The project is organized into clear architectural layers:
• The “presentation” package contains various fragments, view models, and UI-related classes.
• The “domain” package includes use cases, domain models, and repository interfaces.
• The “data” package implements data sources for both local (Room database and DAOs) and remote (simulated API) data, along with repository implementations.
• There is a dedicated “di” (dependency injection) package that uses Hilt to provide dependencies across the app.
• The presence of extensive tests also indicates a focus on maintainability and testability.
Key Architectural Components to Capture
a. Presentation Layer:
• UI components: Fragments (e.g., LoginFragment, EventListFragment, EventDetailFragment, PaymentBottomSheetFragment).
• ViewModels: Manage UI state and state flows for each screen.
• Navigation: Managed via Jetpack Navigation Component with clear transitions.
b. Domain Layer:
• Use Cases: Represent business logic such as Login, Registration, GetEvents, GetEventDetails, CreateBooking, and ProcessPayment.
• Domain Models: Core representations (e.g., BookingDomain, EventDomain, PaymentDomain, UserDomain).
• Repository Interfaces: Contracts (e.g., IAuthRepository, IEventRepository) that abstract data operations.
c. Data Layer:
• Repository Implementations: Handle data operations and coordinate local vs remote data sources.
• Local Data Source: Room Database, DAOs (e.g., EventDao) for persistence and offline support.
• Remote Data Source: Mock API Service simulating network behavior.
• Data Models: Representations of entities used for both database and API interactions.
Elements
• The Presentation Layer communicates with the Domain Layer via ViewModels invoking Use Cases.
• The Domain Layer depends on Repository interfaces which are implemented in the Data Layer.
• The Data Layer integrates both local (Room Database with DAOs) and remote (Mock API Service) data sources.
• UI elements (e.g., rounded rectangles for fragments and view models).