No description
Find a file
Jon Seager 76445f49ae
fix: improve admin page forms for mobile
Stack passkey and token input forms vertically on mobile with full-width
fields and buttons. Collapse Delete/Revoke buttons to icon-only squares
on mobile, expanding to show text labels on larger screens.
2026-02-11 08:59:52 +00:00
.cargo perf(build): add release profile, lld linker, and defer script tags 2026-02-06 18:05:16 +00:00
.github ci: add e2e browser test job to GitHub Actions 2026-02-10 10:45:12 +00:00
migrations feat: add entity image support with display on detail pages 2026-02-10 17:50:13 +00:00
scripts build: add treefmt and pre-commit 2026-02-09 11:35:21 +00:00
src feat: add remaining amount field to bag edit form 2026-02-11 08:53:56 +00:00
static fix: polish edit forms and detail pages 2026-02-10 19:43:03 +00:00
templates fix: improve admin page forms for mobile 2026-02-11 08:59:52 +00:00
tests refactor: deduplicate update handlers and edit templates 2026-02-10 20:04:24 +00:00
.gitignore build: add treefmt and pre-commit 2026-02-09 11:35:21 +00:00
build.rs fix(build): pass git hash to Nix builds via env var 2026-02-07 11:17:03 +00:00
Cargo.lock feat: add entity image support with display on detail pages 2026-02-10 17:50:13 +00:00
Cargo.toml feat: add entity image support with display on detail pages 2026-02-10 17:50:13 +00:00
CLAUDE.md docs: trim CLAUDE.md from 972 to ~250 lines 2026-02-09 16:43:19 +00:00
flake.lock build: add treefmt and pre-commit 2026-02-09 11:35:21 +00:00
flake.nix feat(test): add e2e test infrastructure with thirtyfour 2026-02-10 10:44:36 +00:00
fly.toml feat: add /health endpoint for Fly.io health checks 2026-02-08 15:37:35 +00:00
LICENSE docs: add LICENSE 2026-02-03 20:53:45 +00:00
README.md docs: add cover image to README 2026-02-09 17:47:29 +00:00

cover image

B{rew}log is a self-hosted specialty coffee logging platform optimised for filter brewing enthusiasts. B{rew}log can be used for tracking roasters, roasts, brews, cafes and brewing gear.

B{rew}log features an LLM-powered "Bag Scanning" feature, which enables it to automatically fill roaster and coffee information using a photo of a bag. It also supports "check-ins" to log coffee enjoyed in a cafe.

B{rew}log ships as a single Rust binary that serves a web UI, a REST API, and a CLI client. The application uses SQLite as a backend, and will automatically create and migrate the database on start-up.

Quick Start (Demo)

Before you start, you'll need to sign up for Openrouter and Foursquare Places and get API keys for both.

Then create a docker.env file:

# You'll need an API key from OpenRouter
BREWLOG_OPENROUTER_API_KEY=sk-or-...
# I've had good results with Gemini models, but you can try 'openrouter/free' to experiment
BREWLOG_OPENROUTER_MODEL=google/gemini-3-flash-preview
# FourSquare Places API key for location searching
BREWLOG_FOURSQUARE_API_KEY=fsq3...

You can see the full list of configuration options below. Once your .env file is complete, start the container using the environment file

# Create a data directory to store the database
mkdir data
# Run the container
docker run \
  --rm \
  -p 3000 \
  --env-file docker.env \
  -v $PWD/data:/data \
  ghcr.io/jnsgruk/brewlog:latest

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 an account and signs in automatically.

Install from Git

To build and install from source, you'll need a working Rust toolchain:

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

Then create a .env file containing at least your OpenRouter and Foursquare API keys, and start the server:

brewlog serve

CLI Authentication

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

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

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

# 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 (server domain) localhost
BREWLOG_RP_ORIGIN WebAuthn Relying Party origin (full URL) http://localhost:3000
BREWLOG_DATABASE_URL Database connection string sqlite://brewlog.db
BREWLOG_BIND_ADDRESS Server bind address 127.0.0.1:3000
BREWLOG_INSECURE_COOKIES Disable the Secure cookie flag (auto-enabled for localhost defaults) 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

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