How youssefjbeniani/chicc-commerce works
CHICC is a two-site commerce system: customers browse a multilingual catalog and submit website orders; staff authenticate, manage catalog and team access, and process orders through assignment and delivery updates. Both apps use a shared Supabase project, with guest orders routed through a server-side Edge Function. The README also documents manual WhatsApp order intake, image uploads, and optional stock tracking. Several backend and route implementations were not sampled, so those documented connections are cited to the README rather than inferred from filenames.
Main entry points: staff-dashboard.tsx Staff dashboard · index.ts Shared contracts · catalog/page.tsx Catalog administration · orders/page.tsx Order queue
Components 24
Customer storefront
- Storefront routes
apps/storefront/src/app - Catalog browsing
apps/storefront/src/components/storefront-catalog.tsx - Product details
apps/storefront/src/components/storefront-product-page.tsx - Basket and checkout
apps/storefront/src/components/storefront-basket.tsx - Basket state
apps/storefront/src/lib/store-basket.ts - Order submission
apps/storefront/src/lib/store-order.ts
Staff workspace
- Staff sign-in
apps/staff/src/app/actions.ts - Role access checks
apps/staff/src/lib/require-internal-user.ts - Staff dashboard
apps/staff/src/app/(workspace)/staff-dashboard.tsx - Catalog administration
apps/staff/src/app/(workspace)/catalog/page.tsx - Catalog editor
apps/staff/src/app/(workspace)/catalog/catalog-manager.tsx - Catalog operations
apps/staff/src/app/(workspace)/catalog/actions.ts - Order queue
apps/staff/src/app/(workspace)/orders/page.tsx - Order workflow
apps/staff/src/app/(workspace)/orders/orders-board.tsx - Order operations
apps/staff/src/app/(workspace)/orders/actions.ts - Team administration
apps/staff/src/app/(workspace)/team/page.tsx - Team editor
apps/staff/src/app/(workspace)/team/team-manager.tsx - Team operations
apps/staff/src/app/(workspace)/team/actions.ts
Commerce backend
- Guest order function
supabase/functions/place-website-order/index.ts - Supabase project
Shared contracts
- Shared contracts
packages/types/src/index.ts - Input validation
packages/validation/src/index.ts
Other components
- Customer
- Staff user
Connections 35
- Customer → Storefront routes: browses
- Storefront routes → Catalog browsing: renders catalog
- Storefront routes → Product details: renders product
apps/storefront/src/app/products/[slug]/page.tsx - Customer → Basket and checkout: submits order
- Catalog browsing → Basket and checkout: adds products
apps/storefront/src/components/storefront-catalog.tsx - Basket and checkout → Basket state: uses state
- Basket and checkout → Order submission: places order
- Order submission → Guest order function: forwards request
- Guest order function → Supabase project: creates order
- Staff user → Staff sign-in: signs in
- Staff sign-in → Supabase project: authenticates
apps/staff/src/app/actions.ts - Staff sign-in → Input validation: validates credentials
apps/staff/src/app/actions.ts - Staff dashboard → Role access checks: requires identity
- Staff dashboard → Catalog administration: links catalog
apps/staff/src/app/(workspace)/staff-dashboard.tsx - Staff dashboard → Order queue: links orders
apps/staff/src/app/(workspace)/staff-dashboard.tsx - Staff dashboard → Team administration: links team
apps/staff/src/app/(workspace)/staff-dashboard.tsx - Catalog administration → Role access checks: checks role
apps/staff/src/app/(workspace)/catalog/page.tsx - Catalog administration → Supabase project: reads catalog
apps/staff/src/app/(workspace)/catalog/page.tsx - Catalog administration → Catalog editor: renders editor
apps/staff/src/app/(workspace)/catalog/page.tsx - Catalog editor → Catalog operations: invokes edits
apps/staff/src/app/(workspace)/catalog/catalog-manager.tsx - Catalog operations → Supabase project: updates catalog
- Order queue → Role access checks: checks role
apps/staff/src/app/(workspace)/orders/page.tsx - Order queue → Supabase project: loads orders
apps/staff/src/app/(workspace)/orders/page.tsx - Order queue → Order workflow: renders queue
apps/staff/src/app/(workspace)/orders/page.tsx - Order workflow → Order operations: invokes updates
apps/staff/src/app/(workspace)/orders/actions.ts - Order operations → Supabase project: updates status
- Team administration → Team editor: renders team
apps/staff/src/app/(workspace)/team/page.tsx - Team editor → Team operations: invokes changes
apps/staff/src/app/(workspace)/team/team-manager.tsx - Team operations → Supabase project: manages accounts
- Supabase project → Guest order function: reserves stock
- Supabase project → Catalog operations: stores images
- Shared contracts → Catalog editor: defines contracts
- Shared contracts → Order workflow: defines contracts
- Shared contracts → Team editor: defines contracts
- Shared contracts → Catalog browsing: defines contracts