How wpcodevo/lc26-food-delivery-website works
Project type and purpose
• This is a static, responsive front-end website for a food-delivery service.
• It consists of plain HTML, CSS (compiled from SCSS), JavaScript modules, and two JSON files as data sources (products & testimonials).
File structure
├─ css/ ← Compiled CSS + source maps
├─ scss/ ← Source styles, compiled into css/
├─ js/ ← Front-end logic split into modules
│ ├─ main.js ← Core initialization & shared routines
│ ├─ products.js ← Fetch & render product list from data/products.json
│ └─ testimonial.js ← Fetch & render testimonials from data/testimonials.json
├─ data/ ← Static JSON data stores
│ ├─ products.json
│ └─ testimonials.json
└─ index.html ← Single-page entry point
Key insights from README
• HTML/CSS/JS only, no back-end or database.
• Uses client-side rendering: JS fetches local JSON.
• SCSS as preprocessor → build step to generate final CSS.
Main components
a. Browser (Client)
• Renders index.html
• Loads CSS & JS assets
• Executes JavaScript modules
• Performs AJAX/fetch to local JSON
b. Static Asset Server (could be GitHub Pages / Netlify / S3)
• Serves index.html, CSS, JS, images, JSON files
c. Build Pipeline (dev toolchain)
• SCSS compiler → css/styles.css + map
• Optional JS bundler or simply module loader
• Pre-deployment step
Relationships & data flows
1. User → Browser: types URL
2. Browser → Server: GET index.html
3. Server → Browser: HTML response
4. Browser parses HTML → issues GET requests for CSS, JS, images
5. Browser → Server: GET data/products.json & data/testimonials.json via fetch()
6. Browser uses fetched JSON to render dynamic UI
Architectural patterns and design principles
• Single-Page Application (SPA) pattern (client-only, no page reloads)
• Module separation: each JS file handles one concern
• Preprocessor pipeline: SCSS → CSS for style maintainability
Technologies & frameworks
• HTML5, SCSS (node-sass or Dart Sass), plain JavaScript (ES6 modules)
• No front-end framework (React/Vue/Angular)
• Hosting: any static file server or CDN