How mohamed-el-haddioui/movie-catalog-react works
Project Type and Purpose
• This is a single-page application (SPA) built entirely in React.js.
• Its purpose is to allow users to browse, search, filter, and view details of movies, with secure user authentication via Okta.
File Structure
• Top-level folders:
• public/ – static assets and the HTML shell
• src/ – all React source code
• src/pages/ – high-level route targets (home page, login page, Okta callback).
• src/App.js – root React component that configures routing and global layout.
• src/index.js – application entry point; mounts <App> into public/index.html.
• .env – environment variables for Okta client ID and Issuer.
README for Additional Insights
• Architecture: React + React Router, Okta for auth, Bootstrap/React-Bootstrap for styling, AG Grid for data display, Universal Cookie for token storage.
• No backend code in this repo—external services supply authentication (Okta) and movie data (presumably a third-party movie API).
Main Components and Their Interactions
a. Browser / User Agent
b. Static Hosting (CDN or web server serving public/ build artifacts)
c. React SPA
• Routing Layer (React Router)
• UI Components: Navbar, SearchBox, Movies (powered by AG Grid), MovieDetails
• State Management: React useState/useEffect hooks
• Styling: Bootstrap & React-Bootstrap
• Cookie Management: Universal Cookie
d. Authentication Service: Okta
• Login page → redirect to Okta hosted login
• ImplicitCallback page → Okta OAuth callback → extract tokens → store in cookies
e. External Movie Data API (e.g., TMDB)
• Endpoints for search, movie detail
f. (Optional) Analytics / Logging / Monitoring (e.g., Google Analytics)
Architectural Patterns and Design Principles
• Component-based UI promotes reuse and separation of concerns.
• SPA routing for deep-linking.
• OAuth2/OIDC implicit flow for authentication.
• Single responsibility: pages orchestrate, components render.
• Externalize configuration via environment variables.