How sanjaysupanch/news-app works
Project Type and Purpose
• This is a modern Android News App built using Jetpack Compose. It follows the MVVM architectural pattern combined with Clean Architecture principles.
• The app fetches news articles from NewsAPI, displays them in a scrollable list, allows users to save articles locally using Room, and opens full articles in a WebView. Dependency Injection is achieved via Hilt, and the overall experience is enriched with modern UI elements like bottom navigation and dynamic theming.
Analyzing the File Structure
• The entire project's structure lies under the "app" directory. Key directories include:
• src/main/java: Contains all application code including UI screens, navigation, theme definitions, data handling (API service, DAO, database, repository), dependency injection (DI modules), and viewmodels.
• Data Layer: Found in subdirectories like data/api (ArticlesAPIService), data/database (NewsDatabase, NewsDao), and data/modal (NewsModal).
• DI: Directory "di" includes modules such as NetworkModule and DatabaseModule.
• UI: Layers include UI components, screens (HomeScreen, DetailsScreen, SavedArticlesScreen), navigation (BottomNavigationBar, Screens), theme, etc.
• The file tree also hints at clear separation of concerns aligning with the MVVM and Clean Architecture patterns.
Additional Details and Recommendations
• The process of fetching news articles: API Service call, data processing in Repository, updating the ViewModel, and display on UI.
• The saving of articles: interaction with Room Database through DAO and Repository.
• Navigation between screens handled via a Bottom Navigation Bar.