Skip to content

athola/the-daily-update

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Daily Update

Built with Ratatui Rust License: MIT

A terminal-based daily news aggregator that displays news headlines alongside weather and stock market data. Built with Rust for performance and reliability.

Features

  • Instant startup with cached data from previous sessions
  • Background refresh fetches fresh data asynchronously on startup
  • News headlines from NewsAPI with source and relative timestamps
  • Stock watchlist with customizable symbols via modal browser
  • Weather widget (collapsible) with temperature, conditions, and alerts
  • Offline capable - shows cached data when network unavailable
  • Graceful degradation - each panel handles errors independently

Installation

Prerequisites

  • Rust 1.70+ (install via rustup)
  • API keys from:

Build from Source

git clone https://github.com/yourusername/the-daily-update.git
cd the-daily-update
cargo build --release

The binary will be at target/release/daily-update.

Configuration

API Keys (Required)

Set your API keys via environment variables (recommended):

export NEWS_API_KEY="your-newsapi-key"
export WEATHER_API_KEY="your-openweathermap-key"
export TIINGO_API_KEY="your-tiingo-key"

Add these to your shell profile (~/.bashrc, ~/.zshrc, etc.) for persistence.

First Run

On first launch, the app will:

  1. Check for API keys in environment variables
  2. Prompt for any missing keys
  3. Ask for your default location (for weather)
  4. Display security best practices

Config File

Preferences are stored in ~/.config/daily-update/config.toml:

[general]
default_location = "New York, NY"
vim_mode = false

[ui]
theme = "dark"

Data Storage

  • Database: ~/.local/share/daily-update/data.db
  • Config: ~/.config/daily-update/config.toml

Usage

./target/release/daily-update

Or after adding to PATH:

daily-update

Keybindings

Navigation

Key Action
Up/Down Navigate within panel
Tab Switch to next panel
Shift+Tab Switch to previous panel

Actions

Key Action
r Refresh all data
w Toggle weather widget expand/collapse
s Open stock browser modal
? Show help overlay
q Quit application

Stock Browser Modal

Key Action
Up/Down Navigate stocks
Space Toggle stock in watchlist
Enter Save changes
Esc Cancel without saving
Type Filter stocks by symbol

Vim Mode (Optional)

Enable in config with vim_mode = true:

Key Action
j/k Navigate within panel
h/l Switch panels
g Go to top
G Go to bottom

Architecture

the-daily-update/
├── crates/
│   ├── daily-update/   # Main binary
│   ├── app/            # Application state
│   ├── ui/             # TUI components (ratatui)
│   ├── data/           # Models, SQLite database, cache
│   ├── api/            # API clients (news, weather, stocks)
│   ├── config/         # Configuration and setup wizard
│   └── fetch/          # Background data fetcher
└── docs/plans/         # Design documents

The project uses a Cargo workspace for modular compilation. Each crate compiles independently, reducing rebuild times during development.

Development

Prerequisites

  • Rust 1.70+
  • (Optional) pre-commit for automated checks

Makefile Targets

Run make help to see all available targets:

make fmt          # Format code
make lint         # Run clippy with strict warnings
make test         # Run all tests (unit and integration)
make test-unit    # Run unit tests only
make build        # Build in debug mode
make release      # Build in release mode
make run          # Run the application
make precommit    # Run lint and test (CI validation)

Running Tests

Unit tests cover each crate's internal logic:

make test-unit

Integration tests verify cross-crate workflows:

make test-integration

Run both with:

make test

Pre-commit Hooks

Install pre-commit hooks to run validation before each commit:

pre-commit install

The hooks run rustfmt, clippy, and tests automatically.

License

MIT

About

Terminal-based daily news aggregator with weather and stock data

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors