All environment variables across the three projects. Source of truth lives
in each project’s .env.example file; this page mirrors them with
descriptions.
Backend (projects/backend/.env)
App
Var
Default
Description
NODE_ENV
development
Standard Node env
PORT
3000
HTTP listen port
LOG_LEVEL
info
Reserved for future logger config
TZ
Asia/Bangkok
Process timezone (also used in cron)
APP_BASE_URL
http://localhost:3000
Self URL for callbacks (rarely used)
LIFF_URL
https://app.tinadiet.com
LIFF URL for any deep-link generation (rarely used)
Security (REQUIRED)
Var
Description
SESSION_JWT_SECRET
HS256 secret for backend session JWTs. Generate: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))". Rotating invalidates all sessions.
This file is NOT in any git repo by design. It includes LINE keys,
OpenAI key, Omise keys, Stripe (when active), JWT secret, Cloudflare 2FA
recovery codes, etc.
For collaborators, the project owner provisions a similar file with the
appropriate subset of credentials.
Adding a new env var
Decide which project owns it (backend / liff / docs)
Add to that project’s .env.example with comment + sensible default
If backend: add to config/env.ts with type + default
Document on this page under the appropriate section
Set the actual value in production (Railway for backend, Cloudflare
build settings for liff/docs)
Don’t add env vars to multiple projects unless the value is genuinely
shared (e.g. a feature flag affecting both backend and LIFF logic — even
then, separate names).