How moscart/cinematch works
Main Components
a) Frontend Layer:
• Split into two main routes with different layouts:
• User Interface ((user) route)
• Movie listings (now-playing, upcoming, popular)
• Movie details
• Actor profiles
• Search functionality
• Admin Interface ((admin) route)
• Dashboard
• Content management
• Authentication
b) API Layer:
• REST API endpoints (/api routes)
• Movie-related endpoints
• Authentication endpoints
• Search functionality
• Pagination handling
c) Database Layer:
• Prisma ORM
• Database tables (based on migrations):
• Movies
• Users/Admin
• Authentication data
Component Relationships
• Frontend → API Layer: RESTful API calls
• API Layer → Database: Prisma client operations
• Authentication flow: Auth.js integration
• External services integration (if any)
Architectural Patterns to Highlight
• Next.js App Router architecture
• Route grouping pattern ((user) and (admin))
• API route handling
• Server-side vs Client-side components
• Authentication flow with Auth.js
Specific Implementation Details
┌─────────────────────────────────────────────────────┐
• Client Layer │
• ┬─────────────────────────────┤
• User Interface │ Admin Interface │
• Movie listings │ - Dashboard │
• Search │ - Content Management │
• Movie details │ - User Management │
• ┬────────────┴──────────────┬─────────────┘
• ▼ ▼
┌─────────────────────────────────────────────────────┐
• API Layer │
• /api/movie/* │
• /api/auth/* │
• /api/now-playing, /popular, /upcoming │
• ┬────────────────────────────┘
• ▼
┌─────────────────────────────────────────────────────┐
• Database Layer (Prisma) │
• Movie data │
• User/Admin data │
• Authentication records │
• ┘