VVakatime

Self-Hosting

Run the Vakatime dashboard on Cloudflare Workers with your own Postgres.

The dashboard is a TanStack Start app deployed to Cloudflare Workers, backed by a regular PostgreSQL database.

1. Database

Any PostgreSQL 17+ works — Neon, RDS, or a container. The app connects over TCP with postgres.js and Cloudflare Hyperdrive pooling.

docker run -d --name vakatime-postgres \
  -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=mydb \
  -p 15432:5432 postgres:17.5

2. Environment

Create .env.local (dev) and configure the equivalent variables in Wrangler (prod):

VariablePurpose
DATABASE_URLPostgreSQL connection string
BETTER_AUTH_URLPublic base URL of the dashboard
BETTER_AUTH_SECRETAuth session secret (npx -y @better-auth/cli secret)
GITHUB_CLIENT_ID / GITHUB_CLIENT_SECRETGitHub OAuth app — the only sign-in method. Create at github.com/settings/developers with callback {BETTER_AUTH_URL}/api/auth/callback/github
VITE_SENTRY_DSNoptional — Sentry error reporting

3. Schema

pnpm install
pnpm db:push        # or: pnpm db:migrate for staged migrations

4. Develop

pnpm dev            # http://localhost:3000 — runs in workerd via the CF vite plugin

5. Deploy

pnpm deploy         # vite build + wrangler deploy

Bind a Hyperdrive instance to your Worker and point it at the same DATABASE_URL; the Worker never connects to Postgres directly.

Publishing the CLI

The collector CLI (@esyion/vakatime) is published from the separate public repo esyion/vakatime-cli. Push a v*.*.* tag there and GitHub Actions publishes both @esyion/vakatime-core and @esyion/vakatime with provenance.

On this page