How yogeshdevnani/movie-recommendation-app works
Project type and purpose
• This is a single-page application (SPA) built with React and Vite.
• It’s strictly a front-end client that fetches movie data from an external API at runtime.
• It’s deployed as a static site on Azure Web Apps and updated via GitHub Actions.
File structure
Top-level entries:
• index.html, public, src, vite.config.js → a client-side Vite/React build.
• src/components → component hierarchy (Navbar, MovieSelector, InfoCard, MovieRecommendation, LoadingAnimation).
• src/pages → routed pages (HomePage, AboutPage).
• src/utils/backendWarmup.js → a small utility that pings (“warms up”) the remote API or Azure function.
• .github/workflows/main_movie-recommendation-app.yml → CI/CD pipeline.
Important README insights
• Tech stack: React.js, Vite, JS (ES6+), CSS3.
• Hosted on Azure Web Apps.
• Live: static front-end that retrieves data at runtime via HTTP GET calls.
Main components
A. Developer & Source Repository
• Contains code, workflow config (.github/workflows)
B. CI/CD Pipeline
• GitHub Actions runner (main_movie-recommendation-app.yml)
• Build step: “npm install”, “npm run build” (Vite)
• Deploy step: deploy artifacts to Azure Web Apps
C. Hosting / Runtime
• Azure Web Apps (Static Site)
• Serves index.html & built JS/CSS bundle
D. Client / Browser
• Browser runs the React SPA
• React Router handles HomePage / AboutPage
• Components (MovieSelector → InfoCard / MovieRecommendation / LoadingAnimation)
• Calls src/utils/backendWarmup.js at startup (optional warm-up)
E. External Movie Data API
• e.g., OMDB API or similar
• HTTP endpoints for movie search, details, recommendations
Relationships & data flows
1. Developer pushes code → GitHub repo
2. GitHub Actions builds and deploys to Azure Web Apps
3. User’s browser requests the SPA from Azure Web Apps
4. SPA initializes, optionally triggers backendWarmup ping to external API
5. User interacts with the UI (MovieSelector) → SPA sends fetch requests to External API
6. External API responds with movie data → SPA updates components (InfoCard, MovieRecommendation, etc.)
Architectural patterns & design principles
• Single-page application with component-based UI (React)
• Clear separation of concerns:
• Build/CI (GitHub Actions)
• Hosting/Serving static assets (Azure Web Apps)
• Runtime data provider (External API)
• Utility script to reduce cold-start latency (backendWarmup.js)
Don’t omit these essential elements
• Arrowheads showing direction of data flow
• Notes on the build process (npm install, vite build) and deployment target (Azure Web Apps)
• Optional: version of React/Vite, location of routing logic, and warm-up endpoint