How rohitha97/flavor-haven works
Main System Components
a) Client Layer:
• Next.js Frontend (React + TypeScript)
• Main pages: Home, Menu, Cart, Orders, Login
• Components directory structure
b) API Layer:
• REST API endpoints organized by resource
• Authentication system (NextAuth)
• Payment processing integration
c) Data Layer:
• PostgreSQL Database
• Prisma ORM interface
• Data models (visible in prisma/schema.prisma)
[Client Browser] → [Next.js Frontend (SSR)] → [API Routes] → [Database]
**Pages (src/app/*):**
• Home (/)
• Menu (/menu)
• Cart (/cart)
• Orders (/orders)
• Product Details (/product/[id])
• Payment (/pay/[id])
• Authentication (/api/auth/*)
• Products (/api/products/*)
• Orders (/api/orders/*)
• Categories (/api/categories/*)
• Notifications (/api/notifications/*)
• Checkout (/api/(checkout)/*)
Key Interactions to Highlight
• User authentication flow
• Order placement process
• Payment processing sequence
• Real-time notifications
Component Relationships
Key relationships:
[AuthProvider] → [Protected Routes]
[Cart] → [Checkout] → [Payment]
[Orders] → [Notifications]
[Products] → [Categories]
Technical Details
Annotations for:
• Prisma ORM layer
• NextAuth configuration
• Docker container structure
• TypeScript types (from src/types)
Infrastructure Elements
Include:
• Docker container boundaries
• Database connections
• External service integrations (payment)