How joschan21/casecobra works
Main System Components
A. Client Layer
• Next.js 14 Frontend (src/app directory)
• UI Components (src/components)
• Phone Case Configurator (src/app/configure)
B. API Layer
• Authentication endpoints (src/app/api/auth)
• File upload handling (src/app/api/uploadthing)
• Webhook handlers (src/app/api/webhooks)
C. Service Layer
• Authentication (Kinde Auth)
• File Storage (UploadThing)
• Payment Processing (Stripe)
• Email Service (for thank-you emails)
D. Data Layer
• PostgreSQL Database (via Prisma ORM)
Component Relationships
a) User Flow Path:
Landing Page → Authentication → Configurator → Checkout → Thank You Page
b) Data Flow Paths:
Client → API Routes → Services → Database
Specific Implementation Details
Key architectural elements:
A. Frontend Architecture:
• Next.js app router structure
• Configurator components:
• Design
• Preview
• Upload
• Dashboard for order management
• UI component library (shadcn-ui)
B. Backend Services:
• Prisma ORM connection
• Kinde Auth integration
• Stripe payment processing
• UploadThing file handling
Important Flows to Highlight
• Authentication flow
• Phone case configuration process
• Order processing
• Admin dashboard access
• File upload handling
• Payment processing
• Email notification system
Technical Stack Callouts
• Next.js 14
• TypeScript
• Tailwind CSS
• PostgreSQL
• Prisma ORM
• Kinde Auth
• Stripe
• UploadThing