# user-danio/sabores-de-japon architecture

> Architecture diagram of the GitHub repository user-danio/sabores-de-japon, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/user-danio/sabores-de-japon
- Repository: https://github.com/user-danio/sabores-de-japon

## Overview

##### Project type and purpose
- This is a purely front-end, static website project (“Sabores de Japón”) built with HTML, CSS, and JavaScript.
- It uses PostHTML (via the .posthtmlrc file and npm scripts) to process templates and assets in src/ and emits a ready-to-serve site in docs/.

##### File structure
- Top-level:
- package.json / package-lock.json: Node.js dependencies & build scripts
- .posthtmlrc: configuration for the PostHTML templating pipeline
- src/: source templates, styles, components, scripts, and assets
- docs/: the compiled output (HTML, CSS, JS bundles) ready for deployment
- Inside src/:
- assets/images: static image files
- components/: reusable fragments (header, footer, portada/bento) with CSS + HTML templates
- pages/: page-level CSS + HTML (index, categoria, detalle, enlaces)
- js/: page-specific JavaScript (detalle.js, recetas.js)
- styles/: global styles.css

##### README
- Confirms it is an assignment (“PEC1 de Herramientas HTML y CSS”) and the author

##### Main components and their relationships
a. Source code (src/)
b. Build pipeline (npm scripts + PostHTML)
c. Output site (docs/)
d. Client (web browser)
e. External services: none

Flow:
src/ ──(PostHTML & npm scripts)──▶ docs/ ──▶ Browser

##### Key architectural patterns & design principles
- Component-based HTML (header, footer, bento)
- Static site generation (SSG) using PostHTML
- Separation of concerns: “components” vs. “pages” vs. “styles” vs. “scripts”
- Directory-based routing: each page in src/pages/ compiles to docs/pages

##### Technologies, frameworks, libraries
- Node.js & npm (package.json scripts)
- PostHTML for HTML processing
- Standard CSS & vanilla JavaScript
- No backend or dynamic data layer

##### What
- Clear labels on each folder/component
- Build & configuration (green gear)
- Output (gray folder)
- Call out key files: .posthtmlrc, package.json, docs/index.html

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Source Layer
    subgraph "Source (src/)"
        direction TB
        srcComponents["Components"]:::source
        subgraph Components
            direction TB
            headerHTML["header.html"]:::source
            headerCSS["header.css"]:::source
            footerHTML["footer.html"]:::source
            footerCSS["footer.css"]:::source
            bentoHTML["bento.html"]:::source
            bentoCSS["bento.css"]:::source
        end
        srcPages["Pages"]:::source
        subgraph Pages
            direction TB
            index["index.html"]:::source
            categoriaHTML["categoria.html"]:::source
            categoriaCSS["categoria.css"]:::source
            detalleHTML["detalle.html"]:::source
            detalleCSS["detalle.css"]:::source
            enlacesHTML["enlaces.html"]:::source
            enlacesCSS["enlaces.css"]:::source
        end
        assets["assets/images/"]:::source
        styles["styles.css"]:::source
        detalleJS["detalle.js"]:::source
        recetasJS["recetas.js"]:::source
    end

    %% Build Pipeline
    subgraph "Build Pipeline"
        direction TB
        buildTool["npm run build / PostHTML"]:::build
        posthtmlConfig[".posthtmlrc"]:::build
        npmConfig["package.json & package-lock.json"]:::build
    end

    %% Output Layer
    subgraph "Output (docs/)"
        direction TB
        docsRoot["docs/"]:::output
        outIndex["index.html"]:::output
        outCategoria["categoria.html"]:::output
        outDetalle["detalle.html"]:::output
        outEnlaces["enlaces.html"]:::output
        outScripts["*.js & *.js.map"]:::output
        outStyles["*.css & *.css.map"]:::output
    end

    %% Client
    client["Web Browser"]:::client

    %% Flow Connections
    headerHTML -->|part of src| srcComponents
    headerCSS -->|part of src| srcComponents
    footerHTML -->|part of src| srcComponents
    footerCSS -->|part of src| srcComponents
    bentoHTML -->|part of src| srcComponents
    bentoCSS -->|part of src| srcComponents

    index -->|part of src| srcPages
    categoriaHTML -->|part of src| srcPages
    categoriaCSS -->|part of src| srcPages
    detalleHTML -->|part of src| srcPages
    detalleCSS -->|part of src| srcPages
    enlacesHTML -->|part of src| srcPages
    enlacesCSS -->|part of src| srcPages

    assets -->|assets folder| src
    styles -->|styles file| src
    detalleJS -->|script file| src
    recetasJS -->|script file| src

    srcComponents -->|source| buildTool
    srcPages -->|source| buildTool
    assets -->|source| buildTool
    styles -->|source| buildTool
    detalleJS -->|source| buildTool
    recetasJS -->|source| buildTool

    buildTool -->|outputs to| docsRoot
    posthtmlConfig -->|configures| buildTool
    npmConfig -->|runs| buildTool

    docsRoot -->|contains| outIndex
    docsRoot -->|contains| outCategoria
    docsRoot -->|contains| outDetalle
    docsRoot -->|contains| outEnlaces
    docsRoot -->|contains| outScripts
    docsRoot -->|contains| outStyles

    outIndex -->|served via HTTP GET| client
    outCategoria -->|served via HTTP GET| client
    outDetalle -->|served via HTTP GET| client
    outEnlaces -->|served via HTTP GET| client
    outScripts -->|served via HTTP GET| client
    outStyles -->|served via HTTP GET| client

    %% Click Events
    click headerHTML "https://github.com/user-danio/sabores-de-japon/blob/main/src/components/header/header.html"
    click headerCSS "https://github.com/user-danio/sabores-de-japon/blob/main/src/components/header/header.css"
    click footerHTML "https://github.com/user-danio/sabores-de-japon/blob/main/src/components/footer/footer.html"
    click footerCSS "https://github.com/user-danio/sabores-de-japon/blob/main/src/components/footer/footer.css"
    click bentoHTML "https://github.com/user-danio/sabores-de-japon/blob/main/src/components/portada/bento/bento.html"
    click bentoCSS "https://github.com/user-danio/sabores-de-japon/blob/main/src/components/portada/bento/bento.css"
    click index "https://github.com/user-danio/sabores-de-japon/blob/main/src/pages/index.html"
    click categoriaHTML "https://github.com/user-danio/sabores-de-japon/blob/main/src/pages/categoria.html"
    click categoriaCSS "https://github.com/user-danio/sabores-de-japon/blob/main/src/pages/categoria.css"
    click detalleHTML "https://github.com/user-danio/sabores-de-japon/blob/main/src/pages/detalle.html"
    click detalleCSS "https://github.com/user-danio/sabores-de-japon/blob/main/src/pages/detalle.css"
    click enlacesHTML "https://github.com/user-danio/sabores-de-japon/blob/main/src/pages/enlaces.html"
    click enlacesCSS "https://github.com/user-danio/sabores-de-japon/blob/main/src/pages/enlaces.css"
    click styles "https://github.com/user-danio/sabores-de-japon/blob/main/src/styles/styles.css"
    click detalleJS "https://github.com/user-danio/sabores-de-japon/blob/main/src/js/detalle.js"
    click recetasJS "https://github.com/user-danio/sabores-de-japon/blob/main/src/js/recetas.js"
    click assets "https://github.com/user-danio/sabores-de-japon/tree/main/src/assets/images/"
    click posthtmlConfig "https://github.com/user-danio/sabores-de-japon/blob/main/.posthtmlrc"
    click npmConfig "https://github.com/user-danio/sabores-de-japon/blob/main/package.json"
    click docsRoot "https://github.com/user-danio/sabores-de-japon/tree/main/docs/"
    click outIndex "https://github.com/user-danio/sabores-de-japon/blob/main/docs/index.html"

    %% Styles
    classDef source fill:#cce5ff,stroke:#004085,color:#004085
    classDef build fill:#d4edda,stroke:#155724,color:#155724
    classDef output fill:#e2e3e5,stroke:#6c757d,color:#6c757d
    classDef client fill:#fff3cd,stroke:#856404,color:#856404
```
