Skip to content

Tina Diet Docs

AI nutrition coach for Thailand, built on LINE LIFF + Express + Cloudflare.

What is this?

Developer documentation for Tina Diet at tinadiet.com. Covers how the system is built, how to set up local development, how to deploy, and how to operate it in production.

End-user help lives inside the LIFF app at app.tinadiet.com/support — this site is for engineering.

Find your way around

Architecture

System diagram, data model, and invariants you must not break. Read →

Local setup

Clone, install, run backend + LIFF locally with cloudflared tunnel. Read →

Backend

Express + better-sqlite3 + LINE SDK + OpenAI + Omise. Lazy stmts pattern. Read →

LIFF

Vite + React + Tailwind + multi-page routing in LINE’s webview. Read →

Payments

Omise PromptPay + TrueMoney manual-renew model, HMAC signature verify. Read →

Operations

DB queries, manual grants, troubleshooting, monitoring. Read →

Project at a glance

  • Brand: Tina Diet — Thai-first nutrition coach with a friendly female persona (ค่ะ register)
  • Surface: LINE chat bot (Messaging API) + LIFF SPA (LINE-embedded React app)
  • Backend: Node 22 / Express / TypeScript ESM / better-sqlite3 on a Railway volume
  • AI: OpenAI gpt-4o (vision) + gpt-4o-mini (text) for food parsing, coaching, consultation
  • Payments: Omise PromptPay + TrueMoney, 150 THB / 30 days, manual renewal
  • Hosting: Railway (backend) · Cloudflare Workers (LIFF) · Cloudflare Pages (these docs)