How tamersarioglu/kykscraped works
This project is an Android application that displays daily menu information for KYK dormitories in Turkey. Its primary purpose is to allow users to view breakfast and dinner menus across 18 cities, leveraging real-time data fetching via web scraping along with modern UI techniques. The project follows Clean Architecture principles with the MVVM pattern, ensuring a clear separation between data handling, business logic, and user interface.
Main Components
• Data Layer:
• Contains APIs, Data Transfer Objects (DTOs), Mappers, and Repository implementations.
• Key files: MenuApiService.kt, MenuScraperService.kt, MenuMapper.kt, and MenuRepositoryImpl.kt.
• Involves external libraries like JSoup (for HTML parsing) and Ktor (for networking).
• Domain Layer:
• Encapsulates business logic with Models (e.g., City, DailyMenu), Use Cases (e.g., GetDailyMenusUseCase.kt), and repository interfaces.
• Provides the abstraction that the presentation layer depends on.
• Presentation Layer:
• Handles UI screens (like MenuScreen.kt), user interactions, and state management using ViewModels (e.g., MenuViewModel.kt).
• Employs Jetpack Compose for UI rendering, Material 3 for design, and follows MVVM principles.
• Dependency Injection:
• Managed via Hilt, as seen in files under the di directory (e.g., AppModule.kt, NetworkModule.kt).
Component Relationships and Data Flow
• The Presentation layer (UI and ViewModel) requests data via Use Cases in the Domain layer.
• The Domain layer communicates with the Data layer through repository interfaces.
• The Data layer fetches data from remote sources (web scraping via MenuScraperService and API calls via MenuApiService) and converts it using mappers.
• UI → ViewModel → Use Case → Repository → Remote/Data Source and back.
Architectural Patterns and Design Principles
• MVVM Pattern: Side-by-side comparison of View (Compose UI), ViewModel (state management), and Model (data) should be illustrated.
• Repository Pattern: Demonstrate how the repository abstracts data operations.
• Dependency Injection: Highlight Hilt as a mechanism enabling loose coupling among modules.
• Async operations: Notate that Kotlin Coroutines are used for handling asynchronous tasks and Flow for reactive streams.
Relevant Technologies, Frameworks, and Libraries
• Kotlin (programming language)
• Jetpack Compose and Material 3 for UI
• Hilt for dependency injection
• Kotlin Coroutines and Flow for async and reactive programming
• Ktor for networking
• JSoup for web scraping and HTML parsing
• Android Architecture Components (such as ViewModel)