# aziontech/azion-console-kit architecture

> Architecture diagram of the GitHub repository aziontech/azion-console-kit, 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-console-kit
- Repository: https://github.com/aziontech/azion-console-kit

## Overview

##### Project type and purpose
- This is a front-end single-page application (“Azion Console Kit”) built with Vue 3 + Vite, styled with PrimeVue & Tailwind, that provides a customizable UI for managing Azion edge-platform resources (accounts, billing, edge apps, DNS, WAF, real-time events, metrics, etc.).

##### High-level file-structure analysis
- Top level: config files (Vite, Tailwind, Cypress), CI/CD workflows, scripts, Docker aliases.
- src/
- assets, layouts, templates, views & components → presentation layer
- router/ → vue-router configuration
- stores/ → Pinia/Vuex-style state management
- composables/ & helpers/ → reusable logic (domain/business helpers)
- services/ & services/axios/ → HTTP client adapters + API-specific service modules
- plugins/ → Vue plugins (analytics, factories)
- modules/ → feature-scoped sub-systems (AI-chat, real-time events, metrics)
- cypress/ → end-to-end tests
- .github/workflows/ → lint, test, deploy pipelines

##### Additional insights from README
- Targets two environments (stage/production) via VITE_ENVIRONMENT
- Supports local Docker alias for yarn
- Deploys statically (via Azion CLI) onto Azion’s edge/CDN
- Integrates Stripe for payments, plus many external APIs (GraphQL, WebPageTest, GitHub, Google Storage, StatusPage)

##### Main components & interactions (
A. Presentation Layer (in-browser SPA)
- Views/Templates/Components/Layouts
- Routing (vue-router)
- State (stores)
B. Domain Logic
- Composables & Helpers
- Feature Modules (azion-ai-chat, real-time-events, real-time-metrics)
C. Data Layer (API Services)
- AxiosHttpClientAdapter + SignalDecorator
- Service modules per domain (account-services, billing-services, edge-application-services, etc.)
- GraphQL client (makeGraphQl)
D. Plugins
- AnalyticsTrackerAdapterPlugin → tracks events to different trackers (ProductTracker, RealTimeMetricsTracker, etc.)
- Factories (analytics-tracking-factory, segment-token-factory)
E. External Services
- Azion Public API (REST & GraphQL)
- Stripe (payment processing)
- GitHub API, WebPageTest API, Google Storage, StatusPage API, third-party data-stream targets (Kafka, Splunk, BigQuery)
F. Deployment Pipeline
- GitHub Actions → CI (eslint, vitest, cypress) → npm build
- Azion CLI → deploy to edge/CDN for “stage” / “production”

##### Architectural patterns & design principles
- Layered separation: Presentation / Domain / Data
- Modular feature organization under src/modules
- Reusable building blocks: templates/, composables/, helpers/
- Centralized API client configuration via services/axios
- Immutable, centralized state (stores/)
- Declarative routing (router/routes/ per feature)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Browser
    Browser("Browser (User)"):::external

    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        App["App.vue"]:::ui
        Views["Views/Templates/Components"]:::ui
        Layouts["Layouts"]:::ui
        Templates["Reusable UI Blocks"]:::ui
        Router["Router Configuration"]:::ui
        Stores["State Management (Pinia/Vuex)"]:::ui
    end

    %% Domain Logic
    subgraph "Domain Logic"
        direction TB
        Composables["Composables"]:::logic
        Helpers["Helpers"]:::logic
        Modules["Feature Modules"]:::logic
        AIChat["AI Chat Module"]:::logic
        Events["Real-Time Events Module"]:::logic
        Metrics["Real-Time Metrics Module"]:::logic
    end

    %% Data Layer
    subgraph "Data Layer"
        direction TB
        AxiosAdapter["AxiosHttpClientAdapter"]:::data
        SignalDecor["Signal Decorator"]:::data
        GraphQLFactory["GraphQL Client Factory"]:::data
        ServiceModules["Service Modules"]:::data
        AccountSvc["Account Services"]:::data
        BillingSvc["Billing Services"]:::data
        EdgeAppSvc["Edge Application Services"]:::data
    end

    %% External Services
    subgraph "External Services"
        direction TB
        AzionAPI["Azion Public API (REST & GraphQL)"]:::external
        Stripe["Stripe"]:::external
        GitHubAPI["GitHub API"]:::external
        WebPageTest["WebPageTest API"]:::external
        GoogleStorage["Google Storage"]:::external
        StatusPage["StatusPage API"]:::external
        ThirdParty["Data-stream Targets (Kafka, Splunk, BigQuery)"]:::external
    end

    %% CI/CD & Deployment
    subgraph "CI/CD & Deployment"
        direction TB
        GitHubActions["GitHub Actions"]:::cicd
        AzionCLI["Azion CLI"]:::cicd
        EdgeCDN["Azion Edge CDN"]:::cicd
    end

    %% Connections
    Browser -->|"loads SPA"| App
    App -->|"renders UI"| Views
    App --> Layouts
    App --> Templates
    App --> Router
    App --> Stores

    App -->|"invokes"| Composables
    App --> Helpers
    App --> AIChat
    App --> Events
    App --> Metrics

    Composables --> AxiosAdapter
    Helpers --> AxiosAdapter
    Modules --> AxiosAdapter

    AxiosAdapter --> SignalDecor
    SignalDecor --> GraphQLFactory
    SignalDecor --> ServiceModules

    ServiceModules --> AccountSvc
    ServiceModules --> BillingSvc
    ServiceModules --> EdgeAppSvc

    AccountSvc -->|HTTP REST/GraphQL| AzionAPI
    BillingSvc -->|HTTP REST| Stripe
    EdgeAppSvc -->|HTTP REST| AzionAPI

    GraphQLFactory -->|GraphQL| AzionAPI

    ServiceModules --> GitHubAPI
    ServiceModules --> WebPageTest
    ServiceModules --> GoogleStorage
    ServiceModules --> StatusPage
    ServiceModules --> ThirdParty

    GitHubActions -->|"CI build"| AzionCLI
    AzionCLI -->|"deploy"| EdgeCDN
    EdgeCDN -->|"serves SPA"| Browser

    %% Click Events
    click App "https://github.com/aziontech/azion-console-kit/blob/dev/src/App.vue"
    click Views "https://github.com/aziontech/azion-console-kit/tree/dev/src/views/"
    click Layouts "https://github.com/aziontech/azion-console-kit/tree/dev/src/layout/"
    click Templates "https://github.com/aziontech/azion-console-kit/tree/dev/src/templates/"
    click Router "https://github.com/aziontech/azion-console-kit/blob/dev/src/router/index.js"
    click Stores "https://github.com/aziontech/azion-console-kit/tree/dev/src/stores/"
    click Composables "https://github.com/aziontech/azion-console-kit/tree/dev/src/composables/"
    click Helpers "https://github.com/aziontech/azion-console-kit/tree/dev/src/helpers/"
    click AIChat "https://github.com/aziontech/azion-console-kit/tree/dev/src/modules/azion-ai-chat/"
    click Events "https://github.com/aziontech/azion-console-kit/tree/dev/src/modules/real-time-events/"
    click Metrics "https://github.com/aziontech/azion-console-kit/tree/dev/src/modules/real-time-metrics/"
    click AxiosAdapter "https://github.com/aziontech/azion-console-kit/blob/dev/src/services/axios/AxiosHttpClientAdapter.js"
    click SignalDecor "https://github.com/aziontech/azion-console-kit/blob/dev/src/services/axios/AxiosHttpClientSignalDecorator.js"
    click GraphQLFactory "https://github.com/aziontech/azion-console-kit/blob/dev/src/services/axios/makeGraphQl.js"
    click AccountSvc "https://github.com/aziontech/azion-console-kit/tree/dev/src/services/account-services/"
    click BillingSvc "https://github.com/aziontech/azion-console-kit/tree/dev/src/services/billing-services/"
    click EdgeAppSvc "https://github.com/aziontech/azion-console-kit/tree/dev/src/services/edge-application-services/"
    click GitHubActions "https://github.com/aziontech/azion-console-kit/blob/dev/.github/workflows/deploy-stage.yml"
    click AzionCLI "https://github.com/aziontech/azion-console-kit/blob/dev/azion.config.mjs"

    %% Styles
    classDef ui fill:#cfe2ff,stroke:#2f6fcb,color:#000;
    classDef logic fill:#d1e7dd,stroke:#157347,color:#000;
    classDef data fill:#ffe5b4,stroke:#e08603,color:#000;
    classDef external fill:#e2e3e5,stroke:#6c757d,color:#000;
    classDef cicd fill:#e2d5f4,stroke:#6f42c1,color:#000;
```
