How kongquan98/movieapps works
Overall Project Type and Purpose
• Project Type: Mobile application using native Android development.
• Purpose: A movie listing and details app that includes user authentication, movie search, and detailed screens.
• Technologies: Jetpack Compose for UI, MVVM as an architectural pattern, Retrofit for API networking, Room for the local database, Hilt for dependency injection, and Firebase Auth/Firestore for user management.
• UI Layer (Presentation):
• UI Screens (located under app/src/main/java/.../ui/screen): LoginScreen, SignupScreen, OnboardingScreen, MovieListScreen, MovieDetailsScreen.
• UI Components (e.g., ErrorValidation and NetworkValidation components) under app/src/main/java/.../ui/component.
• Navigation Component (AppNavigation) that manages screen transitions.
• ViewModel Layer:
• ViewModels (found under app/src/main/java/.../viewmodel): MovieViewModel, LoginAndSignupViewModel – these manage UI state and business logic interaction.
• Domain/Business Logic Layer:
• Repositories (MovieImdbRepository) that gather data from various sources.
• Domain Models/Data Models (MovieListResponse, MovieDetailsResponse, ModelConversion, etc.) that transform raw data into usable formats.
• Service Interfaces (MovieImdbApi) for retrieving movie information from remote API endpoints.
• Configuration (ApiConfig.properties, Config.kt) which determine API endpoints and settings.
• Data Persistence Layer:
• Local Database using Room (MovieListDao, MovieListDatabase, UserDatabasePassphrase) enabling caching and local storage.
• Dependency Injection:
• DI Modules (NetworkModule in app/src/main/java/.../domain/di) that configure and provide instances required throughout the app (e.g., Retrofit, Room instances).
• External Services:
• Firebase Integration as implied by google-services.json and the README; although client code specifics aren’t detailed, it fits as an external authentication and data service.
Relationships and Data Flow
• UI Components interact with ViewModels to send user events.
• ViewModels orchestrate calls to the Domain layer (running business logic, data validation, etc.).
• The Domain layer, via repositories, manages data by interfacing with:
• Remote API calls (using Retrofit through the MovieImdbApi service).
• Local Cache/Database operations (using Room through DAOs).
• DI (via Hilt) ensures that all components (services, database, repositories) are correctly injected without manual assembly.
• Firebase services represent external dependencies, especially for user authentication and perhaps storing user profiles, with secure data flows between the app and cloud.
Architectural Patterns and Design Principles
• MVVM: Clearly separate presentation (UI and ViewModel) from business logic (Domain) and data persistence.
• Dependency Injection: Using Hilt to decouple module dependencies.
• Modular Design: Different packages (ui, viewmodel, domain, storage, config, di) keep concerns isolated.
• Clean/Layered Architecture: Ensures that UI remains independent of the data source, making the system testable and maintainable.
Essential Elements
• Configuration details such as dependency injection flows from the NetworkModule to various components.
Step-by-Step Creation
a. Begin by laying out the UI layer on the left side, including the individual composable screens and navigation.
d. At the bottom or side, attach the Data Persistence components (Room database, DAOs) and the network components (Retrofit with its API endpoint settings).