尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證製作者的介紹僅有上面的一句話。 更多詳情請閱讀儲存庫 README。 儲存庫 README ↗
正在載入完整 README。
檢視完整 README ↗Autonomous Sales Analysis, P&L Intelligence & Financial Management System for Som Sai Jai cold-press juice bar across multiple branches (B1, B2, B3).
Som Sai Jai Dashboard is an end-to-end sales intelligence and automated financial reporting platform for the Som Sai Jai Thai cold-press juice brand. It processes daily handwritten sales reports, POS receipts, and Thai banking transfer slips (KBank / K+) to maintain master Excel ledgers, audit daily reconciliations, allocate shared raw material costs, and generate live, interactive multi-branch management dashboards and P&L statements.
Live Application: https://somsaijailive.vercel.app
| Branch | Description | Operating Since | Fixed Costs (Monthly) | Profit Share (Blessme / Ming) |
|---|---|---|---|---|
| B1 | Main Branch | Jan 2026 | ฿74,000(Rent ฿35k + Salary ฿35k + Utilities ฿4k) | 70% / 30% (Jul 2026+)(60% / 40% before Jul 2026) |
| B2 | Branch 2 | 18 Apr 2026 | ฿59,000(Rent ฿25k* + Salary ฿30k + Utilities ฿4k) | 70% / 30% (All periods) |
| B3 | Platinum Pop (Branch 3) | 11 Jul 2026 | ฿69,500(Rent ฿19k + Salary ฿46.5k [3 staff × ฿500/day × 31d] + Utilities ฿4k) | 70% / 30% (All periods) |
*Note: B2 Rent reflects the Jul–Sep 2026 discounted rate of ฿25,000 (standard rate ฿30,000).
B1, B2, B3) or aggregate data into a unified "All Branches" overview.ocr_bin).sum(cup count × unit price)) on every daily entry to catch discrepancies.flowchart TD
A[LINE Images / POS Slips] --> B[Visual OCR & Gemini AI Extraction]
B --> C[pending_verification.json]
C -->|npm run verify-sales| D[(Master Branch Excels<br/>B1, B2, B3)]
D -->|npm run update-dashboard| E[Sales_System_Automation/logic/business_rules.js]
E --> F[data.json Master Sales]
E --> G[reports_data.json P&L Engine]
F --> H[sync_dashboard_html.js Backup Embed]
G --> I[index.html Live Dashboard]
I -->|npm run deploy| J[Vercel Production Deployment]
[!IMPORTANT] Source of Truth: Master Excel files (
SomSaiJai_Dashboard_B1_2026.xlsx,_B2_,_B3_) are the only source of truth. Never editdata.jsonorreports_data.jsondirectly, as they are fully overwritten during the build/sync process.
The system includes a 4-agent autonomous pipeline orchestrator (Sales_System_Automation/agents/Orchestrator.js):
ImageExtractorAgent: Ingests raw sales photos / slips, running OCR and Gemini Vision extraction to generate structured data.DataSyncAgent: Formats, validates, and stages extracted records into pending_verification.json, then commits verified entries to Excel.QADeployerAgent: Runs regression tests, verifies financial invariants, regenerates data.json and reports_data.json, and triggers Vercel deployment.DocGenAgent: Generates summary documentation and audit logs.cd 3_Automation_Dashboard
npm run pipeline ../B1/1_Sale/Jul26/LINE_ALBUM_xxxx.jpg
Somsaijai-Dashboard/
├── B1/ # Branch 1 Raw Assets (since Jan 2026)
│ ├── 1_Sale/<Month>/ # Handwritten daily sales photos (.jpg)
│ └── 2_Expenses/<Month>/ # Expense receipts & slip images
├── B2/ # Branch 2 Raw Assets (since Apr 2026)
│ ├── 1_Sale/<Month>/ # Handwritten daily sales photos (.jpg)
│ └── 2_Expenses/<Month>/ # Expense receipts & slip images
├── B3/ # Branch 3 Raw Assets - Platinum Pop (since Jul 2026)
│ ├── 1_Sale/<Month>/ # Daily sales photos / POS revenue summaries
│ └── 2_Expenses/<Month>/ # Expense receipts & slip images
├── 3_Automation_Dashboard/ # Core Application & Automation Engine
│ ├── index.html # Live Production Dashboard (Vanilla JS + Chart.js)
│ ├── SomSaiJai_Dashboard.html # Offline backup mirror with embedded BUILT_IN data
│ ├── SomSaiJai_Dashboard_B1_2026.xlsx # Source of Truth: Branch 1
│ ├── SomSaiJai_Dashboard_B2_2026.xlsx # Source of Truth: Branch 2
│ ├── SomSaiJai_Dashboard_B3_2026.xlsx # Source of Truth: Branch 3
│ ├── data.json # Consolidated normalized sales & expense data
│ ├── reports_data.json # Pre-calculated P&L, COGS, and audit rollups
│ ├── stock_ledger.json # Global inventory pool ledger
│ ├── pending_verification.json # Staging queue for OCR extractions
│ ├── test_expense_rules.js # Business rule validation & accounting tests
│ ├── test_render_finance.js # UI financial rendering sandbox test suite
│ ├── vercel.json # Deployment routing & cache configuration
│ ├── package.json # Node.js dependencies and scripts
│ └── Sales_System_Automation/ # Core Processing Modules
│ ├── logic/
│ │ └── business_rules.js # Single source of truth for P&L math & rules
│ ├── agents/ # 4-Agent Autonomous Orchestration Pipeline
│ │ ├── Orchestrator.js # Pipeline runner
│ │ ├── ImageExtractorAgent.js # Multimodal extraction agent
│ │ ├── DataSyncAgent.js # Staging and verification sync
│ │ ├── QADeployerAgent.js # QA audit and deployment runner
│ │ └── DocGenAgent.py # Documentation generator
│ ├── process_expenses.js # Thai slip OCR parser (KBank/K+)
│ └── ocr-sales-dashboard/scripts/ # Processing & Excel synchronization scripts
├── docs/ # Reference templates and documentation
├── CLAUDE.md # Guidelines for Claude agent
├── AGENTS.md # Agent instructions & business rules
└── README.md # Repository Documentation
All commands are executed from the 3_Automation_Dashboard/ directory:
# Extract daily sales from handwritten report images
npm run process-sales Jul26 B1
npm run process-sales Jul26 B2
npm run process-sales Jul26 B3
# Extract expense receipts and transfer slips (Thai KBank/K+)
npm run process-expenses B1
npm run process-expenses B2
npm run process-expenses B3
# Commit verified staging entries (pending_verification.json) into Branch Excels
npm run verify-sales
# Full sync: Excels -> data.json -> reports_data.json -> SomSaiJai_Dashboard.html -> Vercel Deploy
npm run update-dashboard
# Rebuild and verify data locally without deploying to Vercel
npm run update-dashboard -- --no-deploy
# Deploy current build directly to Vercel Production
npm run deploy
# Record stock in / purchase into the central pool
npm run stock-in orange 50
# Audit central stock consumption vs. physical balance
npm run audit-stock
# Run full test suite (financial rules + UI rendering sandbox)
npm test
# Run individual test suites
node test_expense_rules.js # Validates profit-share separation & accounting rules
node test_render_finance.js # Sandboxes index.html JS logic against reports_data.json
70% Blessme / 30% Ming across all branches (B1, B2, B3).60% / 40%; B2 was 70% / 30%.profitShareFor(branch, month) in business_rules.js. Historical closed months are never retroactively recalculated.bucket: EXCLUDED, category: Profit Distribution (amount ฿0) to preserve true P&L integrity.Stock): Generic raw material purchases, fruit stock, cups, lids, straws, packaging, and ice.Rental): Store and stock rental fees (tracked separately).Other OPEX): Utilities, daily operational supplies, logistics, maintenance.Investment): Long-term machinery, kiosk buildouts, signage, and major renovations only.update-dashboard automatically cross-checks branch, date, category, and amount to detect duplicate slip entries before compilation.When processing daily sales or expense batches:
pending_verification.json.Date | Revenue | Cash | Scan | Expense | Net | Theoretical Rev | Status
npm run verify-sales to push data into the respective branch Excel.npm run update-dashboard to compile financial reports and update the live dashboard.Internal business intelligence and sales automation system for Som Sai Jai / Blessme. All rights reserved.