How c-h-o-n/papirsarkany works
Main System Components
a) Frontend Layer:
• Next.js Application (src/app directory structure)
• Client-side State Management (src/store directory)
• Component Library (src/components)
b) Backend Layer:
• Next.js API Routes (src/app/(shop)/api)
• Database Layer (Prisma ORM)
• Content Management System (Sanity CMS)
c) External Services:
• Foxpost Integration (shipping service)
• Google Cloud Services
• Email Service
Architectural Patterns to Highlight
a) Route Groups Pattern:
• (shop) group for main e-commerce functionality
• (sanity) group for admin/CMS functionality
b) State Management:
• Multiple stores (cart, checkout, toast, foxpost)
• Client-side state hydration
Specific Implementation Details
a) Data Flow:
• Client Components → API Routes → Database
• Sanity CMS → Frontend Components
• Checkout Flow → External Services
b) Database Layer:
• Prisma Schema → Database
• Migration Management
[Client Layer]
• ↓
[Next.js Application Layer]
• ↓
[API Layer]
• ↓
[Service Layer]
• ↓
[Data Layer]
Important Elements
• Authentication flow for admin section
• Shopping cart state management
• Order processing pipeline
• Content management workflow
• Testing infrastructure (E2E, Integration, Unit)
Specific Implementation Notes
• The separation between shop and admin interfaces
• The integration with Sanity CMS for product management
• The checkout process flow
• State management architecture
• External service integrations (Foxpost, Google Cloud)
Technical Stack Indicators
• Next.js
• Prisma
• Sanity
• TailwindCSS
• TypeScript
• Playwright (E2E testing)
• Vitest (Unit testing)
Remember to:
• Annotations for critical paths
• Error handling flows
• Where type definitions are used (globals.d.ts, sanity.types.ts)