# rasyaakbar/staticwebbuilder architecture

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

- Interactive diagram: https://gitdiagram.com/rasyaakbar/staticwebbuilder
- Repository: https://github.com/rasyaakbar/staticwebbuilder

## Overview

##### Project type and purpose
- This is a Next.js-based, frontend-only static site “Web Builder.”
- It exposes a visual funnel/page editor UI (no backend). You build and export static pages.

##### File structure
- Top-level config & tooling
- next.config.ts, tsconfig.json, tailwind.config.ts, eslint.config.mjs, package.json
- .github/workflows/nextjs.yml handles CI/CD for static deploy
- Public assets
- public/assets → hosted statically
- Next.js “app” folder (App Router)
- src/app/layout.tsx, page.tsx and global CSS
- src/app/_components → visual editor sub-system
- Reusable UI library
- src/components/ui → buttons, dialogs, forms, etc.
- src/components/loading.tsx
- State & behavior
- src/providers/editor → React context, editor-actions, provider component
- src/hooks/use-mobile.tsx → viewport detection
- Utilities & types
- src/lib/constants.ts, types.ts, utils.ts

##### README for additional insights
- “Modifying Web Builder to work without the backend, only deploying Front-end part. Very useful to build static website.”
- Confirms static-only, no data persists server-side. All state lives in client memory or is downloaded/uploaded by the user.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Deployment Layer
    subgraph "Deployment Layer"
        CDN["Static Hosting / CDN"]:::infra
        CI["CI/CD Workflow"]:::infra
        click CI "https://github.com/rasyaakbar/staticwebbuilder/blob/main/.github/workflows/nextjs.yml"
        publicAssets["Public Assets\n(public/assets)"]:::infra
        CDN -->|"HTTP GET static assets"| Browser
    end

    Browser["Browser (End User)"]:::user
    Browser -->|interacts with| Layout

    %% Runtime Layer
    subgraph "Runtime Layer (Next.js App)"
        Layout["layout.tsx"]:::runtime
        click Layout "https://github.com/rasyaakbar/staticwebbuilder/blob/main/src/app/layout.tsx"
        Page["page.tsx"]:::runtime
        click Page "https://github.com/rasyaakbar/staticwebbuilder/blob/main/src/app/page.tsx"
    end
    Layout -->|"renders"| Page
    Page -->|"hydrates App Shell"| Browser

    %% UI Sub-systems
    subgraph "Funnel Editor UI"
        Nav["Navigation"]:::ui
        click Nav "https://github.com/rasyaakbar/staticwebbuilder/blob/main/src/app/_components/funnel-editor-navigation.tsx"
        Core["Editor Core"]:::ui
        click Core "https://github.com/rasyaakbar/staticwebbuilder/blob/main/src/app/_components/funnel-editor/index.tsx"

        subgraph "Components Library"
            compPlace["Editor Component\nPlaceholders"]:::ui
            click compPlace "https://github.com/rasyaakbar/staticwebbuilder/tree/main/src/app/_components/funnel-editor/funnel-editor-components"
        end

        subgraph "Sidebar"
            Sidebar["Sidebar Container"]:::ui
            click Sidebar "https://github.com/rasyaakbar/staticwebbuilder/tree/main/src/app/_components/funnel-editor-sidebar"
            subgraph "Tabs"
                CompTab["Components Tab"]:::ui
                click CompTab "https://github.com/rasyaakbar/staticwebbuilder/blob/main/src/app/_components/funnel-editor-sidebar/tabs/components-tab/index.tsx"
                LayersTab["Layers Tab"]:::ui
                click LayersTab "https://github.com/rasyaakbar/staticwebbuilder/blob/main/src/app/_components/funnel-editor-sidebar/tabs/layers-tab/index.tsx"
                MediaTab["Media Bucket Tab"]:::ui
                click MediaTab "https://github.com/rasyaakbar/staticwebbuilder/blob/main/src/app/_components/funnel-editor-sidebar/tabs/media-bucket-tab.tsx"
                SettingsTab["Settings Tab"]:::ui
                click SettingsTab "https://github.com/rasyaakbar/staticwebbuilder/blob/main/src/app/_components/funnel-editor-sidebar/tabs/settings-tab.tsx"
            end
        end
    end

    Page -->|loads editor UI| Nav
    Page -->|loads editor UI| Core
    Core --> compPlace
    Core --> Sidebar

    %% UI Component Library
    subgraph "UI Component Library"
        UIControls["Controls\n(buttons, dialogs)"]:::component
        click UIControls "https://github.com/rasyaakbar/staticwebbuilder/tree/main/src/components/ui"
        Loading["Loading Component"]:::component
        click Loading "https://github.com/rasyaakbar/staticwebbuilder/blob/main/src/components/loading.tsx"
    end
    UIControls --> Core
    Loading --> Core

    %% State & Logic
    subgraph "State & Logic"
        Provider["EditorProvider\n(React Context)"]:::state
        click Provider "https://github.com/rasyaakbar/staticwebbuilder/blob/main/src/providers/editor/editor-provider.tsx"
        Actions["Editor Actions"]:::state
        click Actions "https://github.com/rasyaakbar/staticwebbuilder/blob/main/src/providers/editor/editor-actions.tsx"
    end
    Core -->|dispatch action| Actions
    Nav -->|dispatch action| Actions
    Actions -->|update state| Provider
    Provider -->|provides context| Core
    Provider -->|provides context| Nav
    Provider -->|provides context| Sidebar

    %% Utilities & Types
    subgraph "Utilities & Types"
        UseMobile["use-mobile Hook"]:::util
        click UseMobile "https://github.com/rasyaakbar/staticwebbuilder/blob/main/src/hooks/use-mobile.tsx"
        Constants["constants.ts"]:::util
        click Constants "https://github.com/rasyaakbar/staticwebbuilder/blob/main/src/lib/constants.ts"
        Types["types.ts"]:::util
        click Types "https://github.com/rasyaakbar/staticwebbuilder/blob/main/src/lib/types.ts"
        Utils["utils.ts"]:::util
        click Utils "https://github.com/rasyaakbar/staticwebbuilder/blob/main/src/lib/utils.ts"
    end
    UseMobile --> Core
    Constants --> Provider
    Types --> Provider
    Utils --> Actions

    %% Export Action
    Actions -->|file export| Browser

    %% Styles
    classDef infra fill:#ffe4e1,stroke:#333,stroke-width:1px
    classDef user fill:#e1f5fe,stroke:#333,stroke-width:1px
    classDef runtime fill:#e8f5e9,stroke:#333,stroke-width:1px
    classDef ui fill:#f3e5f5,stroke:#333,stroke-width:1px
    classDef component fill:#fff9c4,stroke:#333,stroke-width:1px
    classDef state fill:#b2ebf2,stroke:#333,stroke-width:1px
    classDef util fill:#fce4ec,stroke:#333,stroke-width:1px
```
