# amen-ramadan/saffrny architecture

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

- Interactive diagram: https://gitdiagram.com/amen-ramadan/saffrny
- Repository: https://github.com/amen-ramadan/saffrny

## Overview

##### Project type and purpose
- This is a static, multi‐page front-end application (“سفرني”) for a travel booking platform.
- It provides a homepage, login/register pages, tour details pages, and supports light/dark themes.

##### File structure
- Top-level files:
- package.json & webpack.config.js → build configuration
- README.md → project description and tech stack
- src/ → source code:
- HTML templates (.html) for each page
- scss/ → style sources (variables, theme, components)
- js/ → entry point (index.js)
- images/ → raw assets
- build/ → production output:
- HTML files (index.html, login.html, etc.)
- css/style.css → compiled from SCSS + Bootstrap overrides
- js/ → code-split bundles + main.js
- images/ → optimized assets
- manifest.json → PWA metadata (optional)

##### README
- Tech stack: Webpack, Bootstrap, SCSS, HTML, CSS, jQuery, JavaScript, FontAwesome
- Responsive design, dark/light mode toggle

- Rectangles for components (Source, Build, Host, Client)
- Blue for development (src)
- Green for build pipeline
- Orange for production assets
- Purple for hosting
- Grey for client/browser

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "1. Source Code"
        subgraph "HTML Templates"
            idxHTML["index.html"]:::dev
            loginHTML["login.html"]:::dev
            registerHTML["register.html"]:::dev
            tour1HTML["the-tourist-tour.html"]:::dev
            tour2HTML["the-tourist-tour-2.html"]:::dev
        end
        subgraph "SCSS Modules"
            varSCSS["_variables.scss"]:::dev
            btnSCSS["buttonDarkMode.scss"]:::dev
            styleSCSS["style.scss"]:::dev
            tourSCSS["the-tourist-tour.scss"]:::dev
        end
        jsEntry["index.js"]:::dev
        rawImages["Images (raw)"]:::dev
    end

    subgraph "2. Build Pipeline"
        wpConfig["webpack.config.js"]:::build
        pkgJSON["package.json"]:::build
        pkgLock["package-lock.json"]:::build
        loaders["Loaders:<br/>scss→CSS,<br/>file/url→images,<br/>babel"]:::build
        plugins["Plugins:<br/>HTMLWebpackPlugin,<br/>MiniCssExtract,<br/>manifest injection"]:::build
        bundling["Bundling & Code Splitting"]:::build
    end

    subgraph "3. Production Artifacts"
        subgraph "HTML Pages"
            buildIdx["index.html"]:::prod
            buildLogin["login.html"]:::prod
            buildRegister["register.html"]:::prod
            buildTour1["the-tourist-tour.html"]:::prod
            buildTour2["the-tourist-tour-2.html"]:::prod
        end
        cssBundle["css/style.css"]:::prod
        subgraph "JS Bundles"
            jsMain["js/main.js"]:::prod
            js236["js/236.js"]:::prod
            js283["js/283.js"]:::prod
            js654["js/654.js"]:::prod
        end
        optImages["Optimized Images"]:::prod
        manifest["manifest.json"]:::prod
    end

    subgraph "4. Hosting"
        host["GitHub Pages / CDN"]:::host
        gitignore[".gitignore"]:::host
    end

    subgraph "5. Client"
        browser["User Browser"]:::client
        localStore["Local Storage"]:::client
    end

    %% Connections
    idxHTML -->|"webpack build"| loaders
    loginHTML --> loaders
    registerHTML --> loaders
    tour1HTML --> loaders
    tour2HTML --> loaders

    varSCSS --> loaders
    btnSCSS --> loaders
    styleSCSS --> loaders
    tourSCSS --> loaders

    rawImages --> loaders
    jsEntry --> bundling
    loaders --> bundling
    plugins --> bundling

    bundling -->|outputs HTML| buildIdx
    bundling --> buildLogin
    bundling --> buildRegister
    bundling --> buildTour1
    bundling --> buildTour2
    bundling -->|outputs CSS| cssBundle
    bundling -->|outputs JS| jsMain
    bundling --> js236
    bundling --> js283
    bundling --> js654
    bundling --> optImages
    bundling --> manifest

    buildIdx -->|"git push (deploy)"| host
    buildLogin --> host
    buildRegister --> host
    buildTour1 --> host
    buildTour2 --> host
    cssBundle --> host
    jsMain --> host
    js236 --> host
    js283 --> host
    js654 --> host
    optImages --> host
    manifest --> host
    gitignore --> host

    browser -->|"HTTP GET"| host
    browser -->|"renders HTML/CSS/JS"| buildIdx
    browser --> localStore
    jsMain -->|"theme toggle"| localStore

    %% Click Events
    click idxHTML "https://github.com/amen-ramadan/saffrny/blob/master/src/index.html"
    click loginHTML "https://github.com/amen-ramadan/saffrny/blob/master/src/login.html"
    click registerHTML "https://github.com/amen-ramadan/saffrny/blob/master/src/register.html"
    click tour1HTML "https://github.com/amen-ramadan/saffrny/blob/master/src/the-tourist-tour.html"
    click tour2HTML "https://github.com/amen-ramadan/saffrny/blob/master/src/the-tourist-tour-2.html"
    click varSCSS "https://github.com/amen-ramadan/saffrny/blob/master/src/scss/_variables.scss"
    click btnSCSS "https://github.com/amen-ramadan/saffrny/blob/master/src/scss/buttonDarkMode.scss"
    click styleSCSS "https://github.com/amen-ramadan/saffrny/blob/master/src/scss/style.scss"
    click tourSCSS "https://github.com/amen-ramadan/saffrny/blob/master/src/scss/the-tourist-tour.scss"
    click jsEntry "https://github.com/amen-ramadan/saffrny/blob/master/src/js/index.js"
    click rawImages "https://github.com/amen-ramadan/saffrny/tree/master/src/images/"
    click wpConfig "https://github.com/amen-ramadan/saffrny/blob/master/webpack.config.js"
    click pkgJSON "https://github.com/amen-ramadan/saffrny/blob/master/package.json"
    click pkgLock "https://github.com/amen-ramadan/saffrny/blob/master/package-lock.json"
    click buildIdx "https://github.com/amen-ramadan/saffrny/blob/master/build/index.html"
    click buildLogin "https://github.com/amen-ramadan/saffrny/blob/master/build/login.html"
    click buildRegister "https://github.com/amen-ramadan/saffrny/blob/master/build/register.html"
    click buildTour1 "https://github.com/amen-ramadan/saffrny/blob/master/build/the-tourist-tour.html"
    click buildTour2 "https://github.com/amen-ramadan/saffrny/blob/master/build/the-tourist-tour-2.html"
    click cssBundle "https://github.com/amen-ramadan/saffrny/blob/master/build/css/style.css"
    click jsMain "https://github.com/amen-ramadan/saffrny/blob/master/build/js/main.js"
    click js236 "https://github.com/amen-ramadan/saffrny/blob/master/build/js/236.js"
    click js283 "https://github.com/amen-ramadan/saffrny/blob/master/build/js/283.js"
    click js654 "https://github.com/amen-ramadan/saffrny/blob/master/build/js/654.js"
    click optImages "https://github.com/amen-ramadan/saffrny/tree/master/build/images/"
    click manifest "https://github.com/amen-ramadan/saffrny/blob/master/build/manifest.json"
    click gitignore "https://github.com/amen-ramadan/saffrny/blob/master/.gitignore"

    %% Styles
    classDef dev fill:#cce5ff,stroke:#3399ff,color:#000
    classDef build fill:#d4edda,stroke:#28a745,color:#000
    classDef prod fill:#ffe5b4,stroke:#fd7e14,color:#000
    classDef host fill:#e2d5f5,stroke:#6f42c1,color:#000
    classDef client fill:#e2e3e5,stroke:#6c757d,color:#000
```
