# 0x-parzival/site architecture

> Architecture diagram of the GitHub repository 0x-parzival/site, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/0x-parzival/site
- Repository: https://github.com/0x-parzival/site

## Overview

##### Project type and purpose
- This is a front-end, single-page web application (SPA) built with React (using Vite for dev/build), TypeScript, Tailwind CSS, and Chart.js.
- Purpose: an interactive, responsive “Spiritual Resources” website featuring data visualizations (e.g. Bhagwatam analysis), particle effects, and modular page layouts.

##### File structure
- Top‐level:
- config files (tsconfig.json, tailwind.config.js, netlify.toml, vercel.json, windsuf_deployment.yaml)
- public/ — static assets (index.html, manifest, images, redirects)
- src/ — application source code
- src/ contains:
- pages/ — routeable page components (Home, AECH, DataTreya, gesture-ai, etc.)
- components/ — reusable UI building blocks, sub‐folders per feature (AECH, DataTreya, devdat, etc.)
- context/ — React Context providers (Theme, Particles)
- hooks/ — custom hooks (useMobileDetect, useParticles)
- data/ — in-app JSON/TS data sets
- styles/ — global and feature CSS
- types/ — TypeScript definitions
- Build & deployment: uses Vite (via package.json scripts), deployed to Netlify/Vercel (netlify.toml, vercel.json).

##### README insights
- Tech stack: React 18, TS 4.9, Tailwind 3.3, Chart.js 4.x, React Router 6.x, tsparticles, React Context API.
- Features emphasize interactivity, responsiveness, data viz, dynamic styling.

a. Main components
- User’s Browser (Client)
- CDN/Static Host (Netlify/Vercel)
- React SPA (bundle JS/CSS)
- React Router (client‐side routing)
- Context Providers (ThemeContext, ParticlesContext)
- Page Modules (Home, AECH, DataTreya, gesture-ai, etc.)
- UI Components (modular sub‐components in /src/components)
- Data Layer
– Local TS data modules (/src/data)
– (Optional) External API (VITE_API_URL)
- Build Tools (Vite, Tailwind, ESLint/Prettier) – shown as offline process

b. Relationships & interactions
1. Browser requests index.html → served by CDN
2. index.html loads JS/CSS bundles → initializes React App
3. React App wraps content in Context Providers
4. React Router picks the page module based on URL
5. Page modules load child UI components
6. Components read local data modules or fetch from external API
7. Chart.js & tsparticles render visualizations/effects
8. User interactions update React state/context → UI re-renders

c. Architectural patterns & principles
- Component-based decomposition (pages → feature components)
- Client-side routing (SPA with React Router)
- Context API for cross‐cutting state (theme, particles)
- CSS utility framework (Tailwind) for styling consistency
- Data‐visualization separation (DataTreya folder)
- Static hosting for performance & scalability

d. Key technologies & roles
- React & React Router: UI & routing
- TypeScript: type safety
- Tailwind CSS: styling
- Chart.js: charts & graphs
- tsparticles: background effects
- Vite: development server & bundler
- Netlify/Vercel: CI/CD & hosting

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Build & Deployment Tools
    subgraph "Build Pipeline (Offline)" 
        direction TB
        VITE["Vite (Dev & Bundler)"]:::tools
        TAILWIND["Tailwind CSS"]:::tools
        TSConfig["tsconfig.json"]:::tools
        PackageJSON["package.json (scripts)"]:::tools
        ESLint["jest.config.js / setupTests.ts"]:::tools
    end

    %% Hosting & Delivery
    CDN["Static Host (Netlify/Vercel)"]:::hosting
    Browser["User's Browser"]:::hosting

    %% React Application Runtime
    subgraph "React Application Runtime"
        direction TB
        Entry["src/index.tsx"]:::runtime
        AppRouter["src/App.tsx (App & Router)"]:::runtime
        subgraph "Routing Layer"
            Router["React Router"]:::runtime
        end
        subgraph "Context Providers"
            ThemeCtx["ThemeContext"]:::runtime
            ParticlesCtx["ParticlesContext"]:::runtime
        end
    end

    %% UI Layer: Pages and Components
    subgraph "UI Layer"
        direction TB
        subgraph "Pages (/src/pages)"
            Home["Home.tsx"]:::ui
            AECHPage["AECH.tsx"]:::ui
            DataTreyaPage["data-treya.tsx"]:::ui
            GesturePage["GesturePage.tsx"]:::ui
            OtherPages["Other Pages"]:::ui
        end
        subgraph "Components"
            AECHComps["AECH components"]:::ui
            DataTreyaComps["DataTreya components"]:::ui
            GestureComps["Gesture-AI components"]:::ui
            GlobalControls["ThemeToggle / Cursor / ParticleBackground"]:::ui
        end
    end

    %% Data Sources
    subgraph "Data Sources"
        direction TB
        LocalData["Local TS Data Modules"]:::data
        Bhagwatam["bhagwatamData.ts"]:::data
        Tantra["tantraData.ts"]:::data
        Telepathy["telepathyData.ts"]:::data
        ExternalAPI["External REST API"]:::data
    end

    %% Static Assets & Config
    subgraph "Static Assets & Hosting Config"
        direction TB
        Public["public/"]:::data
        NetlifyCfg["netlify.toml"]:::data
        VercelCfg["vercel.json"]:::data
        DeployYAML["windsurf_deployment.yaml"]:::data
    end

    %% Connections
    VITE -->|build output| CDN
    TAILWIND -->|build CSS| CDN
    TSConfig --> VITE
    PackageJSON --> VITE
    ESLint --> VITE

    CDN -->|HTTP GET index.html| Browser
    Browser -->|loads bundles| Entry
    Entry -->|renders| AppRouter
    AppRouter --> Router
    Router -->|route to| Home
    Router -->|route to| AECHPage
    Router -->|route to| DataTreyaPage
    Router -->|route to| GesturePage
    Router -->|route to| OtherPages

    AppRouter --> ThemeCtx
    AppRouter --> ParticlesCtx

    Home --> AECHComps
    AECHPage --> AECHComps
    DataTreyaPage --> DataTreyaComps
    GesturePage --> GestureComps
    OtherPages --> GlobalControls

    AECHComps -->|use data| Bhagwatam
    DataTreyaComps -->|use data| Tantra
    GestureComps -->|use data| Telepathy
    GlobalControls --> ParticlesCtx
    GlobalControls --> ThemeCtx

    AECHComps -->|fetch| ExternalAPI
    DataTreyaComps -->|fetch| ExternalAPI
    GestureComps -->|fetch| ExternalAPI

    LocalData --> Bhagwatam
    LocalData --> Tantra
    LocalData --> Telepathy

    Browser --> Public

    %% Click Events
    click Entry "https://github.com/0x-parzival/site/blob/main/src/index.tsx"
    click AppRouter "https://github.com/0x-parzival/site/blob/main/src/App.tsx"
    click Home "https://github.com/0x-parzival/site/blob/main/src/pages/Home.tsx"
    click AECHPage "https://github.com/0x-parzival/site/blob/main/src/pages/AECH.tsx"
    click DataTreyaPage "https://github.com/0x-parzival/site/blob/main/src/pages/data-treya.tsx"
    click GesturePage "https://github.com/0x-parzival/site/blob/main/src/pages/gesture-ai/GesturePage.tsx"
    click ThemeCtx "https://github.com/0x-parzival/site/blob/main/src/context/ThemeContext.tsx"
    click ParticlesCtx "https://github.com/0x-parzival/site/blob/main/src/context/ParticlesContext.tsx"
    click AECHComps "https://github.com/0x-parzival/site/tree/main/src/components/AECH/"
    click DataTreyaComps "https://github.com/0x-parzival/site/tree/main/src/components/DataTreya/"
    click GestureComps "https://github.com/0x-parzival/site/tree/main/src/pages/gesture-ai/components/"
    click Bhagwatam "https://github.com/0x-parzival/site/blob/main/src/data/bhagwatamData.ts"
    click Tantra "https://github.com/0x-parzival/site/blob/main/src/data/tantraData.ts"
    click Telepathy "https://github.com/0x-parzival/site/blob/main/src/data/telepathyData.ts"
    click Public "https://github.com/0x-parzival/site/tree/main/public/"
    click NetlifyCfg "https://github.com/0x-parzival/site/blob/main/netlify.toml"
    click VercelCfg "https://github.com/0x-parzival/site/blob/main/vercel.json"
    click DeployYAML "https://github.com/0x-parzival/site/blob/main/windsurf_deployment.yaml"
    click TSConfig "https://github.com/0x-parzival/site/blob/main/tsconfig.json"
    click PackageJSON "https://github.com/0x-parzival/site/blob/main/package.json"
    click ESLint "https://github.com/0x-parzival/site/blob/main/jest.config.js"
    
    %% Styles
    classDef hosting fill:#BBDEFB,stroke:#1E88E5,color:#0D47A1
    classDef runtime fill:#C8E6C9,stroke:#43A047,color:#1B5E20
    classDef ui fill:#FFF9C4,stroke:#FBC02D,color:#F57F17
    classDef data fill:#FFE0B2,stroke:#FB8C00,color:#E65100
    classDef tools fill:#E0E0E0,stroke:#9E9E9E,color:#424242
```
