- /chatty landing with catalog-backed SaaS plans and an independent deployment enquiry form (sales_enquiries table, rate-limited POST /api/enquiries, admin review page) - /chatty/buy lets buyers pick term, users and storage from the plan's catalog SKUs (plan/term_months/users/storage_gb attributes); the selection is kept in the URL and only the chosen SKU goes to the cart - Recognise Chatty orders by shop on payment and success pages - Clear the checkout idempotency key after success or a 409 - Demo seed grid of option SKUs, docs and OpenSpec specs Co-authored-by: Cursor <cursoragent@cursor.com>
1.3 KiB
1.3 KiB
Index: Shared contract & UI
The single API contract. Every frontend change starts here when an endpoint is added or a payload shape changes.
packages/shared
| File | Holds |
|---|---|
src/types.ts |
every DTO shared across API and frontends (money as number minor units, {en, zh} as LocalizedText); includes SalesEnquiry* enquiry types |
src/api.ts |
ApiClient interface + createApi() live client; input-body types (ProductUpsertBody, SkuUpsertBody, …) |
src/locales/en.ts, zh.ts |
shared copy; app-specific keys go to the app's locales-extra.ts, never here from app work |
src/theme.css |
Tailwind v4 @theme tokens + html[data-accent] presets |
src/money.ts |
formatMoney(minor, code, exponent, locale) |
packages/ui
src/components/: VBtn, VBadge, VCard, VField, VInput, VPage,
VPanel, VTable, VAccentSwatch; useAccent(). Auto-registered as a Nuxt
module in all three apps.
Rules of engagement
- Adding an API method: declare in the interface, implement in
createApi, implement the mock inapps/mall/mock/api.ts(mall-facing) orunsupported()(console-only), and add exact picks toapps/mall/plugins/api.tsLIVE_PICKSwhen mall-facing. - Build all three apps after any change here.