# adam-3owl/veya-analytics-wiki architecture

> Architecture diagram of the GitHub repository adam-3owl/veya-analytics-wiki, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-02-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/adam-3owl/veya-analytics-wiki
- Repository: https://github.com/adam-3owl/veya-analytics-wiki

## Overview

##### Project type and purpose
- This is a Next.js 13 “App Router” front-end application, branded “Veya Analytics SDK Reference,” whose sole job is to display a searchable reference of all trackable metrics and events. There is no custom backend here; it’s a static/SSR React site optimized for Vercel.

##### File structure
- Top-level directories:
- app/ – Next.js 13 app directory (layout.tsx, page.tsx, globals.css)
- components/ – UI components (logo, theme-toggle, metrics-table) and a “ui” subfolder of primitives (button, input, tabs, separator)
- lib/ – domain logic (fetch-metrics.ts for loading your metric definitions, utils.ts for shared functions)
- types/ – TypeScript definitions for your metric objects
- Config files: next.config.js, tsconfig.json, postcss.config.mjs
- Build & deploy: package.json scripts, optimized for Vercel continuous deployment

##### README for additional insights
- Features: search, category filters, theme toggle, responsive
- Deployment: “Deploy with Vercel” button, static hosting with incremental builds
- No mention of a separate API server—the lib/fetch-metrics module likely pulls from a local JSON or the Veya Analytics SDK at build time

##### Detail without over-engineering
- Break out every logical piece: layout, page, components, lib, types, hosting
- Both build-time (SSR/SSG) and run-time (hydration, filtering) flows

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Infrastructure Layer
    subgraph "Infrastructure" 
        direction TB
        GH["GitHub"]:::infra
        Vercel["Vercel (CI/CD & CDN)"]:::infra
        CDN["CDN Edge"]:::infra
    end

    GH -->|push code| Vercel
    Vercel -->|deploy & cache| CDN

    %% Build & SSR Layer
    subgraph "Build & SSR" 
        direction TB
        SSR["Next.js SSR/SSG"]:::build
        FM["lib/fetch-metrics"]:::data
        Utils["lib/utils"]:::data
        Types["types/metrics.ts"]:::data
    end

    Vercel -->|build request| SSR
    SSR -->|uses| FM
    SSR -->|uses| Utils
    FM -->|types| Types
    Utils -->|types| Types

    SSR -->|serves HTML/CSS/JS| CDN

    %% Client Browser Layer
    subgraph "Client (Browser)" 
        direction TB
        Browser["User Browser"]:::external
        Layout["app/layout.tsx"]:::ui
        Page["app/page.tsx"]:::ui
        Logo["Logo component"]:::ui
        ThemeToggle["ThemeToggle component"]:::ui
        SearchInput["components/ui/input.tsx"]:::ui
        CategoryTabs["components/ui/tabs.tsx"]:::ui
        MetricsTable["components/metrics-table.tsx"]:::ui
        Button["components/ui/button.tsx"]:::ui
        Separator["components/ui/separator.tsx"]:::ui
    end

    CDN -->|delivers assets| Browser
    Browser -->|hydrate app| Layout
    Layout -->|renders| Logo
    Layout -->|provides theme| ThemeToggle
    ThemeToggle -->|toggles| Layout
    Layout -->|wraps| Page

    Page -->|includes| SearchInput
    Page -->|includes| CategoryTabs
    Page -->|includes| MetricsTable
    Page -->|uses global CSS| Globals
    MetricsTable -->|calls| Utils
    SearchInput -->|filters| MetricsTable
    CategoryTabs -->|filters| MetricsTable

    %% Globals stylesheet (treated as module)
    Globals["app/globals.css"]:::data

    Page -->|imports| Globals

    %% Click Events
    click Layout "https://github.com/adam-3owl/veya-analytics-wiki/blob/main/app/layout.tsx"
    click Page "https://github.com/adam-3owl/veya-analytics-wiki/blob/main/app/page.tsx"
    click Globals "https://github.com/adam-3owl/veya-analytics-wiki/blob/main/app/globals.css"
    click Logo "https://github.com/adam-3owl/veya-analytics-wiki/blob/main/components/logo.tsx"
    click ThemeToggle "https://github.com/adam-3owl/veya-analytics-wiki/blob/main/components/theme-toggle.tsx"
    click SearchInput "https://github.com/adam-3owl/veya-analytics-wiki/blob/main/components/ui/input.tsx"
    click CategoryTabs "https://github.com/adam-3owl/veya-analytics-wiki/blob/main/components/ui/tabs.tsx"
    click Button "https://github.com/adam-3owl/veya-analytics-wiki/blob/main/components/ui/button.tsx"
    click Separator "https://github.com/adam-3owl/veya-analytics-wiki/blob/main/components/ui/separator.tsx"
    click MetricsTable "https://github.com/adam-3owl/veya-analytics-wiki/blob/main/components/metrics-table.tsx"
    click FM "https://github.com/adam-3owl/veya-analytics-wiki/blob/main/lib/fetch-metrics.ts"
    click Utils "https://github.com/adam-3owl/veya-analytics-wiki/blob/main/lib/utils.ts"
    click Types "https://github.com/adam-3owl/veya-analytics-wiki/blob/main/types/metrics.ts"

    %% Styles
    classDef infra fill:#f0f0f0,stroke:#666,stroke-width:1px
    classDef build fill:#f3e5f5,stroke:#6a1b9a,stroke-width:1px
    classDef data fill:#e8f5e9,stroke:#2e7d32,stroke-width:1px
    classDef ui fill:#e1f5fe,stroke:#01579b,stroke-width:1px
    classDef external fill:#fff3e0,stroke:#ef6c00,stroke-width:1px
```
