Commit Graph

9 Commits

Author SHA1 Message Date
bfc20ac293 fix(deps): add tailwind-merge to root package.json as direct dependency
Some checks failed
Deploy — Staging / Build & push — admin (push) Has been cancelled
Deploy — Staging / Build & push — storefront (push) Has been cancelled
Deploy — Staging / Deploy to staging VPS (push) Has been cancelled
Deploy — Staging / Lint, Typecheck & Test (push) Has been cancelled
turbo prune storefront --docker excludes admin, so tailwind-merge was
not installed at root in Docker (it was only hoisted because of admin's dep).
@heroui/styles/node_modules/tailwind-variants requires tailwind-merge >=3.0.0
and walks up to root to find it. Adding it as a root-level dep ensures npm ci
always installs it regardless of which workspace is being built.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08 10:55:16 +03:00
33fed9382a fix(deps): upgrade tailwind-merge to v3 and declare lucide-react in storefront
Some checks failed
Deploy — Staging / Lint, Typecheck & Test (push) Successful in 2m40s
Deploy — Staging / Build & push — admin (push) Successful in 3m40s
Deploy — Staging / Build & push — storefront (push) Failing after 2m39s
Deploy — Staging / Deploy to staging VPS (push) Has been skipped
- apps/admin: tailwind-merge ^2.6.1 → ^3.4.0 so root resolves to v3.x,
  satisfying @heroui/styles/node_modules/tailwind-variants peer dep (>=3.0.0)
- apps/storefront: add lucide-react ^0.400.0 as explicit dep (used in
  SearchEmptyState and SearchResultsPanel but was previously undeclared)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08 10:31:29 +03:00
e28a6524a3 feat(env): update .gitignore and package files for Convex integration
- Added .env.staging files for admin and storefront applications to .gitignore.
- Updated package.json and package-lock.json to include @convex-dev/resend and its dependencies.
- Introduced new Convex-related modules and updated peer dependencies for better compatibility.

This commit enhances the environment configuration and integrates the Resend service into the project.
2026-03-07 22:50:45 +03:00
8e4309892c feat(admin): implement variant management — list, create, edit, preview, activate/deactivate, delete (Plan 05)
- Extend addVariant with dimension fields and SKU uniqueness check; expand updateVariant to full field set; update getByIdForAdmin to return all variants (active + inactive)
- Add generateSku utility to @repo/utils; auto-generates SKU from brand, product name, attributes, and weight with manual-override support
- Move ProductSearchSection to components/shared and fix nav link /variants → /variant
- Variants page: product search, loading skeleton, variants table, toolbar with create button
- VariantsTable: 8 columns, activate/deactivate toggle, delete with AlertDialog confirmation
- VariantPreviewDialog: read-only full variant details with sections for pricing, inventory, shipping, attributes
- VariantForm: zod schema with superRefine for dimension and on-sale validation, auto-SKU generation
- CreateVariantDialog and EditVariantDialog wiring dollarsToCents on submit
- Install sonner and add Toaster to root layout; install ShadCN Switch component

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 09:32:32 +03:00
1ea527ca1f feat(admin): implement product image upload & gallery management (Plan 04)
- Add Next.js API route for server-side Cloudinary upload with structured
  public_id (the-pet-loft/products/{id}/main|gallery-n) and asset_folder
  for portal folder visibility in dynamic folder mode
- Add background removal flow via Image Processing API with side-by-side
  original vs processed preview (Skeleton while loading)
- Dual upload buttons: processed (background removed) or original file
- Horizontal drag-and-drop image gallery using @dnd-kit/sortable with
  horizontalListSortingStrategy; reorder persisted via reorderImages mutation
- Per-image delete with AlertDialog confirmation
- 180° rotation technique for card layout: drag handle top, image center,
  delete bottom
- Debounced product search (300 ms) with inline results (max 3); clears
  gallery state when search input is cleared
- Install: cloudinary, @dnd-kit/core/sortable/utilities, embla-carousel-react,
  ShadCN carousel component
- Configure next.config.js with Cloudinary remote image pattern
- Mark checklist items 3.5 and 3.6 complete

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 06:45:03 +03:00
5168553bae feat(admin): implement product management — list, create, edit, archive (Plan 03)
Covers checklist items 3.1–3.4, 3.10–3.11 (product list, create, edit,
archive/restore, SEO fields, admin search).

Backend (convex/products.ts):
- Extended create/update with shortDescription, brand, attributes,
  seoTitle, seoDescription, canonicalSlug
- Both mutations now set createdAt/updatedAt timestamps
- Added getByIdForAdmin (admin-only, returns full product with relations)

UI — new pages:
- products/page.tsx: table with debounced search, column visibility
  dropdown, client-side sort, 10-row skeleton, load-more pagination,
  row preview dialog, per-row actions menu
- products/new/page.tsx: create product page
- products/[id]/edit/page.tsx: pre-populated edit page with archive button

UI — new components:
- ProductForm: shared form (create + edit); zod + react-hook-form,
  auto-slug, collapsible Attributes + SEO sections, submit spinner
- ProductPreviewDialog: read-only full-product dialog
- ProductActionsMenu: kebab menu (Edit link + Archive AlertDialog)

ShadCN components installed: table, badge, alert-dialog, dialog,
scroll-area, form, select, label, checkbox, textarea

Also:
- Updated CLAUDE.md: form submit buttons must use inline SVG spinner
  with data-icon="inline-start"; link-styled buttons use buttonVariants
  on <Link> (Button render prop not in TS types)
- Updated docs: checklist and plan marked complete

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 17:38:13 +03:00
2dc8878db7 feat(admin): implement navigation & layout (Plan 02, Phases 1–3)
Phase 1 — Active route highlighting
- NavMain derives isActive from usePathname() at render time
- Flat links: exact match; collapsible groups: startsWith; sub-items: exact match
- Removed hardcoded isActive fields from NAV_LINKS

Phase 2 — Dynamic breadcrumbs
- Added ROUTE_LABELS map to app.constants.ts
- Created DynamicBreadcrumb component (pathname-driven, ShadCN primitives)
- Wired DynamicBreadcrumb into dashboard layout header

Phase 3 — Mobile shell (observation only, no structural changes needed)

Icons — migrated all sidebar/breadcrumb icons from lucide-react to @hugeicons/react + @hugeicons/core-free-icons

Infra
- tsconfig.json: moduleResolution → bundler (required for hugeicons ESM exports)
- Renamed middleware.ts → proxy.ts (Next.js 15.5 convention)
- Added @hugeicons/mcp-server to .mcp.json

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 19:41:52 +03:00
a897089fdc feat(admin): implement admin auth & authorization system (Phases 0–6)
Complete implementation of the admin authentication and authorization
plan using a separate Clerk instance (App B) for cryptographic isolation
from the storefront.

Convex backend changes:
- auth.config.ts: dual JWT provider (storefront + admin Clerk issuers)
- http.ts: add /clerk-admin-webhook route with separate signing secret
- users.ts: role-aware upsertFromClerk (optional role arg), store reads
  publicMetadata.role from JWT, assertSuperAdmin internal query
- model/users.ts: add requireSuperAdmin helper
- adminInvitations.ts: inviteAdmin action (super_admin gated, Clerk Backend SDK)

Admin app (apps/admin):
- Route groups: (auth) for sign-in, (dashboard) for gated pages
- AdminUserSync, AdminAuthGate, AccessDenied, LoadingSkeleton components
- useAdminAuth hook with loading/authorized/denied state machine
- RequireRole component for super_admin-only UI sections
- useStoreUserEffect hook for Clerk→Convex user sync
- Sidebar shell with nav-main, nav-user, app-sidebar
- clerkMiddleware with /sign-in excluded from auth.protect
- ShadCN UI components (sidebar, dropdown, avatar, etc.)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 16:13:07 +03:00
cc15338ad9 feat: initial commit — storefront, convex backend, and shared packages
Completes the first milestone of The Pet Loft ecommerce platform:
- apps/storefront: full customer-facing Next.js app with HeroUI (cart,
  checkout, orders, wishlist, product detail, shop, search, auth)
- convex/: serverless backend with schema, queries, mutations, actions,
  HTTP routes, Stripe/Shippo integrations, and co-located tests
- packages/types, packages/utils, packages/convex: shared workspace packages

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 09:31:18 +03:00