Because Timify stores all data in a local SQLite file, self-hosting is intentionally straightforward — there is no managed database to provision and no external service to authenticate against. The sections below cover everything you need to take Timify from a development checkout to a production deployment.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Aking16/timify/llms.txt
Use this file to discover all available pages before exploring further.
Environment Variables
The following environment variables are required in every production environment. Set them in your hosting platform’s secrets manager, a.env.production file (not committed to version control), or directly in your process environment.
| Variable | Required | Description |
|---|---|---|
DB_FILE_NAME | ✅ | Path to the SQLite file, e.g. file:/data/timify.db |
BETTER_AUTH_SECRET | ✅ | Long random string used to sign session tokens |
BETTER_AUTH_URL | ✅ | Full public URL of your deployment, e.g. https://timify.example.com |
Building and Starting the App
Next.js compiles, optimises, and bundles the application into the
.next directory. The React Compiler (reactCompiler: true) and component caching (cacheComponents: true) are both active during the build, so no extra flags are needed.SQLite File Persistence
Timify’s entire state lives in a single SQLite file. The path is controlled by theDB_FILE_NAME environment variable (default: file:./src/db/local.db).
Applying the Database Schema in Production
Before starting the app for the first time (and after any schema change), apply the Drizzle schema to your SQLite file.- Direct push (recommended for SQLite)
- Migration files
src/db/schema.ts and creates or alters tables in-place. It is idempotent and safe to re-run.Authentication Configuration
Secure cookies
TheuseSecureCookies flag in src/lib/auth.ts is currently set to false for local development over plain HTTP. In production you must serve Timify over HTTPS and set this to true to ensure session cookies carry the Secure attribute.
src/lib/auth.ts (production change required)
Trusted origins
ThetrustedOrigins array in src/lib/auth.ts controls which origins better-auth will accept requests from. You must add your production domain to this list, otherwise authentication requests from your public URL will be rejected.
src/lib/auth.ts
BETTER_AUTH_URL is automatically included in trustedOrigins at runtime via process.env.BETTER_AUTH_URL, so setting the environment variable correctly is sufficient — you only need to hard-code additional origins (e.g. a secondary domain or a local network address) if required.Deploying to Vercel
Timify was bootstrapped withcreate-next-app and targets Vercel’s build pipeline out of the box. You can deploy directly from the repository:
- Import the repository in the Vercel dashboard.
- Add the three required environment variables (
DB_FILE_NAME,BETTER_AUTH_SECRET,BETTER_AUTH_URL) under Project → Settings → Environment Variables. - Vercel will run
npm run buildautomatically on every push.
Production Checklist
Pre-launch checklist
Pre-launch checklist
-
BETTER_AUTH_SECRETis a fresh, strong random string -
BETTER_AUTH_URLis set to your full production URL (includinghttps://) -
useSecureCookiesis set totrueinsrc/lib/auth.ts - Your production domain is present in
trustedOrigins - The SQLite file is on a persistent volume or persistent storage
-
npx drizzle-kit pushhas been run against the production database - A TLS certificate is in place and HTTP redirects to HTTPS
- The
.envfile (or secrets) are not committed to version control
