📚 WepAppOpusApi Docs
เอกสารทั้งหมดของ
https://adsfb.namnan.co.th
🟢 LIVE
🔒 HTTPS / HTTP/2
✓ Let's Encrypt SSL
v0.0.1
commit 7f76a14
30
เอกสาร
10
Phases
2.1MB
ขนาดรวม
15
Screenshots
🎓 เริ่มต้นใช้งาน
⭐ แนะนำ
📘
Facebook API Tutorial
HTML
บทเรียน 9 ขั้นตอน ตั้งแต่สมัคร Meta Developer จนถึงดึงข้อมูล Ads ได้จริง พร้อม 15 screenshots ประกอบ
~ 10 นาที
🔐 สำคัญ
📋
API Permission Check (2026-02-20)
PERMS
ตรวจสอบสิทธิ์/ความสามารถของ token ที่ใช้บน production 192.166.82.95 — granted perms, scopes, ข้อจำกัด
Live audit
🏗️ สถาปัตยกรรม & การออกแบบ
🏛️
ADR-0001: Architecture
ADR
Architecture Decision Record — ตัดสินใจเชิงสถาปัตยกรรม เช่น Fastify + tsx, no build step, share DB with WepAppOpus
🗺️
Schema Mapping
MAPPING
ตาราง mapping ระหว่าง Facebook Graph API fields → ad_entries table (column name, type, nullable, derive rules)
📊
Observability & Alerts
MONITOR
Prometheus metrics, structured logging, /bridge/status, alert thresholds (latency, error rate, cache hit ratio)
🌉
Frontend Bridge & Cutover
INTEGRATION
วิธีให้ web dashboard (Next.js) เรียก API ตัวนี้แทน CSV ingestion — contract, fallback, gradual rollout
🚀 Deployment & Runbook
🚢
Deploy Runbook
PROD
ขั้นตอน deploy บน production — Ubuntu + PM2 + nginx + certbot + healthcheck + rollback plan
🗄️
DB Migration Plan
DB
แผน migrate schema (SQLite dev / MySQL prod) — index, partition, ad_entries 31 columns
💻
Desktop Install Runbook
DESKTOP
วิธี build WepAppOpusApiDesktop (Electron) — Windows NSIS installer, keytar, CSV fallback
📦
Phase 10: Deploy & Rollout
PHASE 10
Final phase — deploy to prod, smoke test, monitor, handoff to ops
🖥️
Phase 10: Desktop Rollout
DESKTOP
Deploy Electron desktop variant — release manifest, smoke gate, auto-update strategy
🔒 Security & Secrets
🔑
Environment & Secrets
SECRETS
คู่มือจัดการ env vars, secret rotation, dev vs prod, .env.example + encryption envelope
🛡️
Phase 3: Token Security Layer
PHASE 3
AES-256-GCM token encryption at rest, API_ACCESS_TOKEN_ENC, redaction in logs/errors
🔒
Phase 3: Desktop Token Hardening
PHASE 3
OS keychain via keytar, master key in Windows Credential Manager / macOS Keychain
📋 Phase Plans (Discovery → Deploy)
🎯
Phase 0: Freeze Scope
DESKTOP V1
Lock MVP scope สำหรับ Desktop v1 — features, must-have vs nice-to-have
🚀
Phase 1: Bootstrap Desktop
DESKTOP
Skeleton ของ Electron + React + Vite + sql.js + Chart.js
📜
Phase 1: Lock Scope & Contract
SCOPE
API contract draft + field-level mapping table
🔌
Phase 2: Local Dashboard Wiring
DESKTOP
ต่อ IPC contracts ระหว่าง main ↔ renderer
🏛️
Phase 4: Repository & Service Layer
DESKTOP
Clean architecture — main/repositories + main/services + main/security
🏛️
Phase 4: Repo & Service Layer (Web)
API
Repository pattern for Fastify — DB abstraction, multi-account
👤
Phase 5: Profile Management
API
Multi-token, multi-account token profiles — single/selected/all scopes
👤
Phase 5: Desktop Profile Mgmt
DESKTOP
UI/UX สำหรับจัดการ profiles ใน desktop
⚡
Phase 6: Desktop Live Integration
DESKTOP
เชื่อม live Graph API ใน Electron main process
⚡
Phase 6: Integrate Live Endpoints (Web)
API
Fastify /live/* endpoints — accounts + dashboard
🖱️
Phase 7: Frontend UX Manage & Select
WEB
UI สำหรับ Next.js — เลือก account/profile/ช่วงวันที่
🖱️
Phase 7: Desktop UX Manage & Select
DESKTOP
UI สำหรับ Electron — เลือก account/profile/ช่วงวันที่
⚡
Phase 8: Caching & Performance
PERF
L1/L2 cache, singleflight, concurrency limit, Prometheus metrics
⚡
Phase 8: Desktop Caching
PERF
Desktop cache strategy — L1 in-memory, L2 SQLite
🧪
Phase 9: Desktop QA & Security
QA
Regression tests, security audit, payload limits, navigation guards
🧪
Phase 9: API QA & Security
QA
Vitest suite, contract tests, security headers, CSRF, rate-limit