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,104 @@
{
"products": {
"c3ac22c7-ef49-4997-a525-d4f0eb32da6f": {
"id": "c3ac22c7-ef49-4997-a525-d4f0eb32da6f",
"slug": "shirt",
"label": "T-Shirt",
"category": "Apparel",
"sizeCount": 5,
"createdAt": "2026-05-25T12:31:21.547Z",
"updatedAt": "2026-05-25T12:31:21.547Z"
},
"6202b99a-a4a9-4f11-8b2d-32c17516ecfa": {
"id": "6202b99a-a4a9-4f11-8b2d-32c17516ecfa",
"slug": "hoodie",
"label": "Hoodie",
"category": "Apparel",
"sizeCount": 5,
"createdAt": "2026-05-25T12:31:21.552Z",
"updatedAt": "2026-05-25T12:31:21.552Z"
},
"f530dc06-ef10-46b4-9903-3927f85bd9a7": {
"id": "f530dc06-ef10-46b4-9903-3927f85bd9a7",
"slug": "magnet",
"label": "Magnet",
"category": "Home",
"sizeCount": 3,
"createdAt": "2026-05-25T12:31:21.554Z",
"updatedAt": "2026-05-25T12:31:21.554Z"
},
"951cc0aa-6b28-460a-ad31-8ac8fdcc5ebd": {
"id": "951cc0aa-6b28-460a-ad31-8ac8fdcc5ebd",
"slug": "mug",
"label": "Ceramic Mug",
"category": "Drinkware",
"sizeCount": 2,
"createdAt": "2026-05-25T12:31:21.555Z",
"updatedAt": "2026-05-25T12:31:21.555Z"
},
"95dca14e-28e4-46e8-93b1-b45e3b556530": {
"id": "95dca14e-28e4-46e8-93b1-b45e3b556530",
"slug": "poster",
"label": "Poster",
"category": "Wall Art",
"sizeCount": 2,
"createdAt": "2026-05-25T12:31:21.556Z",
"updatedAt": "2026-05-25T12:31:21.556Z"
},
"1d69616b-96a8-4280-9beb-c8926222c589": {
"id": "1d69616b-96a8-4280-9beb-c8926222c589",
"slug": "tote",
"label": "Tote Bag",
"category": "Accessories",
"sizeCount": 1,
"createdAt": "2026-05-25T12:31:21.557Z",
"updatedAt": "2026-05-25T12:31:21.557Z"
},
"c722b19b-d6c6-4639-b0eb-dec34731e50d": {
"id": "c722b19b-d6c6-4639-b0eb-dec34731e50d",
"slug": "pillow",
"label": "Throw Pillow",
"category": "Home",
"sizeCount": 1,
"createdAt": "2026-05-25T12:31:21.558Z",
"updatedAt": "2026-05-25T12:31:21.558Z"
},
"1ed028ad-1998-4ace-813b-79023bd08c1d": {
"id": "1ed028ad-1998-4ace-813b-79023bd08c1d",
"slug": "notebook",
"label": "Notebook",
"category": "Stationery",
"sizeCount": 1,
"createdAt": "2026-05-25T12:31:21.559Z",
"updatedAt": "2026-05-25T12:31:21.559Z"
},
"04507704-50a9-4de9-9b23-475d6b76bf0e": {
"id": "04507704-50a9-4de9-9b23-475d6b76bf0e",
"slug": "sticker",
"label": "Sticker",
"category": "Stationery",
"sizeCount": 1,
"createdAt": "2026-05-25T12:31:21.560Z",
"updatedAt": "2026-05-25T12:31:21.560Z"
},
"cb43b749-05c0-4d1c-8d0b-dadd9b28574d": {
"id": "cb43b749-05c0-4d1c-8d0b-dadd9b28574d",
"slug": "hat",
"label": "Hat",
"category": "Apparel",
"sizeCount": 1,
"createdAt": "2026-05-25T12:31:21.562Z",
"updatedAt": "2026-05-25T12:31:21.562Z"
},
"f5cbb673-8696-4dad-a63c-3a802ba53fd3": {
"id": "f5cbb673-8696-4dad-a63c-3a802ba53fd3",
"slug": "phone-case",
"label": "Phone Case",
"category": "Accessories",
"sizeCount": 1,
"createdAt": "2026-05-25T12:31:21.563Z",
"updatedAt": "2026-05-25T12:31:21.563Z"
}
},
"version": 1
}