Bilingual WorkspaceBilingual Workspace

ภาพรวมระบบWorkspace Overview

ระบบจะเปลี่ยนหัวข้อด้านบนตามหน้าปัจจุบันและหัวข้อเมนูที่กำลังใช้งานThe top bar updates itself from the current route and active navigation topic.

Deploy

GitHub to Cloudflare

หน้าเว็บใช้ Cloudflare Pages auto deploy จาก GitHub ส่วน backend ใช้ GitHub Actions เรียก wrangler deploy ทุกครั้งที่ push เข้า mainThe frontend uses Cloudflare Pages auto-deploy from GitHub, while the backend uses GitHub Actions to run wrangler deploy on every push to main.

  1. Push repo นี้ขึ้น GitHubPush this repository to GitHub.
  2. Connect GitHub repo กับ Cloudflare Pages โดยตั้ง root เป็น webConnect the repo to Cloudflare Pages and set the root directory to web.
  3. ผูก custom domain ของ Pages เป็น rinbooks.comAttach the custom domain rinbooks.com to the Pages project.
  4. ตั้ง build command เป็น npm run build และ output directory เป็น outSet the build command to npm run build and the output directory to out.
  5. เตรียม Postgres และสร้าง R2 bucketPrepare Postgres and create an R2 bucket.
  6. เพิ่ม Cloudflare Worker secrets สำหรับ connection string ทั้ง read และ writeAdd Cloudflare Worker secrets for read and write connection strings.
  7. ให้ DNS ของ rinbooks.com ชี้เข้า Cloudflare PagesPoint rinbooks.com DNS to Cloudflare Pages.
  8. เพิ่ม GitHub secrets: CLOUDFLARE_API_TOKEN และ CLOUDFLARE_ACCOUNT_IDAdd the GitHub secrets CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID.
  9. Push เข้า branch main เพื่อให้ GitHub Action deploy Worker อัตโนมัติPush to main so GitHub Actions can deploy the Worker automatically.