No description
Find a file
Jon Seager f31f87d4e1
feat(ui): spacious flat desktop tables with accent hover
- Remove bordered card wrapper from table sections on desktop
- Strip thead background, rely on typography for header distinction
- Increase cell vertical padding from 0.75rem to 1rem
- Add white row backgrounds with explicit horizontal borders
- Add accent-tinted hover with left bar indicator
- Float pagination below table as un-bordered footer
- Shrink pagination prev/next to compact card-style buttons
2026-02-06 13:57:27 +00:00
.github chore: update copliot instructions 2025-11-25 21:42:20 +00:00
migrations fix(db): add AUTOINCREMENT to prevent SQLite ROWID reuse 2026-02-06 10:09:13 +00:00
scripts feat(brews): add quick notes 2026-02-05 20:42:03 +00:00
src refactor: update AppState imports to use state module 2026-02-06 13:48:09 +00:00
static feat(ui): spacious flat desktop tables with accent hover 2026-02-06 13:57:27 +00:00
templates feat(ui): spacious flat desktop tables with accent hover 2026-02-06 13:57:27 +00:00
tests refactor(tests): use in-process server and shared AppState factory 2026-02-06 13:48:15 +00:00
.gitignore fix(ui): tone down token-created success banner in dark mode 2026-02-05 21:06:42 +00:00
build.rs fix(build): always regenerate CSS on every cargo build 2026-02-06 12:32:21 +00:00
Cargo.lock refactor(logging): switch to env-based log format with HTTP tracing 2026-02-05 18:13:19 +00:00
Cargo.toml refactor: remove PostgreSQL feature-flagged support 2026-02-06 13:26:41 +00:00
CLAUDE.md refactor: remove PostgreSQL feature-flagged support 2026-02-06 13:26:41 +00:00
flake.lock refactor(nix): migrate flake.nix to flake-parts 2026-02-02 17:39:38 +00:00
flake.nix refactor: move static assets out of templates/ into static/ 2026-02-05 17:47:32 +00:00
LICENSE docs: add LICENSE 2026-02-03 20:53:45 +00:00
README.md refactor: remove PostgreSQL feature-flagged support 2026-02-06 13:26:41 +00:00

B{rew}log

B{rew}log is a self-hosted coffee logging platform for tracking roasters, roasts, brews, cafes and brewing gear. It ships as a single Rust binary that serves a web UI, a REST API, and a CLI client.

  • Web UI with reactive updates via Datastar and Tailwind CSS v4
  • REST API for programmatic access (reads are public, writes require auth)
  • CLI client for terminal-based workflows
  • AI extraction — scan a coffee bag label or type a description to auto-fill forms (via OpenRouter)
  • Nearby cafe search powered by Foursquare Places
  • SQLite database
  • Passkey authentication — no passwords, WebAuthn only

Quick Start

Install

cargo install --git https://github.com/jnsgruk/brewlog.git

Configure

Create a .env file (or export the variables). Four values are required:

BREWLOG_RP_ID="localhost"
BREWLOG_RP_ORIGIN="http://localhost:3000"
BREWLOG_OPENROUTER_API_KEY="sk-or-..."
BREWLOG_FOURSQUARE_API_KEY="fsq3..."

Run

brewlog serve

On first start with an empty database the server prints a one-time registration URL:

No users found. Register the first user at:
  http://localhost:3000/register/abc123...
This link expires in 1 hour.

Open that URL, choose a display name, and register a passkey. This creates your account and signs you in.

CLI Authentication

To use the CLI or API for write operations, create a token via browser handoff:

brewlog token create --name "my-cli-token"
# Browser opens → authenticate with your passkey → token printed once

export BREWLOG_URL="http://localhost:3000"
export BREWLOG_TOKEN="<token from above>"

# Now you can create data from the CLI
brewlog roaster add --name "Radical Roasters" --country "United Kingdom"

Run brewlog --help for the full command reference.

Configuration

All settings are read from environment variables or CLI flags. A .env file in the working directory is loaded automatically via dotenvy.

Server (brewlog serve)

Variable Purpose Default
BREWLOG_RP_ID WebAuthn Relying Party ID (your domain) required
BREWLOG_RP_ORIGIN WebAuthn Relying Party origin (full URL) required
BREWLOG_DATABASE_URL Database connection string sqlite://brewlog.db
BREWLOG_BIND_ADDRESS Server bind address 127.0.0.1:3000
BREWLOG_SECURE_COOKIES Enable the Secure cookie flag (set true for HTTPS) false
RUST_LOG Log level filter info
RUST_LOG_FORMAT Set to json for structured log output

CLI Client

Variable Purpose Default
BREWLOG_URL Server URL http://localhost:3000
BREWLOG_TOKEN API bearer token for write operations

Integrations

Variable Purpose Default
BREWLOG_OPENROUTER_API_KEY OpenRouter API key for AI extraction required
BREWLOG_OPENROUTER_MODEL LLM model for AI extraction openrouter/free
BREWLOG_FOURSQUARE_API_KEY Foursquare Places API key for nearby cafe search required

Database

SQLite is used for storage. Migrations run automatically on server startup.

Contributing

cargo build                           # Build
cargo clippy --allow-dirty --fix      # Lint
cargo fmt                             # Format
cargo test                            # Test

See CLAUDE.md for architecture, code patterns, and development conventions.

License

Apache License 2.0