E-Commerce Webshop Engine
The BOW modular webshop engine is a zero-dependency e-commerce subsystem powered by a dedicated SQLite database. It provides comprehensive support for product variants, multilingual category lineages, hierarchical optional/required modifier extras, live cart price drift validation, atomic inventory management, and 2-factor guest order tracking.
⚡ Live Cart Validation Pipeline
At checkout, the system never trusts client-side state. It runs atomic validation against live catalog prices and stock availability, safeguarding against expired sales or stale prices.
☕ Hierarchical Product Extras
Extras are organized into categories (e.g. Milk Options, Syrups) with configurable rules: required vs. optional choice, maximum selection limits, and multi-quantity steppers (e.g. 3x brown sugar).
1. Configuration (config/bow-shop.json)
Core store parameters are managed in config/bow-shop.json:
{
"enabled": true,
"currency": "HUF",
"vatRate": 27,
"database": "data/shop.sqlite",
"minLeadMinutes": 30,
"shipping": {
"flat_rate": 1490,
"free_threshold": 15000
},
"operatingHours": {
"enabled": false
}
}
2. Hierarchical Extras & Business Constraints
When ordering food or specialty beverages, certain choices (e.g. milk type) are required, while syrups are optional, and sugar allows arbitrary quantities. BOW validates these rules both in the database and shopping cart:
| Category / Extra | Required? | Max Selection | Multi-Quantity | Client UI Control |
|---|---|---|---|---|
| Milk & Plant-Based Options | Yes (Choose 1) | 1 choice | No | Radio buttons with default preselection |
| Sauces & Syrups | No (Optional) | Max 2 choices | No | Multi-select checkboxes with limit enforcement |
| Brown Sugar / Sweeteners | No | - | Yes (Max 5) | Quantity stepper buttons (- and +) |
3. Checkout, Tracking & Magic Link Tokens
Upon successful checkout, the system generates an order number (ORD-YYYY-XXXX) and an unguessable 64-character Magic Link token.
- Immediate Guest Access: Customers can track order status instantly without account registration via the Magic Link.
- 2-Factor Public Lookup: Accessible at
/webshop-demo/order-trackingusing Order Number + Customer Email. - Atomic Inventory Management: Decrements stock for products and tracked extras inside a transaction. Automatic rollback on cancellation.
4. Emergency Rush-Hour Panic Throttle
During kitchen rushes or inventory shortages, store staff or AI agents can temporarily pause incoming orders via REST API or the admin_shop_toggle_throttle MCP tool.
Product browsing and cart viewing remain accessible, while the checkout button displays a clean notification of the temporary pause.