How damon248/disney-clone-new works
Project Type and Purpose
• This is a full-stack, server-side-rendered (SSR) Next.js application with built-in React components and serverless functions.
• Purpose: Browse movie data (by genre or search term) and get AI-generated suggestions.
Main Components
a. Frontend (Next.js “app” directory)
• app/layout.tsx, app/page.tsx: Root layout and home page
• app/genre/[id]/page.tsx & app/search/[term]/page.tsx: Dynamic genre/search pages
• Global styles (app/globals.css) & Tailwind configuration
• React components in /components (UI primitives under /components/ui)
• ThemeProvider and ThemeToggler for theming
b. Backend / Serverless Functions (functions directory)
• getAiSuggestions.ts: Azure-style (host.json) function that calls OpenAI or another LLM
c. Utilities / Libraries (lib directory)
• getMovies.tsx, getImagePath.tsx, utils.ts: Shared helpers for fetching and formatting TMDB data
d. External Services
• TMDB API (movie data, images)
• OpenAI or AI service (for “AI suggestions”)
e. Configuration & Deployment
• next.config.js, tsconfig.json, tailwind.config.js, package.json — define build, linting, and deployment settings
• .funcignore, host.json — Azure Functions configuration
Relationships & Data Flows
• Browser <–> Next.js Frontend: SSR/SSG pages request data at build time or on demand
• Frontend → Serverless Function: e.g., user clicks “Get AI Suggestions” → fetch to /api/suggestions
• Serverless Function → AI Service: Function calls LLM, returns suggestions JSON
• Frontend / Utility Libraries → TMDB API: getMovies, getImagePath call TMDB to fetch movie lists/images
• Static Assets served from public folder
Architectural Patterns & Principles
• Component-based UI (atomic UI primitives under /components/ui)
• App Router (Next.js v13+) for file-based routing and layout nesting
• Serverless API layer (“functions” folder) separated from frontend code
• Shared utils to avoid duplication (lib folder)
• Theming via React Context (ThemeProvider)