# dhvaniparghi2003/sushiman-frontend architecture

> Architecture diagram of the GitHub repository dhvaniparghi2003/sushiman-frontend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dhvaniparghi2003/sushiman-frontend
- Repository: https://github.com/dhvaniparghi2003/sushiman-frontend

## Overview

##### Project type and purpose
- This is a frontend-only, single-page marketing/landing site (“Sushi Website”) built with HTML, CSS, and vanilla JS. It uses Vite as a dev/build tool.
- Purpose: showcase sushi menu sections (hero, about, popular, trending, subscribe, footer), with responsive layouts, CSS animations, BEM naming, and JS-driven HTML rendering helpers.

##### File structure
- index.html – entry point
- assets/ – images and static assets
- css/
– style.css (global variables, resets)
– sections/*.css (modular styles per page section)
- js/script.js – DOM-rendering functions and any interactive logic
- package.json & package-lock.json – Vite configuration and dependency declarations
- public/ – static directory for Vite to copy as-is

##### Key README insights
- Tech stack: HTML5, CSS3, Vite
- Features: CSS variables, modular imports, BEM, responsive design, subtle animations, JS rendering of HTML
- No backend or external APIs

##### Main components
a. Developer environment
- IDE / code
- Node.js & npm (install & run)
- Vite (dev server & build pipeline)
b. Build & deploy pipeline
- Vite dev server → serves index.html + CSS/JS modules
- Vite build → outputs optimized static assets
- Static host (e.g., Netlify, GitHub Pages)
c. Client (Browser)
- Requests index.html
- Loads CSS modules (global + sections)
- Loads JS scripts (script.js)
- JS renders any dynamic HTML sections
d. File module structure
- HTML structure (nav, hero, about, popular, trending, subscribe, footer)
- CSS variables & section-level styles
- JS rendering functions

##### Relationships & interactions
- Developer edits code → Vite watches → rebuilds on change → browser hot-reload
- Browser HTTP GET → index.html → resolves imports of CSS & JS
- CSS variable definitions cascade into section styles
- script.js executes, injecting or manipulating DOM sections
- Media queries in CSS ensure responsive layouts

##### Architectural patterns & design principles
- Modular CSS: section-based files, BEM naming
- CSS variables for theme/configuration
- Separation of concerns: index.html (structure) vs. CSS (presentation) vs. JS (behavior)
- Static site + build pipeline (Vite)

##### Callouts
- CSS Variables layer feeding into each section’s style
- BEM methodology used in class names
- That Vite performs module bundling and hot module replacement in dev mode

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Development Lane
    subgraph "Development Environment"
        direction TB
        IDE["IDE / Code Editor"]:::tools
        NPM["Node.js & npm"]:::tools
        VDev["Vite Dev Server"]:::tools
        VBuild["Vite Build Pipeline"]:::tools
        IDE --> NPM
        NPM -->|"npm run dev"| VDev
        NPM -->|"npm run build"| VBuild
    end

    %% Runtime Lane
    subgraph "Runtime Environment"
        direction TB
        StaticHost["Static Host\n(Netlify/GitHub Pages)"]:::runtime
        Browser["Browser Client"]:::runtime
        VBuild --> StaticHost
        StaticHost -->|"HTTP GET"| Browser
        VDev -->|"HTTP GET"| Browser
    end

    %% Browser Internal Modules
    subgraph Browser_Internal["Browser Client"]
        direction TB
        HTML["index.html"]:::assets
        CSSGlobal["Global CSS\n(css/style.css)"]:::assets
        CSSHeader["Header Styles\n(css/sections/header.css)"]:::assets
        CSSHero["Hero Styles\n(css/sections/hero.css)"]:::assets
        CSSAbout["About Styles\n(css/sections/about.css)"]:::assets
        CSSPopular["Popular Styles\n(css/sections/popular.css)"]:::assets
        CSSTrending["Trending Styles\n(css/sections/trending.css)"]:::assets
        CSSSubscribe["Subscribe Styles\n(css/sections/subscribe.css)"]:::assets
        CSSFooter["Footer Styles\n(css/sections/footer.css)"]:::assets
        JS["script.js\n(js/script.js)"]:::assets

        Browser --> HTML
        HTML -->|"import CSS"| CSSGlobal
        HTML --> CSSHeader
        HTML --> CSSHero
        HTML --> CSSAbout
        HTML --> CSSPopular
        HTML --> CSSTrending
        HTML --> CSSSubscribe
        HTML --> CSSFooter
        HTML -->|"import JS"| JS

        CSSGlobal -->|"defines variables"| CSSHeader
        CSSGlobal --> CSSHero
        CSSGlobal --> CSSAbout
        CSSGlobal --> CSSPopular
        CSSGlobal --> CSSTrending
        CSSGlobal --> CSSSubscribe
        CSSGlobal --> CSSFooter

        JS -->|"renders/manipulates DOM"| HTML
    end

    %% Static Assets
    assetsFolder["Static Assets\n(assets/)"]:::assets
    publicFolder["Public Directory\n(public/)"]:::assets
    packageJSON["package.json"]:::assets
    lockfile["package-lock.json"]:::assets
    readme["README.md"]:::assets

    VDev --> assetsFolder
    VDev --> publicFolder
    VBuild --> assetsFolder
    VBuild --> publicFolder

    %% Click Events
    click HTML "https://github.com/dhvaniparghi2003/sushiman-frontend/blob/main/index.html"
    click CSSGlobal "https://github.com/dhvaniparghi2003/sushiman-frontend/blob/main/css/style.css"
    click CSSHeader "https://github.com/dhvaniparghi2003/sushiman-frontend/blob/main/css/sections/header.css"
    click CSSHero "https://github.com/dhvaniparghi2003/sushiman-frontend/blob/main/css/sections/hero.css"
    click CSSAbout "https://github.com/dhvaniparghi2003/sushiman-frontend/blob/main/css/sections/about.css"
    click CSSPopular "https://github.com/dhvaniparghi2003/sushiman-frontend/blob/main/css/sections/popular.css"
    click CSSTrending "https://github.com/dhvaniparghi2003/sushiman-frontend/blob/main/css/sections/trending.css"
    click CSSSubscribe "https://github.com/dhvaniparghi2003/sushiman-frontend/blob/main/css/sections/subscribe.css"
    click CSSFooter "https://github.com/dhvaniparghi2003/sushiman-frontend/blob/main/css/sections/footer.css"
    click JS "https://github.com/dhvaniparghi2003/sushiman-frontend/blob/main/js/script.js"
    click assetsFolder "https://github.com/dhvaniparghi2003/sushiman-frontend/tree/main/assets/"
    click publicFolder "https://github.com/dhvaniparghi2003/sushiman-frontend/tree/main/public/"
    click packageJSON "https://github.com/dhvaniparghi2003/sushiman-frontend/blob/main/package.json"
    click lockfile "https://github.com/dhvaniparghi2003/sushiman-frontend/blob/main/package-lock.json"
    click readme "https://github.com/dhvaniparghi2003/sushiman-frontend/blob/main/README.md"

    %% Styles
    classDef tools fill:#D6EAF8,stroke:#2980B9,color:#1B4F72
    classDef assets fill:#D5F5E3,stroke:#27AE60,color:#145A32
    classDef runtime fill:#FDEBD0,stroke:#E67E22,color:#873600
```
