docs: architecture, guidelines, domain designs, progressive code index

This commit is contained in:
Chengdong Zhang
2026-09-24 16:59:32 +08:00
parent c532f87b03
commit a968327b12
19 changed files with 728 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
# Index: Catalog
Domain design: `docs/domains/catalog.md`. Specs: `openspec/specs/product/`,
`category/`, `brand/`.
## Backend (`apps/api`)
| File | Holds |
|---|---|
| `src/modules/product/service.rs` | public list/detail, merchant CRUD, publish/unpublish, SKU upsert, template link validation |
| `src/modules/product/repo.rs` | SKU attach + sold_count aggregation |
| `src/modules/category/` | public category tree |
| `src/modules/brand/` | public list; admin whole-list replacement |
| `migrations/0003_catalog.sql`, `0005_seed_category_tree.sql`, `0008_brands.sql` | schema + seeds |
## Shared contract
`types.ts`: `Product`, `Sku`, `Category`, `Brand`, `ProductStatus`.
`api.ts`: `listProducts`, `getProduct`, `listCategories`, `listBrands`,
`shop.*` product/SKU methods, `admin.replaceBrands`.
## Frontends
- Mall: `pages/index.vue` (floors), `pages/search.vue`, `pages/goods/[id].vue`,
`components/ui/ProductCard.vue`
- Shop-admin: `pages/products/{index,new,[id]}.vue`,
`components/ProductForm.vue`
- Admin: `pages/brands.vue`