# wpcodevo/lc26-food-delivery-website architecture

> Architecture diagram of the GitHub repository wpcodevo/lc26-food-delivery-website, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wpcodevo/lc26-food-delivery-website
- Repository: https://github.com/wpcodevo/lc26-food-delivery-website

## Overview

##### 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

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Build Pipeline"
        SCSS["SCSS Source (styles.scss)"]:::pipeline
        CSScss["css/styles.css"]:::server
        CSSmap["css/styles.css.map"]:::server
    end

    subgraph "Static Asset Server"
        HTML["index.html"]:::server
        CSSfolder["css/"]:::server
        JSfolder["js/"]:::server
        IMG["images/"]:::server
        subgraph "data"
            ProdData["products.json"]:::data
            TestData["testimonials.json"]:::data
        end
    end

    Browser["Browser (Client)"]:::client

    SCSS -->|"compile"| CSScss
    SCSS -->|"compile"| CSSmap
    CSScss -->|"deploy"| CSSfolder
    CSSmap -->|"deploy"| CSSfolder

    HTML -->|"serves"| Browser
    CSSfolder -->|"serves"| Browser
    JSfolder -->|"serves"| Browser
    IMG -->|"serves"| Browser

    Browser -->|"fetch products.json"| ProdData
    Browser -->|"fetch testimonials.json"| TestData

    classDef client fill:#D6EAFE,stroke:#0366D6
    classDef server fill:#EDF8ED,stroke:#22863A
    classDef pipeline fill:#F0F0F0,stroke:#6A737D
    classDef data fill:#FFF5B1,stroke:#735C0F

    click SCSS "https://github.com/wpcodevo/lc26-food-delivery-website/blob/master/scss/styles.scss"
    click CSScss "https://github.com/wpcodevo/lc26-food-delivery-website/blob/master/css/styles.css"
    click CSSmap "https://github.com/wpcodevo/lc26-food-delivery-website/blob/master/css/styles.css.map"
    click HTML "https://github.com/wpcodevo/lc26-food-delivery-website/blob/master/index.html"
    click CSSfolder "https://github.com/wpcodevo/lc26-food-delivery-website/tree/master/css/"
    click JSfolder "https://github.com/wpcodevo/lc26-food-delivery-website/tree/master/js/"
    click IMG "https://github.com/wpcodevo/lc26-food-delivery-website/tree/master/images/"
    click ProdData "https://github.com/wpcodevo/lc26-food-delivery-website/blob/master/data/products.json"
    click TestData "https://github.com/wpcodevo/lc26-food-delivery-website/blob/master/data/testimonials.json"
```
