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