How mustafa-j-wardeh17/film-and-series-central works
Project Type & Purpose
• Full-stack web application for browsing, searching, and reviewing movies/series.
• Next.js on the frontend (with server-side rendering and static generation), Prisma ORM on the backend, and Supabase (PostgreSQL) as the database.
• Deployed on Vercel; assets served from Vercel/CDN.
File Structure
• src/app: Next.js App Router handling pages, layouts, and loading states.
• src/components: Reusable UI components (cards, swipers, header/footer, loaders).
• lib/: Shared utilities (data fetching in actions.ts, Prisma client instantiation in prisma.ts, helpers in util.ts).
• prisma/: Database schema (schema.prisma) and migration history.
• public/: Static assets (images, video, manifest, robots.txt).
• Config files: next.config.mjs, tailwind.config.ts, tsconfig.json, .eslintrc.json.
Extract Architectural Insights from the README
• Next.js 14 for SSR/SSG and a fast UX.
• Prisma ORM abstracts the database; Supabase hosts Postgres.
• Emphasis on responsive design, search/filter capabilities, detailed pages for movies/series.
Main Components & Their Interactions
a. Client (Browser)
• Requests pages or JSON data via routes defined in src/app.
• Loads static assets (CSS, images) from the CDN.
b. Next.js Server (Vercel Serverless Functions)
• Handles routing (SSR, SSG).
• Imports lib/actions.ts to fetch data via Prisma.
• Renders React components, injects data into pages.
c. Prisma Layer (lib/prisma.ts)
• Manages database connections.
• Translates TypeScript queries into SQL.
d. Database (Supabase/PostgreSQL)
• Stores movies, series, genres, reviews, users, etc.
• Enforces relationships defined in schema.prisma.
e. CDN / Static Asset Store
• Serves the files in /public (images, videos, manifest).
f. External Services
• Vercel for hosting Next.js.
• Supabase hosting, authentication, and storage (if used).
Architectural Patterns & Design Principles
• Separation of Concerns:
• Presentation layer (React components)
• Data-access layer (Prisma)
• Business logic (lib/actions.ts)
• Serverless/SSR Hybrid: leverages Next.js App Router for both server-rendered and client-navigated paths.
• Modular Components: small, reusable UI components under /components.
• Infrastructure as Code: Prisma migrations define DB schema changes.