Pulse (PBCP Pulse)
App URL: https://pulse.pcampus.co
Context API: https://pbcp-api.pcampus.co/context
Overview
PBCP Pulse คือ reference application ของ Pcampus Business Context Platform (PBCP) ทำหน้าที่แปลง Business Context ให้กลายเป็น Business Story ที่เจ้าของธุรกิจอ่านเข้าใจได้โดยไม่ต้องรู้ infrastructure
Every screen answers: What happened? · Why? · What next?
Pulse ไม่ได้เป็น ops dashboard — มันเป็น Story Explorer ที่ทำให้ธุรกิจเห็นตัวเองผ่านสายตาของ data
Who uses this
| Persona | ใช้ทำอะไร |
|---|---|
| Business owner / Stakeholder | ดู Business Story — ลูกค้าทำอะไร, ยอดขายเป็นอย่างไร, โปรโมชั่นได้ผลไหม |
| Product Manager | ตรวจสอบความถูกต้องของ Business Context |
| Platform Engineer | ใช้ Developer Mode — Event Timeline, Pipeline, Health |
| Sales / Demo | Show PBCP value ให้ prospective customers ใน 60 วินาที |
Two modes
Story View — default experience สำหรับ business stakeholders: เห็น story ของแต่ละ entity ผ่าน timeline
Developer Mode — secondary, สำหรับ engineer ที่ต้องการดู raw events และ pipeline
Story View — how it works
Story types
Story คือ evolution ของ business entity ที่ reconstruct จาก Business Context — ไม่ใช่ log ของ raw events
| Story | ตอบคำถาม |
|---|---|
| Customer Story | ลูกค้าคนนี้เป็นใคร ทำอะไรบ้าง มูลค่ารวมเท่าไหร่ |
| Order Story | order นี้เดินทางอย่างไร ติดขัดตรงไหน |
| Product Story | สินค้านี้ขายดีแค่ไหน ใครซื้อ ช่วงไหน |
| Campaign Story | campaign นี้ได้ผลไหม ใครตอบสนอง |
| Promotion Story | โปรโมชั่นนี้คุ้มค่าไหม เทียบกับยอดขาย |
1 engine หลาย domain — pharmacy ใช้ Customer Story, Order Story ได้เลย domain อื่น (retail, school, factory) ใช้ engine เดียวกัน
Data flow
Story Timeline UX
Three-panel layout — เลือก entity → เห็น timeline → drill down รายละเอียด + recommended actions
Pilot — Pharmacy
Pharmacy Platform คือ first production implementation ของ PBCP
ร้านยาส่ง Business Events ผ่าน Event SDK:
customer.visited— คนไข้มาร้านprescription.dispensed— จ่ายยาproduct.sold— ขายสินค้าpayment.completed— ชำระเงิน
Pulse แสดง Customer Story: คนไข้คนนี้มาร้านบ่อยแค่ไหน ซื้ออะไรบ้าง ใช้ยาต่อเนื่องไหม — โดยไม่ต้องเปิด database เอง
Technical overview
| Area | Choice |
|---|---|
| Framework | Next.js, React, TypeScript |
| UI | Tailwind CSS, shadcn/ui |
| Animation | Motion (motion.dev) — timeline transitions |
| Charts | Apache ECharts — funnel, sankey, time series |
| Story Timeline | Custom StoryTimeline component (ไม่ใช้ chart library) |
| Context API | PBCP Context API v1 (required) |
| Intelligence | PBCP Intelligence API v1 (optional enrich) |
| Deployment | cockpit.pcampus.local · demo env: COCKPIT_DEMO_MODE |
Integration
Pulse อ่านข้อมูลผ่าน Context API เท่านั้น — ไม่เคย query Event Store โดยตรง ไม่ส่ง LINE/email/push เอง
Context API overview
| Method | Endpoint | Description |
|---|---|---|
GET | /context/pulse | Today's business summary |
GET | /context/customers | List customers with context |
GET | /context/customers/:id | Full Customer Context + story |
GET | /context/orders | List orders with context |
GET | /context/orders/:id | Full Order Story |
GET | /context/products/:id | Product Story |
GET | /context/campaigns/:id | Campaign Story |
Full PBCP Core API reference → API Reference →