How santoshniroula/hack-the-news works
Hack The News consists of an Android Hacker News reader and a separate Go HTTP service. The Android request path and HTML comment parser are visible in sampled source; the Go router implementations and Android navigation/ViewModel wiring were not sampled, so those connections are left unspecified.
Main entry points: ApiClient.kt API client · MainActivity.kt Reader · Parser.kt HTML parser · TopStoriesRepositoryImpl.kt Stories repository
Components 21
Android reader
- Reader
hackthenews/app/src/main/java/np/com/santoshniroula/hackthenews/MainActivity.kt - Navigation
hackthenews/app/src/main/java/np/com/santoshniroula/hackthenews/app_router/AppNavHost.kt - Route types
hackthenews/app/src/main/java/np/com/santoshniroula/hackthenews/app_router/AppRouter.kt - Stories screen
hackthenews/app/src/main/java/np/com/santoshniroula/hackthenews/topstories/TopStoriesView.kt - Stories state
hackthenews/app/src/main/java/np/com/santoshniroula/hackthenews/topstories/TopStoriesViewModel.kt - Stories repository
hackthenews/app/src/main/java/np/com/santoshniroula/hackthenews/topstories/data/TopStoriesRepositoryImpl.kt - Stories contract
hackthenews/app/src/main/java/np/com/santoshniroula/hackthenews/topstories/repository/TopStoriesRepository.kt - API client
hackthenews/app/src/main/java/np/com/santoshniroula/hackthenews/utils/ApiClient.kt - Story item
hackthenews/app/src/main/java/np/com/santoshniroula/hackthenews/topstories/models/Item.kt
Story details
- Detail screen
hackthenews/app/src/main/java/np/com/santoshniroula/hackthenews/topstories/detail/TopStoryDetailPage.kt - Detail state
hackthenews/app/src/main/java/np/com/santoshniroula/hackthenews/topstories/detail/TopStoryDetailViewModel.kt - Comments repository
hackthenews/app/src/main/java/np/com/santoshniroula/hackthenews/topstories/detail/data/TopStoryDetailRepositoryImpl.kt - Comments contract
hackthenews/app/src/main/java/np/com/santoshniroula/hackthenews/topstories/detail/repository/TopStoryDetailRepository.kt - HTML parser
hackthenews/app/src/main/java/np/com/santoshniroula/hackthenews/topstories/detail/data/Parser.kt
Go service
- HTTP server
hack-the-news-go/main.go - Route handlers
hack-the-news-go/routers/utils.go - Cache utilities
hack-the-news-go/cache/utils.go - Item schema
hack-the-news-go/api/item.go
Hacker News services
- Hacker News API
- Hacker News site
Other components
- Reader
Connections 8
- Reader → Reader: uses
- Reader → Navigation: starts
- Stories repository → API client: fetches through
- API client → Hacker News API: requests items
- API client → Hacker News API: requests story IDs
- Comments repository → HTML parser: parses comments
- HTML parser → Hacker News site: fetches HTML
- HTTP server → Route handlers: dispatches routes