How prabhjot-arora31/amazonprimefrontend works
Project Type & Purpose
• From the README and file tree, this is a front-end single-page application for browsing movies, built with React, Vite, and Redux.
• It loads static JSON data (in src/data) to render lists, details, trailers, and user-related screens (Login/Register/Profile).
File Structure
• Top-level: index.html (entry point), vite.config.js (build tool), vercel.json (deployment), package.json
• src/main.jsx → mounts <App />
• src/App.jsx + router/route-based screens under src/screens
• src/components: reusable UI pieces (Header, Carousel, Spotlight, Trailer, etc.)
• src/redux: Flux/Redux store, actions, reducers, constants
• src/data: local JSON files + data_converter.js (data layer)
• public: static assets and redirects
Extract Architecture Insights from README
• Minimal React + Vite setup with fast HMR via Babel or SWC plugin
• No backend API—static JSON files act as data source
• Deployed on Vercel (vercel.json)
Main Components & Their Relationships
a. Browser / Client
• Makes initial HTTP GET to serve index.html and JS bundles from Vercel (or dev server)
b. Build Pipeline & Hosting
• Vite dev server during development
• Vite build → static assets → deployed via Vercel
c. React Single-Page App
• main.jsx initializes Redux store & ReactDOM.render(<App />)
• App.jsx configures React Router to load screens
d. Redux Store (src/redux/store.js)
• Reducers for movies, user, mobile header
• Actions dispatch from UI to update state
e. Data Layer
• data_converter.js transforms JSON files under src/data
• Components & screens import JSON directly or via converter
f. UI Components & Screens
• Screens (Home, MoviesList, MovieDetail, Trailer, WatchMovie, Login, Register, Profile)
• Shared Components (Header, Carousel, Spotlight, TrailerCard, etc.)
Important Patterns & Principles
• SPA with client-side routing (React Router)
• Flux architecture (Redux): unidirectional data flow
• Component-based design: separation of layout (Header, Hero) vs feature screens
• Static asset hosting; no separate backend
• “Routing Layer” (React Router) → connects paths to screens