Parent : [[INDEX-WEB-UIUX]]
E-commerce JSON local + panier serveur
Problème
Petite galerie art sans budget DB immédiat — mais le panier ne doit jamais faire confiance au client pour les prix.
Solution
| Couche | Choix |
|---|---|
| Produits | data/products.json + images public/uploads/products/ |
| Panier | Cookie httpOnly ProjectGamma_cart |
| Prix | Résolution + validation Server Actions (lib/cart, lib/checkout) |
| Admin | /admin — password + session HMAC timingSafeEqual |
Migration future documentée : Vercel + Supabase (voir ARCHITECTURE.md).
Exemple incorrect
Stocker prix dans le cookie panier côté client — manipulation trivial.
Source projet
ProjectGamma/ARCHITECTURE.mdProjectGamma/src/lib/products/storage.tsProjectGamma/src/lib/cart/cookie.tsProjectGamma/src/lib/admin/auth.ts