# aziontech/azion-webkit architecture

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

- Interactive diagram: https://gitdiagram.com/aziontech/azion-webkit
- Repository: https://github.com/aziontech/azion-webkit

## Overview

##### Project Type & Purpose
- This is an open-source front-end component and templating toolkit (“azion-webkit”) built with Vue.
- It provides reusable Vue components, template “blocks,” mock data, styles, and Storybook stories so that teams can quickly assemble pages or apps.
- It is shipped as an npm package and published via CI/CD (GitHub Actions).

##### High-Level File Structure
- src/
- App.vue, main.js – entry point for the demo/gallery application.
- helpers/ – utility functions.
- mock/ – data fixtures for Storybook and examples.
- services/ – integrations (HubSpot, newsletter).
- stories/ – Storybook MDX and JS stories organizing components and templates.
- templates/ – dozens of individual Vue component packages (one per folder) representing atomic UI “blocks.”
- public/, index.html – static assets and HTML host for demos/Storybook.
- build.js, vite.config.js, postcss.config.js, tailwind.config.js – build and bundler configuration.
- dist/ – compiled output and package.json for publishing.
- .github/workflows/ – CI pipelines: release (npm publish) and Storybook build.

##### README Insights
- Describes installation (`npm install azion-webkit`), usage in other projects, and reliance on Storybook for visual QA.

- Developer Workstation
– Source code (src/, templates/, stories/)
– Local Storybook server (npm run storybook)
– Local dev server (npm run dev via Vite)
- Build & CI/CD
– Vite/Rollup build.js + PostCSS/Tailwind
– GitHub Actions workflows: storybook build, release→ npm registry
- Package Registry (npm)
- Consumer Application
– Imports azion-webkit from npm
– Bundles via consumer’s bundler (e.g. Webpack, Vite)
– Renders Vue components, loads CSS/assets
- External Services
– HubSpot (via hubspot-service.js)
– Newsletter API (newsletterSubmitHandler.js)

- Dev workstation → Build pipeline (push to GitHub)
- CI workflow → publishes to npm registry
- Consumer app → installs from npm → bundler → browser
- Components → call services → external APIs

c. Architectural Patterns & Principles
- Atomic/“block”-based component design – each src/templates subfolder is a self-contained package.
- Storybook-driven development – stories mirror templates for visual testing.
- Mono-repo style packaging – one repo, multiple light packages under templates/.
- Separation of concerns – helpers, mocks, services, and templates clearly partitioned.

d. Key Technologies & Frameworks
- Vue 3 Single-File Components
- Vite (dev server, build) / Rollup plugin in build.js
- Tailwind CSS + PostCSS
- Storybook for Vue
- GitHub Actions for CI/CD
- Node.js/npm for package management

##### Diagramming Recommendations
- Blue: source & dev tools (Vue, Storybook, Vite)
- Green: build & CI (GitHub Actions, Rollup)
- Orange: runtime / consumer app
- Gray: external APIs
- Optionally, annotate package boundaries (e.g., template sub-packages beneath “core library”).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer Workstation Layer
    subgraph "Developer Workstation"
        direction TB
        AppVue["App.vue"]:::dev
        MainJS["main.js"]:::dev
        AssetsIcons["assets/icons"]:::dev
        AssetsSVG["assets/svg"]:::dev
        AssetsStyles["assets/styles"]:::dev
        Helpers["stringConcatRamdomNumber.js"]:::dev
        MockFixtures["mock/…"]:::dev
        ServicesLocal["services/…"]:::dev
        StoriesLocal["stories/…"]:::dev
        Templates["templates/…"]:::dev
        DevServer["Vite Dev Server"]:::dev
        StorybookServer["Storybook Server"]:::dev
    end

    %% Build & CI/CD Layer
    subgraph "Build & CI/CD" 
        direction TB
        BuildScript["build.js"]:::build
        ViteConfig["vite.config.js"]:::build
        PostCSSConfig["postcss.config.js"]:::build
        TailwindConfig["tailwind.config.js"]:::build
        GH_Workflows["GitHub Actions"]:::build
    end

    %% Registry
    NPMRegistry["npm Registry"]:::registry

    %% Consumer Application Layer
    subgraph "Consumer Application"
        direction TB
        ConsumerBundle["Bundler (Webpack/Vite)"]:::consumer
        ConsumerRuntime["Vue Components & CSS"]:::consumer
    end

    %% External Services
    subgraph "External Services"
        direction TB
        HubSpot["HubSpot API"]:::external
        NewsletterAPI["Newsletter API"]:::external
    end

    %% Connections
    AppVue -->|imports components| Templates
    MainJS -->|bootstraps| DevServer
    Templates -->|stories| StoriesLocal
    StoriesLocal -->|launch| StorybookServer
    DevServer -->|serve demo| Browser
    StorybookServer -->|serve docs| Browser

    Browser(["Browser"]):::browser

    AppVue -->|uses assets| AssetsIcons
    AppVue -->|uses assets| AssetsSVG
    AssetsStyles -->|styles injection| DevServer

    Helpers -->|utility| Templates
    MockFixtures -->|data| StoriesLocal
    ServicesLocal -->|integration| Templates

    DevServer -->|push code| GH_Workflows
    StorybookServer -->|push code| GH_Workflows
    GH_Workflows -->|runs build| BuildScript
    BuildScript -->|uses configs| ViteConfig
    BuildScript -->|uses configs| PostCSSConfig
    BuildScript -->|uses configs| TailwindConfig
    GH_Workflows -->|npm publish| NPMRegistry

    ConsumerBundle -->|install azion-webkit| NPMRegistry
    ConsumerBundle -->|bundle| ConsumerRuntime
    ConsumerRuntime -->|render| Browser

    ConsumerRuntime -->|calls| HubSpot
    ConsumerRuntime -->|calls| NewsletterAPI

    %% Click Events
    click AppVue "https://github.com/aziontech/azion-webkit/blob/main/src/App.vue"
    click MainJS "https://github.com/aziontech/azion-webkit/blob/main/src/main.js"
    click AssetsIcons "https://github.com/aziontech/azion-webkit/tree/main/src/assets/icons"
    click AssetsSVG "https://github.com/aziontech/azion-webkit/tree/main/src/assets/svg"
    click AssetsStyles "https://github.com/aziontech/azion-webkit/tree/main/src/assets/styles"
    click Helpers "https://github.com/aziontech/azion-webkit/blob/main/src/helpers/stringConcatRamdomNumber.js"
    click MockFixtures "https://github.com/aziontech/azion-webkit/tree/main/src/mock"
    click ServicesLocal "https://github.com/aziontech/azion-webkit/tree/main/src/services"
    click StoriesLocal "https://github.com/aziontech/azion-webkit/tree/main/src/stories"
    click Templates "https://github.com/aziontech/azion-webkit/tree/main/src/templates"
    click BuildScript "https://github.com/aziontech/azion-webkit/blob/main/build.js"
    click ViteConfig "https://github.com/aziontech/azion-webkit/blob/main/vite.config.js"
    click PostCSSConfig "https://github.com/aziontech/azion-webkit/blob/main/postcss.config.js"
    click TailwindConfig "https://github.com/aziontech/azion-webkit/blob/main/tailwind.config.js"
    click GH_Workflows "https://github.com/aziontech/azion-webkit/blob/main/.github/workflows/release.yml"
    click GH_Workflows "https://github.com/aziontech/azion-webkit/blob/main/.github/workflows/storybook.yml"

    %% Styles
    classDef dev fill:#D0E8FF,stroke:#0057B8,color:#000
    classDef build fill:#E0F8D8,stroke:#3A9D23,color:#000
    classDef registry fill:#FFFFFF,stroke:#CCCCCC,color:#000
    classDef consumer fill:#FFE8B8,stroke:#DB6B00,color:#000
    classDef external fill:#F0F0F0,stroke:#666666,color:#000
    classDef browser fill:#FFFFFF,stroke:#000000,color:#000,stroke-dasharray: 5 5
```
