Tallyflare

Enter a search term.

Configuration

Configuration lives in wrangler.jsonc and the scripts in package.json. Most deployments do not need code changes.

Wrangler configuration

The commonly used fields in wrangler.jsonc are:

FieldPurpose
nameWorker name
mainWorker entry point
compatibility_dateWorkers runtime compatibility date
assets.directoryBuilt deployment directory, dist
assets.bindingStatic assets binding, ASSETS
assets.run_worker_firstSends /counters/* and /badges/* to the Worker first
d1_databases[].bindingD1 SQLite binding name, DB

D1 SQLite binding

The counter Worker needs a D1 SQLite binding named DB. For local development, Wrangler manages the database under .wrangler/state.

When using the Deploy to Cloudflare button or Wrangler 4.45+ automatic provisioning, database_id can be left blank. It is only required when binding an existing D1 SQLite database.

Common scripts

ScriptPurpose
bun run devBuild, apply local migrations, and start Miniflare
bun run buildGenerate themes and build the documentation
bun run deployApply remote migrations and deploy
bun run releaseBuild, apply remote migrations, and deploy
bun run db:migrate:localApply local D1 SQLite migrations
bun run db:migrate:remoteApply remote D1 SQLite migrations
bun run migrate:kvExport old KV data or generate migration SQL
bun run checkFormat, lint, type-check, test, build, smoke, and dry-run
bun run smokeStart a local Worker and run HTTP smoke tests

Runtime settings

The local launcher reads PORT. Production does not need it.

The default deployment requires no secrets. Visitor deduplication uses the CF-Connecting-IP header provided by Cloudflare.

Theme data is generated into dist/themes and served through the ASSETS binding. After changing images in themes/, run bun run themes:build again.