Skip to content

amscotti/hndart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hacker News Explorer

A terminal-based application for browsing Hacker News. Navigate stories, read comments, search, and open links - all from your terminal with keyboard-driven controls.

asciicast

Features

  • Browse multiple feeds: Top, New, Best, Ask HN, and Show HN
  • View story details and navigate nested comment threads
  • Search stories using the Algolia HN Search API
  • Open story URLs in your default browser
  • Vim-style keyboard navigation (hjkl)

Requirements

  • Dart SDK 3.0 or higher

Installation

# Clone the repository
git clone <repository-url>
cd hndart

# Install dependencies
dart pub get

# Run the application
dart run

Usage

Launch the application:

dart run

Keyboard Controls

Story List

Key Action
j / Down Next story
k / Up Previous story
l / Right / Enter View story comments
o Open URL in browser
/ Search
r Reload feed
1-5 Switch feed (Top/New/Best/Ask/Show)
Tab Cycle to next feed
Esc Quit

Story Detail / Comments

Key Action
j / Down Next comment
k / Up Previous comment
l / Right / Enter View replies to selected comment
h / Left Go back
o Open URL in browser
Esc Quit

Search

Key Action
Enter Submit search
Esc Cancel search
j / Down Next result
k / Up Previous result
o Open URL in browser

Project Structure

hndart/
  bin/
    hndart.dart          # Application entry point
  lib/
    src/
      api/
        hn_client.dart   # Hacker News API client
      models/
        story.dart       # Story data model
        comment.dart     # Comment data model
      tui/
        app.dart         # Main application component
        story_list.dart  # Story list view
        story_detail.dart# Story detail and comments view
        feed_selector.dart# Feed tab selector
        search_view.dart # Search interface
  test/
    tui/                 # Component tests

Dependencies

  • nocterm - Terminal UI framework
  • http - HTTP client for API requests

Running Tests

dart test --concurrency=1

The --concurrency=1 flag is required because the terminal UI test framework uses a singleton binding.

API

This application uses two APIs:

  • Hacker News Firebase API (https://hacker-news.firebaseio.com/v0) - Story and comment data
  • Algolia HN Search API (https://hn.algolia.com/api/v1) - Story search

License

MIT

About

Browse Hacker News from your terminal - read stories, navigate comments, and search with keyboard-driven controls

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages