How erwan-p/patisserie works
La Maison Sucrée is a bakery storefront with customer accounts, pickup ordering, and an administration area. Customers browse products, keep a cart and pickup slot, authenticate, pay through Stripe, and have paid orders fulfilled and confirmed. Admins manage products, orders, dashboard views, settings, and protected media; account and admin authentication include email/password flows and an additional admin verification step. The graph preserves these major capabilities, while unsampled modules are included only where the tree or source index identifies them. Edges reflect shown calls or indexed references; several page-to-action relationships remain unconnected where their wiring was not inspected.
Main entry points: prisma.ts Prisma Database · auth.ts Authentication · checkout/route.ts Checkout API · verify/route.ts Payment Verification
Components 28
Storefront
- Storefront Pages
src/app - Product Catalogue
src/app/catalogue/CatalogueClient.tsx - Bakery Home
src/components/home/HomeClient.tsx - Customer Profile
src/app/profil/ProfileClient.tsx
Ordering and Payments
- Cart State
src/lib/store.ts - Cart and Pickup
src/app/panier/PanierClient.tsx - Checkout API
src/app/api/checkout/route.ts - Stripe
- Payment Verification
src/app/api/checkout/verify/route.ts - Stripe Webhook
src/app/api/webhook/stripe/route.ts - Order Fulfillment
src/lib/order-fulfillment.ts - Order Database
src/lib/prisma.ts - Order Success
src/app/commande/succes/SuccesClient.tsx
Administration
- Admin Pages
src/app/admin - Dashboard Actions
src/actions/dashboard.ts - Admin Actions
src/actions/admin.ts - Product Actions
src/actions/product.ts - Settings Actions
src/actions/settings.ts - Media Upload API
src/app/api/upload/route.ts
Identity and Services
- User Actions
src/actions/user.ts - Verified Admin Auth
src/lib/admin-auth.ts - Admin 2FA
src/lib/admin-2fa.ts - Authentication
src/lib/auth.ts - Email Delivery
src/lib/email.ts - Prisma Database
src/lib/prisma.ts - Supabase Storage
src/lib/storage.ts - Storage Cleanup
src/lib/storage-cleanup.ts
Other components
- Shopper
Connections 34
- Shopper → Product Catalogue: browses
- Product Catalogue → Cart State: updates
src/app/catalogue/CatalogueClient.tsx - Cart and Pickup → Cart State: reads and updates
src/lib/store.ts - Shopper → Cart and Pickup: manages cart
- Cart and Pickup → Checkout API: starts checkout
- Checkout API → Prisma Database: validates products
src/app/api/checkout/route.ts - Checkout API → Authentication: checks session
src/app/api/checkout/route.ts - Checkout API → Stripe: creates session
src/app/api/checkout/route.ts - Stripe → Payment Verification: payment lookup
- Payment Verification → Stripe: retrieves session
src/app/api/checkout/verify/route.ts - Payment Verification → Order Fulfillment: fulfills paid order
src/app/api/checkout/verify/route.ts - Stripe Webhook → Order Fulfillment: fulfills payment
src/app/api/webhook/stripe/route.ts - Order Fulfillment → Prisma Database: writes order and stock
src/lib/order-fulfillment.ts - Payment Verification → Email Delivery: sends receipt
src/app/api/checkout/verify/route.ts - Stripe Webhook → Email Delivery: sends receipt
src/app/api/webhook/stripe/route.ts - Order Success → Cart State: reads cart
src/app/commande/succes/SuccesClient.tsx - Admin Pages → Dashboard Actions: uses dashboard data
src/app/admin/page.tsx - Admin Pages → Prisma Database: reads dashboard data
src/app/admin/page.tsx - Admin Pages → Settings Actions: uses settings actions
src/app/admin/settings/SettingsClient.tsx - Product Actions → Prisma Database: reads and writes
src/actions/product.ts - Product Actions → Storage Cleanup: removes unused media
src/actions/product.ts - Settings Actions → Prisma Database: reads and writes
src/actions/settings.ts - Customer Profile → User Actions: uses account actions
src/app/profil/ProfileClient.tsx - User Actions → Authentication: checks session
src/actions/user.ts - User Actions → Prisma Database: reads and writes
src/actions/user.ts - Admin Actions → Authentication: checks session
src/actions/admin.ts - Admin Actions → Admin 2FA: verifies admin token
src/actions/admin.ts - Verified Admin Auth → Authentication: gets session
src/lib/admin-auth.ts - Verified Admin Auth → Admin 2FA: verifies token
src/lib/admin-auth.ts - Authentication → Prisma Database: uses adapter and queries
src/lib/auth.ts - Media Upload API → Verified Admin Auth: checks admin
src/app/api/upload/route.ts - Media Upload API → Supabase Storage: uploads media
src/app/api/upload/route.ts - Storage Cleanup → Prisma Database: checks references
src/lib/storage-cleanup.ts - Storage Cleanup → Supabase Storage: removes objects
src/lib/storage-cleanup.ts