เว็บที่ให้ร้านค้าและผู้รับเหมาเปิดดูสินค้า ราคา และสต็อกได้เอง ข้อมูลทั้งหมดดึงมาจาก ERP ในออฟฟิศอัตโนมัติ ไม่มีใครต้องมานั่งกรอกซ้ำ
A site where shops and contractors browse products, prices and stock themselves. Everything is pulled from the office ERP automatically; nobody re-types anything.
ขั้นที่มีคนเป็นผู้ตัดสินใจหรือใช้งานSteps where a person decides or uses it


AI เขียนโค้ดให้ แต่โจทย์ เกณฑ์ และสิ่งที่ยอมไม่ได้ ผมเป็นคนกำหนด
The AI writes the code; the problem, the criteria and the non-negotiables are mine.
ธุรกิจเล็กไม่ควรมีค่าใช้จ่ายรายเดือนเพิ่ม ผมเลยเลือกบริการคลาวด์ที่ใช้ฟรีได้และไม่ต้องผูกบัตร
A small business shouldn't gain a new monthly bill, so I chose cloud services with a usable free tier and no card required.
สินค้าที่ไม่เคยรับเข้าระบบเลยจะไม่ถูกขึ้นว่าหมด เพราะบางตัวเป็นของยกมาจากก่อนใช้ระบบ ถ้าขึ้นว่าหมดจะทำให้ลูกค้าเข้าใจผิด
Items never received into the system are not shown as sold out, because some are legacy stock from before the system; showing them as out would mislead customers.
ถ้าชิ้นส่วนไหนของชุดหมด ทั้งชุดจะขึ้นว่าหมด และจำนวนที่เหลือคิดจากชิ้นส่วนที่มีน้อยที่สุด
If any part of a bundle is out, the whole bundle shows as out, and the remaining count comes from the scarcest part.
ติด Google Analytics 4 ส่งแผนผังเว็บให้ Google และยืนยันเว็บกับ Search Console
Google Analytics 4, a sitemap submitted to Google, and the site verified in Search Console.
โค้ดทั้งหมดเขียนโดย Claude Code ตามที่ผมสั่ง ผมอ่านแล้วอธิบายได้ว่าแต่ละท่อนทำอะไร และทำไมต้องเขียนแบบนี้ (ข้อมูลลับอย่างรหัสผ่านและที่อยู่เครื่องถูกตัดออก)
All code was written by Claude Code under my direction. I can explain what each part does and why it's written that way. (Secrets such as keys and machine paths are removed; code comments are in Thai.)
ฝั่งคลาวด์รับข้อมูลเฉพาะจากเครื่องในออฟฟิศที่ส่งรหัสลับมาถูกเท่านั้น และรับแค่ข้อมูลสามชนิดที่กำหนดไว้ ถ้าใครยิงข้อมูลอื่นเข้ามาจะถูกปฏิเสธ (รหัสจริงเก็บเป็นความลับบนคลาวด์ ไม่อยู่ในโค้ด)
The cloud side only accepts data from the office machine when the secret key matches, and only the three data types defined. Anything else is rejected. (The real key is stored as a cloud secret, not in the code.)
if (url.pathname === "/push" && req.method === "POST") {
if ((req.headers.get("Authorization") || "") !== "Bearer " + env.PUSH_TOKEN)
return j({ error: "unauthorized" }, 401);
let b;
try { b = await req.json(); } catch { return j({ error: "bad json" }, 400); }
if (!b || !["stock", "settings", "catalog"].includes(b.key))
return j({ error: "bad key" }, 400);
await env.KV.put(b.key, JSON.stringify(b.data));
return j({ ok: true, key: b.key });
}เช็คทุกชิ้นในชุดกับรายการสินค้าที่หมด แล้วคำนวณว่ายังประกอบได้อีกกี่ชุด จากชิ้นที่เหลือน้อยที่สุด
Check every part of a bundle against the out-of-stock list, then compute how many bundles can still be made from the scarcest part.
const setOut = p.set.some(c => OUT.has(c.code));
const setsLeft = Math.min(...p.set.map(c => Math.floor(BAL[c.code] / c.qty)));แก้หน้าเว็บแล้วมือถือยังเห็นของเก่า
Phones kept showing the old page after updates
สั่งไม่ให้เบราว์เซอร์เก็บหน้าแรกไว้ในแคช
Told browsers not to cache the main page
ของยกมาขึ้นว่าหมดทั้งที่มีของ
Legacy stock showed as sold out
นับว่าหมดเฉพาะสินค้าที่เคยรับเข้าระบบแล้วเท่านั้น
Only count as sold out items that have been received into the system
หลังบ้านต้องเข้าจากข้างนอกได้ แต่ห้ามเปิดเครื่องสู่สาธารณะ
Admin had to be reachable remotely without exposing the office machine
ใช้อุโมงค์เชื่อมต่อของคลาวด์แทนการเปิดพอร์ต
Used the cloud provider's tunnel instead of opening ports