How lunatic2good/netflix works
Project type and purpose
• This is a full-stack “Netflix clone” application.
• The client folder is a React/TypeScript single-page app (built with Vite and Tailwind) that handles UI, state (Redux Toolkit), routing (React Router), and media playback.
• The server folder is an Express/Node.js API that exposes authentication, movie metadata, and subscription endpoints, persists data via Prisma/SQL, and integrates with Stripe for payments.
File structure
• Top-level: “client” and “server” directories.
• client/
• src/pages → high-level routes (HomePage, BrowsePage, etc.)
• src/components → reusable UI (MovieCard, Navbar, etc.)
• src/hooks & src/features → data-fetching and Redux slices (userSlice)
• public/assets → static media (southpark.mp4)
• config files: vite.config.ts, tailwind.config.js, tsconfig.json
• server/
• routes/ → Express endpoints (auth.js, movies.js, sub.js)
• middleware/ → request-level logic (e.g. auth checks)
• services/ & utils/ → business logic (fetchSubscription, Stripe helper)
• prisma/ → schema.prisma, migrations
• db/ & scripts/ → local JSON data and seedMovies.js
• index.js → app entry, connects middleware, routes, Prisma client
Extract insights from README
• README.md only contains “# netflix” but file names and folder structure confirm: a streaming-style frontend with a RESTful backend and subscription billing.
a. Main components:
• Client SPA (React + Redux + Router + Vite)
• API Server (Express + Prisma + Node.js)
• Database (PostgreSQL / MySQL via Prisma ORM)
• External Payment Service (Stripe)
• Static Assets Storage (local public folder or CDN)
b. Relationships & interactions:
• User in browser ↔ Client SPA
• SPA → REST calls to API (auth, fetch movies, manage subscriptions)
• API ↔ Database (CRUD for users, subscriptions, movies)
• API ↔ Stripe (create charges, manage subscriptions)
• Server ↔ Seed script for initial data
c. Architectural patterns & principles:
• Client is decoupled: UI, state, and routing separated into pages, components, hooks.
• Server follows MVC-style organization: routes → controllers/services → data layer (Prisma).
• Use of middleware for cross-cutting concerns (authentication).
• Infrastructure as code: Prisma schema, seed scripts.
d. Key technologies:
• Frontend: React, TypeScript, Redux Toolkit, React Router, Vite, Tailwind CSS
• Backend: Node.js, Express, Prisma ORM, Stripe SDK
• Database: relational (configured via Prisma)
• Build & dev tools: ESLint, PostCSS, Vite, npm scripts