v0.6: template-manager owns the product catalog

The host no longer carries a runtime product catalog. products.js
shrinks to a legacy single-product stub; the canonical catalog lives in
template-manager's productsStore, seeded ONCE on first boot from the
new seedProducts.js (after that the store under templates/ is
authoritative and the seed is ignored — intentional, so restarts never
rewrite an admin-managed catalog). phoneModels.js and
templateCategories.js are the supporting constant sets, and
docs/template-schema.md documents the v4 schema.

templates/ is the admin-managed store itself (_products_index.json +
products/<id>/product.json, JSON only) — committed so the configured
catalog (sizes, pricing, options built up in the admin UI) survives a
fresh checkout rather than regressing to the seed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
khalid@traclabs.com
2026-09-01 23:28:48 -05:00
parent b5b8808251
commit aba2dbedfb
17 changed files with 1549 additions and 76 deletions

View File

@@ -0,0 +1,58 @@
{
"id": "95dca14e-28e4-46e8-93b1-b45e3b556530",
"slug": "poster",
"label": "Poster",
"description": "Premium matte poster, suitable for framing.",
"category": "Wall Art",
"options": [],
"sizes": [
{
"id": "7d015072-f884-4e04-8a39-ce7c8e149059",
"slug": "12x18",
"label": "12\" × 18\"",
"physical": {
"width": 12,
"height": 18,
"unit": "in"
},
"canvas": {
"width": 1200,
"height": 1800
},
"printZone": {
"x": 120,
"y": 180,
"width": 960,
"height": 1440
},
"silhouettePath": "M48,0 L1152,0 A48,48 0 0 1 1200,48 L1200,1752 A48,48 0 0 1 1152,1800 L48,1800 A48,48 0 0 1 0,1752 L0,48 A48,48 0 0 1 48,0 Z",
"mockupFallbackColor": "#f3f4f6",
"basePriceCents": 1800
},
{
"id": "9a5529fd-e54e-4868-acbb-5a62c44d1297",
"slug": "18x24",
"label": "18\" × 24\"",
"physical": {
"width": 18,
"height": 24,
"unit": "in"
},
"canvas": {
"width": 1800,
"height": 2400
},
"printZone": {
"x": 180,
"y": 240,
"width": 1440,
"height": 1920
},
"silhouettePath": "M72,0 L1728,0 A72,72 0 0 1 1800,72 L1800,2328 A72,72 0 0 1 1728,2400 L72,2400 A72,72 0 0 1 0,2328 L0,72 A72,72 0 0 1 72,0 Z",
"mockupFallbackColor": "#e5e7eb",
"basePriceCents": 2400
}
],
"createdAt": "2026-05-25T12:31:21.556Z",
"updatedAt": "2026-05-25T12:31:21.556Z"
}