A native Swift/SwiftUI Hacker News client inspired by Harmonic for Android.
Built with SwiftUI, Core Data, and zero third-party dependencies.
screenshots
- Best, New, Ask, Show, Jobs feeds
- Time filter β 24h / 48h / Week / Month / All
- In-app WebView with progress bar, back/forward navigation, share
- Bookmarks β save stories, export as text
- Comments β full threaded view with collapse/expand
- User profiles β karma, bio, submissions
- Search β powered by Algolia full-text search
- Submit β post stories to HN
- Offline caching β Core Data cache with smart expiry
- 7 themes including 3 animated Liquid UI themes
harmonica-hn/
βββ Models/ Pure Swift structs (API models)
βββ CoreData/ Core Data stack + entity extensions
βββ Repository/ Cache-first data layer
βββ Services/ Network layer (HN Firebase + Algolia)
βββ ViewModels/ @Observable state management
βββ Views/ SwiftUI views
βββ Theme/ Theme definitions + liquid animations
βββ Utilities/ HTML parser, date formatter, extensions
View β ViewModel β Repository β Cache (Core Data)
β (if stale/empty)
β Service (Network)
β Cache (save)
β ViewModel β View
https://hacker-news.firebaseio.com/v0/
/beststories.jsonβ Best story IDs/newstories.jsonβ New story IDs/askstories.jsonβ Ask HN IDs/showstories.jsonβ Show HN IDs/jobstories.jsonβ Jobs IDs/item/{id}.jsonβ Story or comment detail/user/{id}.jsonβ User profile
https://hn.algolia.com/api/v1/
/search?tags=front_pageβ Front page stories/search_by_date?query=...β Full text search/items/{id}β Story with full comment tree/search_by_date?tags=author_{username}β User submissions
| Data | Duration |
|---|---|
| Best stories | 10 min |
| New stories | 5 min |
| Ask / Show / Jobs | 15 min |
| Comments | 5 min |
| User profiles | 30 min |
- Xcode 15+
- iOS 17+ / macOS 14+
- Swift 5.9+
- No third-party dependencies
- Clone the repo
- Open
harmonica-hn.xcodeprojin Xcode - Select your target device (iPhone simulator or My Mac)
- Press
Cmd+Rto run
No API keys required β both HN Firebase and Algolia APIs
The app uses SwiftUI Multiplatform β macOS support is built in from day one.
Select My Mac in the Xcode device picker and press Run.
All platform-specific code is wrapped in #if os(iOS) / #if os(macOS) blocks so both targets compile cleanly.
- HN login + voting
- Push notifications for replies
- iCloud sync for bookmarks
- iPad optimised split view
- Home screen widget β top story of the day
- Filter stories by keyword / domain
- Comment navigation buttons (jump between top-level)
- Font size settings
- Reader mode in WebView
- Original Harmonic Android app by Simon Halvdansson
- HN Firebase API
- Algolia HN Search API