How hammadshykh/eccommerce-with-sanity works
Main System Components
A. Frontend Layer (Next.js Application)
• Client-Side Components (src/components)
• App Router Pages (src/app)
• Store Management (src/store.ts)
B. Backend Services
• Sanity CMS (Content Management)
• Stripe Payment Processing
• Next.js API Routes (for webhooks)
C. Data Layer
• Sanity Database (for content)
• Stripe Payment Records
Component Relationships
• Client → Next.js Server (App Router)
• Next.js Server → Sanity CMS
• Next.js Server → Stripe API
• Webhook Routes → Stripe Events
Detailed Component Breakdown
Frontend Section:
• Store Routes (src/app/(store))
• Product Pages
• Category Pages
• Basket
• Orders
• Search
• UI Components (src/components)
• Layout Components
• Product Components
• Shared UI Elements
Backend Section:
• Sanity Integration
• Schema Types
• Content Management
• Queries
• Stripe Integration
• Checkout Sessions
• Payment Processing
• Webhooks
Infrastructure Layer
At the bottom, include:
• Vercel hosting
• CDN layer
• Edge functions (if used)
Key Elements to Emphasize:
API routes for webhooks and server actions
Remember to:
• Notes for important architectural decisions
• Both synchronous and asynchronous flows
This architecture represents a modern full-stack e-commerce application with headless CMS capabilities, secure payment processing, and a robust frontend built on Next.js.