How mfing26/webdevelopmentprojects works
Project Type and Purpose
• This repo contains two front-end projects:
a. “Simple HTML Webpages” – a pure static site (Home, Add-Product, Product) for a fictional skincare brand.
b. “my-app” – a Create-React-App single‐page application (SPA) that displays happiness rankings fetched from an external API.
File Structure
• Top level:
• README.md (overall description)
• React/my-app (CRA project)
• Simple HTML Webpages (static pages)
• “Simple HTML Webpages”:
• index.html, add-product.html, product.html
• /css for page styles
• /images for assets
• “my-app”:
• public/ for static HTML shell (index.html, manifest, robots.txt)
• src/
– components/ (Footer, NavBar, SpotlightCard, SplitText) – reusable UI blocks
– pages/ (HomePage, FilterPage, FactorsPage, LoginPage, RegisterPage) – routed views
– services/api.js – HTTP client for external “Happiness Rankings” API
– assets/, css/, styles.css – images and styling
– index.js, App.js – app bootstrap and root component
README for Additional Insights
• Confirms that:
• Static site is purely client-side.
• React app is a front-end only SPA with no custom backend—data comes from a third-party API.
a. Main Components
1. User’s Web Browser (entry point)
2. Static Web Server (serves both projects as static assets)
– Simple HTML Pages
– React App (public/ + bundled src/)
3. SPA Subsystems (inside the React App)
• Routing Layer (React Router serving pages)
• Page Components (pages/*.js)
• UI Components (components/*.js)
• Styles & Assets (css/, assets/)
• API Service (services/api.js)
4. External Service – “Happiness Rankings API”
b. Relationships and Data Flow
• Browser → Web Server: requests HTML/CSS/JS for either the static site or SPA.
• SPA (in-browser) → External API: fetches JSON data via services/api.js.
• SPA’s Service Layer → UI: passes fetched data to Page Components → renders via UI Components.
c. Architectural Patterns & Principles
• Static-site hosting model for Simple HTML – no dynamic backend.
• SPA architecture for React:
• Unidirectional data flow (Service → Page → Component)
• Separation of concerns: components vs. pages vs. services
• Client-side routing (single index.html)
d. Key Technologies
• HTML/CSS/JS (static pages)
• React, ReactDOM, React Router
• Axios or fetch in services/api.js
• CSS modules or global styles (css/, styles.css)