Wire homepage banners to Meshkee static-image slots.
Publish a slot catalog so the dashboard can import keys, and keep local placeholders when a slot is empty. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
46e4835360
commit
49b83223f1
@@ -0,0 +1,44 @@
|
||||
# Salar Store — AI context
|
||||
|
||||
Persian RTL storefront for **salarstore.com**. Next.js App Router. Do not invent Meshkee admin/upload APIs.
|
||||
|
||||
## Meshkee
|
||||
|
||||
- Apex domain: `salarstore.com`
|
||||
- API: `https://api.meshkee.com/api/v1` (`NEXT_PUBLIC_API_BASE_URL`)
|
||||
- Tenant: `GET /tenants/salarstore.com` → `businessId`
|
||||
- Public content: `/tenants/salarstore.com/...` (no auth)
|
||||
- Customer app: `https://customer.salarstore.com`
|
||||
- Business app: `https://business.salarstore.com`
|
||||
|
||||
Docs: https://api.meshkee.com/docs/website
|
||||
|
||||
## Static image slots
|
||||
|
||||
Dashboard-replaceable homepage images. Fetch `GET /tenants/salarstore.com/website/static-images?pageKey=home`. Empty/fail → keep local placeholders.
|
||||
|
||||
The business dashboard **Refresh** button imports keys from:
|
||||
|
||||
`GET https://salarstore.com/meshkee/static-image-slots`
|
||||
|
||||
Source of truth: `lib/static-images.ts` (`STATIC_IMAGE_SLOT_CATALOG`).
|
||||
|
||||
| key | kind | itemCount | aspectRatio | where |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| `slider` | list (duplicatable) | unbounded | `21:8` | Homepage hero |
|
||||
| `banners-below-slider` | list | 2 | `13:5` | Two tiles under the slider |
|
||||
| `categories` | list (duplicatable) | unbounded | `1:1` | Category row |
|
||||
| `four-banner-section` | list | 4 | `21:9` | 2×2 banner grid |
|
||||
| `three-banner-row` | list | 3 | `12:5` | Three-up row |
|
||||
| `about-us-image` | single | 1 | `8:5` | Home about block + `/aboutus` hero |
|
||||
|
||||
Rules:
|
||||
|
||||
- Use `slot.images` (all if `kind=list`, first if `kind=single`). `url` → `<img src>`. `linkUrl` → wrap in `<a>`.
|
||||
- Apply `slot.aspectRatio` from the API on the rendered frame.
|
||||
- **If a slot’s on-page size or aspect ratio changes, update `STATIC_IMAGE_SLOT_CATALOG` (`aspectRatio` + `recommendedWidth`) in the same change** so the dashboard cropper stays in sync.
|
||||
- Do not add upload/CMS endpoints on this website.
|
||||
|
||||
## Cart + customer session
|
||||
|
||||
Guest cart key `meshkee-guest-cart` (localStorage + cookie on `.salarstore.com`). Line `id` is the **store item variant id**. Continue hands off to `https://customer.salarstore.com/checkout/cart#guestCart=...` (guests go via login with that hash inside `redirect`). Shared cookies: `meshkee_customer_access_token` / `meshkee_customer_refresh_token`.
|
||||
@@ -0,0 +1,20 @@
|
||||
Wire this page to salarstore.com static-image slots.
|
||||
|
||||
Read http://meshkee.com/docs/website (static-images). Env is already set.
|
||||
|
||||
Fetch slots, match by key:
|
||||
- slider > duplicatable
|
||||
- banners-below-slider > two image
|
||||
- categories > duplicatable
|
||||
- four-banner-section → four slot
|
||||
- three-banner-row → three slot
|
||||
- about us image - one slot
|
||||
|
||||
|
||||
Use slot.images (all of them if kind=list, first if kind=single).
|
||||
url → <img src>. linkUrl → wrap in <a>. Empty or fail → keep current placeholder.
|
||||
Use slot.aspectRatio from the API. Do not invent upload APIs.
|
||||
|
||||
If image size or aspect ratio has changed during development, please update it for statics image reader. Add this as rule
|
||||
|
||||
update context md for better use in other Ai and systems - update it on every prompt (If required)
|
||||
Reference in New Issue
Block a user