How koompi/smartcam-theme works
Main System Components
a) Frontend Layer:
• Next.js App Router Architecture (indicated by the /app directory structure)
• Client Components (components/globals, components/layouts)
• Rich Text Editor System (extensive editor/ directory)
• Theme System (themes/ directory)
b) API Layer:
• GraphQL API (graphql/ directory)
• REST API endpoints (api/ directory)
• Authentication System (app/auth)
c) State Management:
• Context Providers (context/ directory)
• Custom Hooks (hooks/ directory)
d) External Services Integration:
• Apollo Client (libs/apollo-wrapper.tsx)
• SSO Integration (api/sso.ts)
• Payment Processing (app/cart/components/PaymentForm.tsx)
┌─────────────────────────────────────────────────────────┐
• Client Layer (Browser) │
• ┬─────────────────┬───────────────────┤
• Pages/Routes │ Components │ Rich Editor │
• (app/*) │ (components/*) │ (editor/*) │
• ┬────────┴────────┬────────┴─────────┬─────────┘
• ▼ ▼ ▼
┌─────────────────────────────────────────────────────────┐
• Application Core │
• ┬───────────────────┬─────────────────────┤
• Context │ Hooks │ Types │
• Providers │ (hooks/*) │ (types/*) │
• ┴─────────┬─────────┴─────────────────────┘
• ▼
┌─────────────────────────────────────────────────────────┐
• API Layer │
• ┬───────────────────┬─────────────────────┤
• GraphQL │ REST API │ Apollo │
• Endpoints │ Endpoints │ Client │
• ┴───────────────────┴─────────────────────┘
Key Features to Highlight
• The e-commerce specific features (cart, checkout, products)
• The rich text editor system
• Authentication flow
• GraphQL data fetching patterns
• State management architecture
Component Relationships
Key interactions:
• How the cart system interfaces with payment processing
• Product catalog relationship with GraphQL queries
• Authentication flow with SSO
• Editor integration with the main application
• Theme system's impact on components
Implementation Notes
• Maintain consistent spacing and alignment
• Related components together
• Use clear, readable labels
• Version information
• Brief descriptions for complex interactions