# eugeniozucal/aiworkify-website architecture

> Architecture diagram of the GitHub repository eugeniozucal/aiworkify-website, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-03-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/eugeniozucal/aiworkify-website
- Repository: https://github.com/eugeniozucal/aiworkify-website

## Overview

##### Project type & purpose (from README + tree)
This is a **single-page frontend web app** built with **React + TypeScript** and bundled/dev-served with **Vite**. Its purpose is an “AI Studio app” that likely calls **Google Gemini** via an API key (`GEMINI_API_KEY` in `.env.local`). There is **no backend service in this repo**; any AI calls are either:
- done **directly from the browser to Gemini** (less common for production unless proxied), or
- proxied through **Vite dev server tooling / serverless endpoint** (but the tree does not show a server folder, so assume browser-to-Gemini unless you find otherwise in code).

##### Entry / bootstrap layer
- `index.html` — static HTML shell.
- `index.tsx` — React bootstrap (creates root, mounts `App`).
- `App.tsx` — top-level composition and routing/state boundaries (even if no router is used).

##### UI / component layer
- `components/*` — presentational + feature components:
- `HeroDashboard.tsx`, `Features.tsx`, `Integrations.tsx`, `Footer.tsx`, `Button.tsx`

##### Build / tooling / runtime config
- `vite.config.ts` — bundler/dev server configuration (and possibly proxy rules).
- `tsconfig*.json` — compilation settings.
- `package.json` — scripts (`dev`, `build`) and dependencies.
- `metadata.json` — AI Studio app metadata (treat as deployment/config artifact).

##### React SPA (this repo)
- served as static assets (Vite dev server in dev; static host in prod)
##### Config/Secrets
- `.env.local` (dev) / environment variables (deployment)

- User → React SPA: “HTTP(S) GET static assets”
- React SPA → Gemini API: “HTTPS API calls (prompt/request)”
- Config → React SPA: “GEMINI_API_KEY injected at build/runtime (verify mechanism)”

- React SPA → Vite Dev Server Proxy → Gemini API

Inside “React SPA”, break it into:
- **Bootstrap**
- `index.html`
- `index.tsx`
- **App Composition**
- `App.tsx`
- **UI Components**
- `HeroDashboard`
- `Features`
- `Integrations`
- `Footer`
- `Button`
- **Types/Models**
- `types.ts`
- **AI Client / API Integration**
- **Build/Tooling (non-runtime)**

- `index.tsx` → `App.tsx` (mount)
- `App.tsx` → Components (composition)
- Components ↔ App state (props/events)
- “AI Client” ↔ Gemini API (network)
- `types.ts` → App/Components/AI Client (compile-time contract)

##### Architectural patterns / principles to highlight
- **Component-based UI architecture (React)**: `App.tsx` composes feature components.
- **Separation of concerns** (lightweight here):
- UI components in `components/`
- Types in `types.ts`
- Tooling/build config separated in root configs
- **Config as dependency**: the API key is a dependency edge.

- “Prompt/Response Adapter” module between UI and Gemini API.

##### System Context (C4 Level 1)
User ↔ React SPA ↔ Gemini API, with Env Config feeding SPA (or proxy).

##### Container/Component View (C4 Level 2-ish)
Inside SPA: Bootstrap → App → Components; App/Component → AI Client → Gemini; Types used across; Build pipeline shown separately.

This approach stays faithful to the repo, is detailed, and captures the essential architecture without inventing missing services.

## Diagram (Mermaid)

```mermaid
flowchart TD
  %% =========================
  %% Diagram 1: System Context (C4 L1)
  %% =========================
  subgraph "System Context (C4 Level 1)"
    direction TB

    U["User"]:::external
    B["Browser"]:::external

    subgraph "Runtime: React SPA (React + TypeScript, bundled by Vite)"
      direction TB
      SPA["Single Page App (Static Assets)"]:::frontend
      ENV["Env Config (.env.local / deployed env vars)\nGEMINI_API_KEY"]:::secrets
      AIC["Gemini Client (in-browser integration)"]:::api
      NOTESEC["Note: Browser is an untrusted boundary\nClient-side API key may be exposed"]:::note
    end

    GEM["Google Gemini API (External)"]:::external

    U -->|"uses"| B
    B -->|"HTTP(S)_GET_static_assets"| SPA
    ENV -.->|"injects_config_at_build/runtime"| SPA
    SPA -->|"UI_event_triggers_prompt"| AIC
    AIC -->|"HTTPS_API_calls(prompt/request)"| GEM
    GEM -->|"response"| AIC
    AIC -->|"updates_state/render"| SPA
    NOTESEC -.->|"trust_boundary"| B
  end

  %% =========================
  %% Diagram 2: Container/Component View (C4 L2-ish)
  %% =========================
  subgraph "Frontend Container / Component View (C4 Level 2-ish)"
    direction TB

    subgraph "Bootstrap / Entry"
      direction TB
      HTML["HTML Shell (index.html)"]:::frontend
      BOOT["React Bootstrap / Mounting (index.tsx)"]:::frontend
    end

    subgraph "App Composition"
      direction TB
      APP["Top-level App (App.tsx)"]:::frontend
      STATE["Local State / Props / Events"]:::frontend
      ADAPT["Prompt/Response Adapter (conceptual)\n(parsing + shaping requests/responses)"]:::api
      AIC2["Gemini Client (conceptual module)\n(fetch / SDK usage)"]:::api
    end

    subgraph "UI Components Layer (components/*)"
      direction TB
      HERO["HeroDashboard"]:::ui
      FEAT["Features"]:::ui
      INTEG["Integrations"]:::ui
      FOOT["Footer"]:::ui
      BTN["Button"]:::ui
    end

    subgraph "Types / Contracts"
      direction TB
      TYPES["Shared Types (types.ts)"]:::types
    end

    subgraph "Build / Tooling (non-runtime)"
      direction TB
      PKG["package.json (scripts & deps)"]:::build
      VITE["Vite Config (vite.config.ts)"]:::build
      TSC["tsconfig.json"]:::build
      TSCN["tsconfig.node.json"]:::build
      META["metadata.json (deployment artifact)"]:::build
      OUT["Build Output: Static Assets"]:::build
    end

    EXTGEM["Google Gemini API (External)"]:::external
    ENV2["Env Config (.env.local / deployed env vars)\nGEMINI_API_KEY"]:::secrets

    HTML -->|"loads"| BOOT
    BOOT -->|"mounts"| APP

    APP -->|"composes"| HERO
    APP -->|"composes"| FEAT
    APP -->|"composes"| INTEG
    APP -->|"composes"| FOOT
    HERO -->|"uses"| BTN

    HERO -->|"user_actions"| STATE
    FEAT -->|"user_actions"| STATE
    INTEG -->|"user_actions"| STATE
    BTN -->|"click_events"| STATE
    STATE -->|"triggers_generation"| ADAPT
    ADAPT -->|"builds_prompt/request"| AIC2
    ENV2 -.->|"provides_API_key"| AIC2
    AIC2 -->|"HTTPS_request"| EXTGEM
    EXTGEM -->|"response"| AIC2
    AIC2 -->|"normalized_output"| ADAPT
    ADAPT -->|"updates_state"| STATE
    STATE -->|"drives_render"| APP

    TYPES -.->|"compile-time_contracts"| APP
    TYPES -.->|"compile-time_contracts"| HERO
    TYPES -.->|"compile-time_contracts"| FEAT
    TYPES -.->|"compile-time_contracts"| INTEG
    TYPES -.->|"compile-time_contracts"| FOOT
    TYPES -.->|"compile-time_contracts"| BTN
    TYPES -.->|"compile-time_contracts"| AIC2
    TYPES -.->|"compile-time_contracts"| ADAPT

    PKG -.->|"runs_build/dev"| VITE
    TSC -.->|"typecheck_config"| VITE
    TSCN -.->|"node/vite_ts_config"| VITE
    VITE -.->|"bundles"| OUT
    META -.->|"packaged_with_release"| OUT
    OUT -.->|"served_as"| HTML
  end

  %% =========================
  %% Click Events (from mapping)
  %% =========================
  click HTML "https://github.com/eugeniozucal/aiworkify-website/blob/main/index.html"
  click BOOT "https://github.com/eugeniozucal/aiworkify-website/blob/main/index.tsx"
  click APP "https://github.com/eugeniozucal/aiworkify-website/blob/main/App.tsx"
  click HERO "https://github.com/eugeniozucal/aiworkify-website/blob/main/components/HeroDashboard.tsx"
  click FEAT "https://github.com/eugeniozucal/aiworkify-website/blob/main/components/Features.tsx"
  click INTEG "https://github.com/eugeniozucal/aiworkify-website/blob/main/components/Integrations.tsx"
  click FOOT "https://github.com/eugeniozucal/aiworkify-website/blob/main/components/Footer.tsx"
  click BTN "https://github.com/eugeniozucal/aiworkify-website/blob/main/components/Button.tsx"
  click TYPES "https://github.com/eugeniozucal/aiworkify-website/blob/main/types.ts"
  click VITE "https://github.com/eugeniozucal/aiworkify-website/blob/main/vite.config.ts"
  click TSC "https://github.com/eugeniozucal/aiworkify-website/blob/main/tsconfig.json"
  click TSCN "https://github.com/eugeniozucal/aiworkify-website/blob/main/tsconfig.node.json"
  click PKG "https://github.com/eugeniozucal/aiworkify-website/blob/main/package.json"
  click META "https://github.com/eugeniozucal/aiworkify-website/blob/main/metadata.json"

  %% =========================
  %% Styles
  %% =========================
  classDef frontend fill:#D6ECFF,stroke:#2B6CB0,stroke-width:1.5px,color:#0B2447
  classDef ui fill:#E7F7EE,stroke:#1F7A4D,stroke-width:1.5px,color:#0B3D2E
  classDef api fill:#FFF2CC,stroke:#B7791F,stroke-width:1.5px,color:#5A3E00
  classDef external fill:#FAD1D1,stroke:#C53030,stroke-width:1.5px,color:#5B1B1B
  classDef secrets fill:#E9D8FD,stroke:#6B46C1,stroke-width:1.5px,color:#2D1A5A
  classDef build fill:#E6E6E6,stroke:#4A5568,stroke-width:1.5px,color:#1A202C
  classDef types fill:#DFF9FF,stroke:#0987A0,stroke-width:1.5px,color:#063B44
  classDef note fill:#FFF7E6,stroke:#B45309,stroke-width:1px,color:#4A2C00,stroke-dasharray: 4 3
```
