Commit Graph

4 Commits

Author SHA1 Message Date
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
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