How jannickleismann/react-moviedux works
Project type and purpose
• This is a single-page application (SPA) built with React (bootstrapped via Create React App).
• Its purpose is to render a grid of movies (from a local JSON file) and allow users to manage a watchlist.
File structure
• Top-level files: package.json / package-lock.json (Node.js + npm), README.md, .gitignore
• public/
• index.html, manifest.json, robots.txt – static HTML + PWA metadata
• movies.json – local data source
• images/ – static assets
• src/
• index.js, App.js – React entry point & root component
• components/ – UI building blocks (Header, Footer, MoviesGrid, MovieCard, Watchlist)
• CSS files – global and component styling
• test files and web vitals/performance stubs
• Build scripts are hidden (managed by CRA’s webpack/Babel configs). The app runs in dev via webpack-dev-server and in production via a static build.
README
• Confirms standard CRA scripts (start, build, test, eject)
• No custom backend or external API integration—data is served from movies.json (static).
a. Main components:
1. Developer environment (Node.js + npm)
2. Build system (webpack/Babel via Create React App)
3. Static host / CDN (serves build/ assets)
4. Browser (client)
5. React App – root (App.js)
6. UI components (Header, Footer, MoviesGrid, MovieCard, Watchlist)
7. Data source – movies.json in public/
b. Relationships & data flow:
• Developer edits src/ → npm start launches webpack-dev-server → serves bundle → Browser loads index.html + JS/CSS → React mounts App
• App fetches movies.json → populates state → renders MoviesGrid → MovieCard
• User actions (add/remove watchlist) update React state and localStorage (if implemented)
• npm run build produces optimized static files → deploy to static host/CDN → end users access the same flow in production
c. Architectural patterns & design principles:
• Component-based architecture (React)
• Single source of truth (App.js or context state managing movie list + watchlist)
• Unidirectional data flow (parent App → child components → callbacks → state updates)
• Separation of concerns: public/ for static assets, src/ for code
d. Key technologies & frameworks:
• React (create-react-app)
• Webpack + Babel (abstracted by CRA)
• npm scripts (start, build, test)
• HTML5 manifest (PWA readiness)
• CSS modules or global styles (plain CSS)