Skip to content

Prerequisites

Before you can run Tina Diet locally or contribute to the codebase, you need a few accounts and tools set up.

Local tools

ToolVersionWhy
Node.js^22.0.0All projects target Node 22 (Cloudflare Workers requires it for wrangler 4)
npmbundled with NodeOr pnpm/yarn — pick one and be consistent
Gitany recentClone, branch, commit
curl or HTTPieanyAPI testing
VS Codeany recentRecommended editor with these extensions: ESLint, Tailwind CSS IntelliSense, MDX
cloudflaredany recentPublic tunnel for LINE webhook → local backend during dev

On Windows, install Node via nvm-windows to easily switch between Node 22 (this project) and other versions.

Cloud accounts

You don’t need ALL of these for read-only exploration of the codebase, but each is required for a corresponding part of the system.

Required for local dev (without payments)

  • GitHub — clone the repo (github.com/einsze/tinadiet)
  • LINE Developers (developers.line.biz)
    • Messaging API channel for the bot (LINE_CHANNEL_*)
    • LIFF channel for the embedded app (LIFF_ID, LINE_LOGIN_CHANNEL_ID)
    • During dev you can use a personal test bot; production uses the live @913civqx channel.
  • OpenAI (platform.openai.com)
    • Project key with budget cap ($35/month for prod; even $5 for dev is fine)

Required for payments testing

  • Omise (dashboard.omise.co)
    • TEST mode credentials — sign up is free, no business verification needed
    • For LIVE you need Thai business documents (ภพ.20, DBD registration, bank statement, director ID); see Payments overview.

Required for deploy

  • Railway (railway.app) — backend hosting, $5/month Hobby plan, Singapore region
  • Cloudflare (dash.cloudflare.com) — Workers (LIFF), Pages (docs), DNS, Registrar for tinadiet.com

Once your accounts are in place:

  1. Local setup — clone + install + run dev servers
  2. Architecture overview — understand the system you’re touching
  3. Backend stack — repos, services, routes
  4. LIFF stack — frontend structure

Secret handling

All secrets live in environment variables, never in code. There’s a file c:\Users\carvi\AIchatbot\SECRETS_TINADIET_LOCAL.md on the maintainer’s machine outside any git repo with the actual values — this is a personal copy; for contributors, you’ll need to provision your own test credentials or be granted access.

Never commit .env files. Both projects/backend/.gitignore and projects/liff/.gitignore exclude them; GitHub Push Protection is also enabled to reject commits containing detected secrets.

See Secrets rotation for ongoing hygiene.