Synaplan
Open-source AI platform for companies: self-hosted AI agents, GDPR-compliant chatbot widget, RAG knowledge base, WhatsApp and Outlook AI, MCP, multi-model routing. Docker, Kubernetes or hosted in Germ
翻訳待ち
No updates detected yet. GitHub releases will appear here.
Loading the full README. The saved excerpt is shown below.
Stack: Next.js 16 (App Router, TypeScript) · Prisma 6 · Supabase (Postgres + Storage) · LINE LIFF + Messaging API · Tailwind CSS 4 · Noto Sans Thai สถานะ: MVP เสร็จสมบูรณ์ — auth, master data CRUD, request lifecycle (create/approve/reject/fulfill/cancel), stock ledger, adjustments, dashboard, audit log, LINE Flex notifications, attachment uploadRead the full README ↗
ระบบจัดการการเบิก-คืน-ซ่อม-ตัดจำหน่ายพาเลทหมุนเวียนในโรงงาน
Stack: Next.js 16 (App Router, TypeScript) · Prisma 6 · Supabase (Postgres) · Tailwind CSS 4 · Resend (Email) · Noto Sans Thai
| URL | ผู้ใช้ |
|---|---|
/ | หน้าแรก (เลือกพอร์ทัล) |
/app | พนักงาน — สร้างคำขอ, ดูสถานะ, อนุมัติ |
/manage | Admin / Pallet Manager — Dashboard, จัดการข้อมูล, รายงาน |
/auth/login | เข้าสู่ระบบ (ใช้ได้ทั้ง 2 ฝั่ง) |
/auth/register | สมัครใช้งาน (public) |
/auth/forgot-password | ลืมรหัสผ่าน |
/auth/reset-password | รีเซ็ตรหัสผ่าน |
npm install
.env.localcp .env.example .env.local
เปิด .env.local แล้วกรอกค่าจริง:
# Supabase → Settings → Database → Connection string
# ใช้ Transaction pooler (port 6543) สำหรับ runtime
DATABASE_URL=postgresql://postgres.<ref>:<pass>@aws-0-ap-southeast-1.pooler.supabase.com:6543/postgres?pgbouncer=true&connection_limit=1
# ใช้ Direct connection (port 5432) สำหรับ prisma migrate เท่านั้น
DIRECT_URL=postgresql://postgres.<ref>:<pass>@aws-0-ap-southeast-1.pooler.supabase.com:5432/postgres
# Supabase → Settings → API
SUPABASE_URL=https://<ref>.supabase.co
SUPABASE_ANON_KEY=<anon-key>
SUPABASE_SERVICE_ROLE_KEY=<service-role-key>
# App
APP_URL=http://localhost:3000
# สร้าง SESSION_SECRET ด้วย PowerShell:
# [Convert]::ToBase64String((1..32 | % { Get-Random -Max 256 }))
SESSION_SECRET=<random-32-char-secret>
# Email — ถ้ายังไม่พร้อมใส่ dummy ไปก่อน ระบบยังทำงานได้
RESEND_API_KEY=re_dummy
[email protected]
# Cron — ใช้ random string ใดก็ได้ (ใน local ไม่ถูกเรียก)
CRON_SECRET=any-local-secret
หมายเหตุ: Prisma CLI อ่าน
.envไม่ใช่.env.local— ต้องรันผ่านnpm run db:*เสมอ อย่ารันnpx prismaตรงๆ
# สร้าง Prisma Client
npm run db:generate
# Apply migration สร้างตาราง
npm run db:migrate:deploy
# ใส่ข้อมูลตัวอย่าง (แผนก, ประเภทพาเลท, user ทดสอบ, ยอดสต็อกเริ่มต้น)
npm run db:seed
ข้อมูล seed ที่ได้:
| ชื่อ | Role | สถานะ | |
|---|---|---|---|
[email protected] | Admin | ADMIN | ACTIVE |
[email protected] | หัวหน้าคลังพาเลท ทดสอบ | PALLET_MANAGER | ACTIVE |
[email protected] | พนักงานพัสดุ ทดสอบ | REQUESTER | ACTIVE |
[email protected] | พนักงานผลิต ทดสอบ | REQUESTER | ACTIVE |
[email protected] | พนักงานจ่ายสินค้า ทดสอบ | REQUESTER | ACTIVE |
Seed users ยังไม่มีรหัสผ่าน ใช้ dev-login (dev เท่านั้น) หรือรันคำสั่งด้านล่างเพื่อตั้งรหัสผ่าน
# รูปแบบ: npm run create-admin -- <email> <password> [ชื่อเต็ม]
npm run create-admin -- [email protected] MyPassword123 "ผู้ดูแลระบบ"
npm run dev
เปิด browser:
http://localhost:3000 — หน้าแรกhttp://localhost:3000/auth/login → เข้าสู่ระบบด้วย admin / MyPassword123http://localhost:3000/auth/register → สมัครใช้งาน (public)http://localhost:3000/app → พอร์ทัลพนักงานgit init
git add .
git commit -m "feat: initial pallet system"
git remote add origin https://github.com/<username>/<repo>.git
git push -u origin main
ตรวจสอบว่า
.gitignoreมี.env.local(มีอยู่แล้วใน default Next.js gitignore)
pallet-system (ถ้า repo มี folder นี้)prisma generate && next build)Settings → Environment Variables → ใส่ค่าทั้งหมด (เปลี่ยนจาก local เฉพาะที่ระบุ):
| Key | ค่าสำหรับ Production |
|---|---|
DATABASE_URL | pooled connection (port 6543) ของ Supabase project |
DIRECT_URL | direct connection (port 5432) |
SUPABASE_URL | เหมือน local |
SUPABASE_ANON_KEY | เหมือน local |
SUPABASE_SERVICE_ROLE_KEY | เหมือน local |
APP_URL | https://your-app.vercel.app |
SESSION_SECRET | random ใหม่ (ไม่ซ้ำกับ local) |
RESEND_API_KEY | API key จาก resend.com |
RESEND_FROM | อีเมลที่ verify domain แล้ว เช่น [email protected] |
CRON_SECRET | random ใหม่ สำหรับ cron job |
กด Deploy รอ build เสร็จ (~3 นาที)
รันจากเครื่อง local โดยชี้ไปที่ Production DB:
This is the beginning of the README. Read the rest at the original. Read the full README ↗