Coffee brew logging application built on ATProto.
Development is on Tangled, and is mirrored to GitHub:
With Nix (builds the SPA and Go binary):
nix runWith Go directly (requires Node.js and pnpm for the SPA build):
pnpm install
./scripts/build-spa.sh
go run ./cmd/arabicaAccess at http://127.0.0.1:18910
--known-dids <file>- Path to file with DIDs to backfill on startup (one per line)
App-scoped variables accept an ARABICA_-prefixed form (e.g. ARABICA_PORT) or
an unprefixed form (e.g. PORT); the prefixed form wins when both are set.
ARABICA_PORT/PORT- Server port (default: 18910)ARABICA_BIND_ADDR/BIND_ADDR- Bind address (default: 0.0.0.0)ARABICA_PUBLIC_URL/SERVER_PUBLIC_URL- Public URL for reverse proxy deployments (e.g., https://arabica.example.com)ARABICA_DATA_DIR- Directory for the SQLite database (feed index, OAuth sessions, moderation state). Defaults to$XDG_DATA_HOME/arabica, then~/.local/share/arabica.ARABICA_PROFILE_CACHE_TTL- Profile cache duration (default: 1h)ARABICA_METRICS_PORT/METRICS_PORT- Prometheus metrics port, bound to127.0.0.1(default: 9101); see AI monitoring and alertsARABICA_MODERATORS_CONFIG- Path to the moderator roles JSON fileARABICA_OAUTH_CLIENT_ID/OAUTH_CLIENT_ID- OAuth client ID (optional, uses loopback mode if not set)ARABICA_OAUTH_REDIRECT_URI/OAUTH_REDIRECT_URI- OAuth redirect URI (optional)ARABICA_DEV- Enable dev mode: re-read CSS and the SPA build from disk on each request, and unlock dev-only signup providersARABICA_ALLOW_PRIVATE_NETWORKS- Disables the dial-time private-address guard on public AT Protocol fetches (loopback, RFC1918, link-local, CGNAT, 6to4/Teredo/NAT64, cloud metadata). For local development and the integration suite only; never enable on an Internet-facing deployment. Note that public fetches always dial directly and therefore ignoreHTTP_PROXY/HTTPS_PROXY, so the guard cannot be evaded by a proxy resolving the origin.SECURE_COOKIES- Set to true for HTTPS (default: false)LOG_LEVEL- Logging level: debug, info, warn, error (default: info)LOG_FORMAT- Log format: console, json (default: console)OTEL_EXPORTER_OTLP_ENDPOINT- OTLP HTTP endpoint for tracing (default:localhost:4318)
- Go 1.26+
- Node.js 22.17+ and pnpm (version
pinned in
package.json) - just (optional but recommended); run helpers
in
justfile - inotify-tools for the SPA
watch workflows (
just run-spa-dev,just spa-watch)
pnpm installto install the SPA workspace dependencies.- Create
roles.jsonwith moderator roles. Env var:ARABICA_MODERATORS_CONFIG=roles.json - (Optional) Create
known-dids.txtwith one DID per line. Flag:--known-dids known-dids.txt
The SvelteKit SPA builds into internal/web/spa/build and is embedded into the
Go binary, so web/ changes require a rebuild before the server serves them.
The CSS bundle, by contrast, is assembled in-process at server startup.
With Nix:
nix develop
just runWithout Nix, run helpers in justfile:
just run # build the SPA, then run the Go server (debug logging, dev mode, moderator config)
just run-spa-dev # Go backend + SPA rebuild watcher, live-rebuilds on web/ changes
just spa-dev # Vite HMR dev server (proxies APIs to a Go backend on :18910)
just herdr-spa-dev # launch the backend and SPA watcher as panes in a Herdr workspacejust run-spa-dev is the usual local workflow once inotifywait is available:
edit a Svelte file, refresh the browser, and the server picks up the rebuilt
assets. just spa-dev gives full Vite HMR but does not render Go's injected
document head, so pair it with a running server for API and OAuth routes.
For temporary HTTPS development at https://europa.tailaf2ec2.ts.net, use
just herdr-spa-dev-tailnet. It keeps the backend on 127.0.0.1:18910, enables
secure cookies, and sets the public URL and OAuth callback to that HTTPS origin.
It does not enable or change Tailscale Serve/Funnel. Like herdr-spa-dev, it
accepts workspace=true and uses herdr-spa-dev-stop to close a dedicated
workspace.
With tailnet-only Serve, the OAuth server cannot fetch metadata from this
origin. Host the JSON from /.well-known/oauth-client-metadata.json at a public
HTTPS URL and pass that URL as the second argument:
just herdr-spa-dev-tailnet false https://public.example/arabica-client.jsonWithout that argument, the client ID uses the Europa origin, which requires public access to its metadata endpoint for OAuth to work.
just test # build the SPA and run Go tests with coverage
just integration-test # build the SPA and run integration tests
cd web && pnpm run check # Svelte/TypeScript type checking
cd web && pnpm run test # Vitest component tests
just e2e # build and run Playwright specs against an e2e server
just ci-check # full local CI checkpoint
just format # prettier + gofmtBuild and run without Nix using Docker:
docker compose --file deploy/compose.yaml up --build --detachThe Nix flake also provides a container image archive. See container builds, smoke tests, and runtime configuration.
When deploying behind a reverse proxy (nginx, Caddy, Cloudflare Tunnel, etc.),
set the SERVER_PUBLIC_URL environment variable to your public-facing URL:
# Example with nginx reverse proxy
SERVER_PUBLIC_URL=https://arabica.example.com
SECURE_COOKIES=true
PORT=18910
# The server listens on 127.0.0.1:18910
# But OAuth callbacks use https://arabica.example.com/oauth/callbackThe SERVER_PUBLIC_URL is used for OAuth client metadata and callback URLs,
ensuring the AT Protocol OAuth flow works correctly when the server is accessed
via a different URL than it's running on.
Copyright (C) 2026 Patrick Dewey
Arabica is licensed under AGPL-3.0-only, except for the lexicon
definitions in lexicons/. Arabica's definitions in lexicons/social/arabica/
are licensed under MIT. Bundled AT Protocol
definitions retain their upstream licensing; see lexicons/README.md.
Arabica -- a coffee brew tracking application built on AT Protocol.