Pulled in from the parallel auth/cart work on origin/main that this
branch is superseding — these two pieces are independent of the auth
architecture and worth keeping: Next.js standalone output for a leaner
production deploy, and the production env file (public URLs only, no
secrets) it and the app read from.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Real in-site login/register (password + SMS OTP) against Meshkee's
/auth API, with self-healing access-token refresh (15 min lifetime) and
an in-flight-refresh guard so AuthContext and CartContext don't race
each other into a failed concurrent refresh.
- Real cart: header cart button/badge, a cart popup, and a working
"add to cart" on both product cards (where a specific variant id is
known) and the product/store-item detail buy-box (always resolves a
purchasable variant, even for single-SKU products with no selectable
variation).
- /checkout: address + cash/bank-transfer payment, posts to the real
checkout API and creates an order; refreshes the cart afterward so the
header badge doesn't go stale.
- New /store-items and /store-items/[id] pages (variant-level browsing,
separate from the product-level /products catalog), cross-referencing
the parent product for images/description/technical-info.
- Product gallery: click-to-open fullscreen lightbox alongside the
existing hover-zoom.
- Comments tab wired to the real comments API, gated to logged-in users
(a product decision — the API itself doesn't require auth) with a
login prompt otherwise.
- Similar-products row on product/store-item detail pages.
- Contact page wired to the real contact-submissions API, with a toast
and inline confirmation on success, and the form resetting.
- CONTEXT.md: a maintained architecture/conventions doc for this repo,
now auto-loaded via CLAUDE.md, covering the Meshkee integration quirks
and UI conventions established across this project.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Resolve product cards from group endpoints (store-specials,
brand-groups) that only return a productId, not a slug, via a new
/products/id/[id] route backed by GET /products/by-id/{id} — clicking
these was previously falling back to a name search instead of the
detail page.
- Derive discount price/percent generically in normalizeProduct so any
source with real old/new prices shows it, even without an explicit
discount field from the API.
- Product cards and the detail page buy-box: show the discount badge
beside the old (struck-through) price, current price alone on its
own line, matching the reference design.
- Equalize product card heights within a carousel row (Swiper's own
CSS doesn't stretch slides to the tallest sibling in slidesPerView:
"auto" + freeMode mode) so the add-to-cart button lines up across
cards regardless of whether a card has a discount line.
- Featured categories: 110px images with no border/radius, matching
the site's other category card treatment.
- Replace Vazirmatn with the client's IRANYekan font files — light
weight for body text, bold weight for headings only.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Add a featured-categories list slot (published via /meshkee/static-image-slots
alongside the existing banner slots) so the homepage category strip can be
driven by admin-uploaded images instead of the category API, which has no
image field. Falls back to the current category list whenever the slot has
no images configured or the fetch fails.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Product detail: interactive image gallery (thumbnails, prev/next,
hover-zoom), tabbed spec/review/comments section matching the site's
standard pattern, variations/options display, and an availability
label instead of duplicating the contact-store message.
- Fix product.images normalization — the API returns {url} media objects,
not plain strings, so galleries were silently rendering empty.
- Prefer the Persian name (nameFa/productNameFa) everywhere a product
name is shown.
- Product cards: padded, rounded images instead of edge-to-edge with a
dashed divider.
- Blog: wire the homepage carousel to real posts (was static sample
data), drop the detail page's separate cover image, and make images
embedded in article/description HTML fill their container with
rounded corners.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Add /products (list + detail) and /blog (list + detail) routes backed by
the real Meshkee API, a real category-hierarchy mega menu (level 2/3 only),
debounced instant search proxied through a same-origin API route, and
tel:-link fallbacks on product cards when no price is set. Also fixes
Product price normalization to read the real API shape instead of a
guessed one, and hardens product linking against catalog sources that
don't expose a slug.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Kept the local branch's homepage implementation (Meshkee product/category
API integration, redesigned header, Swiper carousels, hardcoded local
slider/banner images) as the source of truth for all conflicting sections,
since it reflects the most recent explicit direction.
Folded in the remote's non-conflicting additions: the static-image-slot
types/helpers in lib/meshkee.ts, the SlotImage component, and the
/meshkee/static-image-slots catalog route. These aren't wired into any
page yet since the live API's slot key ("home-hero") doesn't match the
keys this code expects ("slider", etc.) — worth reconciling once that's
settled.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>