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,154 @@
{
"id": "c3ac22c7-ef49-4997-a525-d4f0eb32da6f",
"slug": "shirt",
"label": "T-Shirt",
"description": "Soft cotton tee, printed on the front.",
"category": "Apparel",
"options": [
{
"id": "9d58a8b1-5976-4512-9095-883f16a4c1b8",
"slug": "color",
"label": "Color",
"kind": "color",
"values": [
{
"id": "29092f97-2654-4150-89e5-7a323eb891e4",
"slug": "white",
"label": "White",
"hex": "#ffffff"
},
{
"id": "c25f746a-efc2-4213-9328-728ac6881bc6",
"slug": "black",
"label": "Black",
"hex": "#1f2937"
},
{
"id": "8e077db8-bc48-45c0-a3e1-df10b6f1367f",
"slug": "pink",
"label": "Dusty Pink",
"hex": "#fbcfe8"
}
]
}
],
"sizes": [
{
"id": "3df58f51-70ce-4898-8091-2bb186b04193",
"slug": "s",
"label": "Small",
"physical": {
"width": 12,
"height": 16,
"unit": "in"
},
"canvas": {
"width": 1200,
"height": 1600
},
"printZone": {
"x": 120,
"y": 160,
"width": 960,
"height": 1280
},
"silhouettePath": "M48,0 L1152,0 A48,48 0 0 1 1200,48 L1200,1552 A48,48 0 0 1 1152,1600 L48,1600 A48,48 0 0 1 0,1552 L0,48 A48,48 0 0 1 48,0 Z",
"mockupFallbackColor": "#f4f4f5",
"basePriceCents": 2200
},
{
"id": "86787c88-c4e0-4798-a34f-d1e173b2704b",
"slug": "m",
"label": "Medium",
"physical": {
"width": 12,
"height": 16,
"unit": "in"
},
"canvas": {
"width": 1200,
"height": 1600
},
"printZone": {
"x": 120,
"y": 160,
"width": 960,
"height": 1280
},
"silhouettePath": "M48,0 L1152,0 A48,48 0 0 1 1200,48 L1200,1552 A48,48 0 0 1 1152,1600 L48,1600 A48,48 0 0 1 0,1552 L0,48 A48,48 0 0 1 48,0 Z",
"mockupFallbackColor": "#f4f4f5",
"basePriceCents": 2200
},
{
"id": "8cf5377f-8c6b-4afe-80c3-9337e6303176",
"slug": "l",
"label": "Large",
"physical": {
"width": 12,
"height": 16,
"unit": "in"
},
"canvas": {
"width": 1200,
"height": 1600
},
"printZone": {
"x": 120,
"y": 160,
"width": 960,
"height": 1280
},
"silhouettePath": "M48,0 L1152,0 A48,48 0 0 1 1200,48 L1200,1552 A48,48 0 0 1 1152,1600 L48,1600 A48,48 0 0 1 0,1552 L0,48 A48,48 0 0 1 48,0 Z",
"mockupFallbackColor": "#f4f4f5",
"basePriceCents": 2200
},
{
"id": "ecc7707a-1703-4c27-9da7-6b39709837ba",
"slug": "xl",
"label": "X-Large",
"physical": {
"width": 12,
"height": 16,
"unit": "in"
},
"canvas": {
"width": 1200,
"height": 1600
},
"printZone": {
"x": 120,
"y": 160,
"width": 960,
"height": 1280
},
"silhouettePath": "M48,0 L1152,0 A48,48 0 0 1 1200,48 L1200,1552 A48,48 0 0 1 1152,1600 L48,1600 A48,48 0 0 1 0,1552 L0,48 A48,48 0 0 1 48,0 Z",
"mockupFallbackColor": "#f4f4f5",
"basePriceCents": 2400
},
{
"id": "3667ec33-6123-44bd-a12e-5fdfef3c2874",
"slug": "xxl",
"label": "XX-Large",
"physical": {
"width": 12,
"height": 16,
"unit": "in"
},
"canvas": {
"width": 1200,
"height": 1600
},
"printZone": {
"x": 120,
"y": 160,
"width": 960,
"height": 1280
},
"silhouettePath": "M48,0 L1152,0 A48,48 0 0 1 1200,48 L1200,1552 A48,48 0 0 1 1152,1600 L48,1600 A48,48 0 0 1 0,1552 L0,48 A48,48 0 0 1 48,0 Z",
"mockupFallbackColor": "#f4f4f5",
"basePriceCents": 2600
}
],
"createdAt": "2026-05-25T12:31:21.547Z",
"updatedAt": "2026-05-25T12:31:21.547Z"
}