TimeTree is a private, self-hostable work ledger organized as a nested tree. It supports manual time entries, concurrent persistent timers, inherited hourly rates, historical value, completion, search, and day or month filtering.
The MVP is intentionally configured for one allowed Google account per deployment. It is open source under the MIT License.
- Node.js 22 or newer
- Corepack and pnpm
- PostgreSQL 15 or newer
- Google OAuth credentials
-
Install dependencies:
corepack pnpm install
-
Copy
.env.exampleto.envand supply local values:DATABASE_URL: pooled PostgreSQL connection used by the applicationDATABASE_URL_UNPOOLED: optional direct connection used by migrationsBETTER_AUTH_SECRET: random secret containing at least 32 charactersBETTER_AUTH_URL: public application origin, such ashttp://localhost:3000GOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRET: Google OAuth credentialsALLOWED_EMAIL: the one verified Google account allowed to sign inNEXT_ALLOWED_DEV_ORIGINS: optional comma-separated development origins
Local environment files are ignored by Git. Do not commit credentials.
-
Configure the Google OAuth client with this callback URL:
<BETTER_AUTH_URL>/api/auth/callback/google -
Apply the committed migrations:
corepack pnpm db:migrate
-
Start the development server:
corepack pnpm dev
Run the checks individually:
corepack pnpm lint
corepack pnpm typecheck
corepack pnpm test
corepack pnpm test:integration
corepack pnpm build
corepack pnpm test:e2eIntegration and browser tests require a migrated PostgreSQL database through
the required DATABASE_URL. DATABASE_URL_UNPOOLED may additionally provide a
direct connection for database tooling and test setup. Integration tests
refuse to start unless every configured database URL targets a loopback host or
local socket, so point both variables at a local database before running them.
The Playwright
configuration uses synthetic authentication values and writes only synthetic
test records, which it removes after each workflow.
Install the browser used by Playwright when needed:
corepack pnpm exec playwright install chromiumA scoped agent bearer key can read direct historical durations for its current
subtree without changing the existing /api/agent/v1/tree response:
GET /api/agent/v1/report?from=2026-09-01&to=2026-10-01
Authorization: Bearer <scoped-key>from is inclusive and to is exclusive. The response groups entries by node,
their stored workDate, and the hourlyRateCents snapshotted on each entry
(null means unpriced), and reports each node's current completed state. Rows
are ordered by date, node identifier, then rate with unpriced rows last.
Completed nodes are included; active timers, descendant rollups, names, money,
and notes are excluded. A snapshotted rate may have been inherited from a node
outside the key's scope, so any key that can read the report can learn that
rate.
Schema changes belong in src/db/schema.ts and must be delivered as reviewed,
committed SQL migrations:
corepack pnpm db:generate
corepack pnpm db:check
corepack pnpm db:migratePrefer a direct DATABASE_URL_UNPOOLED connection for migration commands.
Review generated SQL before applying it, back up important data, and keep each
migration compatible with the application version running during deployment.
Deploy the standard Next.js Node.js application to a host with PostgreSQL
connectivity. Configure the same environment names documented above in the
hosting platform, set BETTER_AUTH_URL to the canonical HTTPS origin, and add
that origin's Google callback URL to the OAuth client.
Apply committed migrations deliberately before deploying code that requires
them. Keep secrets in the hosting platform rather than repository files.
Because TimeTree currently supports one account per deployment, changing
ALLOWED_EMAIL immediately revokes retained access for the previous account.