How naren004/fitness_react works
Project type and purpose
• This is a single-page React Fitness Application (“The Gym”) that runs entirely in the browser.
• It displays exercise data (over a thousand entries) fetched from external APIs (via RapidAPI), and integrates YouTube video results.
• It is built with React, hosted on Firebase Hosting, and uses GitHub Actions for CI/CD.
File structure
• Top-level folders and files
• public/ – static assets and index.html
• src/ – React source code
• .github/workflows – CI/CD pipeline definition
• firebase.json, .firebaserc – Firebase Hosting configuration
• package.json, package-lock.json – Node/npm dependencies and scripts
• .env – environment variables (API keys)
• src/ substructure
• src/pages – top-level pages: Home, ExerciseDetail
• src/components – reusable UI components (Navbar, Footer, ExerciseCard, etc.)
• src/utils/fetchData.js – HTTP client wrapper to call external APIs
Key insights from README
• Uses React for the UI
• Data and video content powered by RapidAPI (exercise database and YouTube)
• Hosted live at a Firebase URL
• No custom backend—pure frontend + external services
Blueprint
a. Main components
• Developer & GitHub repository
• GitHub Actions CI/CD workflow
• Firebase Hosting & CDN
• Client browser (end user)
• React application (static bundle)
– Modules: Routing layer (App.js)
– Pages: Home, ExerciseDetail
– UI components: Navbar, BodyPart, ExerciseCard, Loader, etc.
– Utility layer: fetchData.js
• External services
– Exercise database API (RapidAPI)
– YouTube Data API (RapidAPI)
b. Relationships and data flows
• Developer pushes code to GitHub → triggers GitHub Actions → builds and deploys to Firebase Hosting
• User’s browser requests the app → Firebase CDN serves static bundle
• React app initializes in browser → user interacts with pages/components → fetchData utility sends HTTP requests to external APIs → UI components render data and videos
c. Architectural patterns and design principles
• Component-based UI (React) with clear separation: pages vs. reusable components vs. utilities
• Static-hosting architecture—no custom server code
• External API integration abstracted behind a fetchData helper
• CI/CD pipeline for automated build & deployment
d. Key technologies and frameworks
• React (UI library)
• Node.js/npm (build and dependency management)
• GitHub Actions (CI/CD)
• Firebase Hosting (static site hosting + CDN)
• RapidAPI (third-party data services)