# tdollar15/digi-pro architecture

> Architecture diagram of the GitHub repository tdollar15/digi-pro, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tdollar15/digi-pro
- Repository: https://github.com/tdollar15/digi-pro

## Overview

##### Project type and purpose
- This is a single‑page application (SPA) built with React, TypeScript, and Vite.
- It functions as a frontend client that consumes Supabase (BaaS) for authentication and data storage.
- It includes a component library (in src/components/ui) and Storybook stories (in src/stories) for UI development.

##### File structure
- Top‑level build & config files: package.json, vite.config.ts, tsconfig.json, tailwind.config.js.
- Public assets & entry: public/, index.html, src/main.tsx.
- Application code:
- src/App.tsx – root component & router.
- src/components/ – feature‑level components (EventCard, Login, Signup, etc.).
- src/components/ui/ – reusable, generic UI primitives.
- src/layouts/ – page shell (MainLayout).
- src/context/UserContext.tsx – React Context for user state.
- src/lib/supabase.ts – Supabase client wrapper.
- Storybook support: src/stories folder with stories for each ui component.
- Utilities: src/lib/utils.ts, src/types/supabase.ts.

##### Extract key architecture details from the README
- Development tooling: Vite dev server with React Fast Refresh (via plugin‑react).
- Linting: ESLint configured for TypeScript and React.
- No custom backend code—relies entirely on Supabase for backend services.

- External Service (Supabase Auth/DB/Storage)
- Asset Server / CDN (public folder & built assets)
- Dev Tools (Vite Server, ESLint, Storybook)
- Browser → Vite Server (dev) / CDN (prod)
- Components → Supabase API calls
- Storybook → UI Lib
- Blue for frontend code modules
- Green for external services
- Gray for build & dev tools

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Dev Tools"
        Vite["Vite Dev Server"]:::tool
        ESLint["ESLint"]:::tool
        Storybook["Storybook"]:::storybook
    end

    Browser["Web Browser"]:::external
    Public["public/"]:::frontend

    subgraph "SPA Client (src)"
        Entry["main.tsx"]:::frontend
        App["App.tsx"]:::frontend
        subgraph "Layouts"
            Layout["MainLayout.tsx"]:::frontend
        end
        subgraph "Pages & Feature Components"
            Home["home.tsx"]:::frontend
            subgraph "Landing Module"
                LandingPage["LandingPage.tsx"]:::frontend
            end
            subgraph "Feature Components"
                EC["EventCard.tsx"]:::frontend
                ED["EventDetails.tsx"]:::frontend
                EG["EventGrid.tsx"]:::frontend
                Header["Header.tsx"]:::frontend
                Login["Login.tsx"]:::frontend
                Signup["Signup.tsx"]:::frontend
                Dashboard["OrganizerDashboard.tsx"]:::frontend
            end
        end
        subgraph "UI Component Library"
            UIlib["components/ui/"]:::frontend
        end
        Context["UserContext.tsx"]:::frontend
        SupaClient["supabase.ts"]:::external
        Utils["utils.ts"]:::frontend
        Types["supabase.ts (types)"]:::frontend
    end

    Database["Supabase Service\n(Auth, DB, Storage)"]:::external

    Browser -->|dev: connect| Vite
    Browser -->|fetch assets| Public
    Browser -->|load SPA| Entry
    Vite --> Entry
    Entry --> App
    App --> Layout
    Layout --> Home
    Layout --> LandingPage
    Home --> EG
    EG --> EC
    EC --> ED
    App --> Header
    Header --> Login
    Header --> Signup
    Header --> Dashboard
    Home --> UIlib
    LandingPage --> UIlib
    EC --> UIlib
    ED --> UIlib
    EG --> UIlib
    Header --> UIlib
    Login --> UIlib
    Signup --> UIlib
    Dashboard --> UIlib
    App --> Context
    Context --> SupaClient
    EC --> SupaClient
    ED --> SupaClient
    EG --> SupaClient
    Header --> SupaClient
    Login --> SupaClient
    Signup --> SupaClient
    Dashboard --> SupaClient
    SupaClient --> Database
    Storybook --> UIlib

    click Entry "https://github.com/tdollar15/digi-pro/blob/main/src/main.tsx"
    click App "https://github.com/tdollar15/digi-pro/blob/main/src/App.tsx"
    click EC "https://github.com/tdollar15/digi-pro/blob/main/src/components/EventCard.tsx"
    click ED "https://github.com/tdollar15/digi-pro/blob/main/src/components/EventDetails.tsx"
    click EG "https://github.com/tdollar15/digi-pro/blob/main/src/components/EventGrid.tsx"
    click Header "https://github.com/tdollar15/digi-pro/blob/main/src/components/Header.tsx"
    click Login "https://github.com/tdollar15/digi-pro/blob/main/src/components/Login.tsx"
    click Signup "https://github.com/tdollar15/digi-pro/blob/main/src/components/Signup.tsx"
    click Dashboard "https://github.com/tdollar15/digi-pro/blob/main/src/components/OrganizerDashboard.tsx"
    click Home "https://github.com/tdollar15/digi-pro/blob/main/src/components/home.tsx"
    click LandingPage "https://github.com/tdollar15/digi-pro/blob/main/src/components/landing/LandingPage.tsx"
    click UIlib "https://github.com/tdollar15/digi-pro/tree/main/src/components/ui/"
    click Storybook "https://github.com/tdollar15/digi-pro/tree/main/src/stories/"
    click Layout "https://github.com/tdollar15/digi-pro/blob/main/src/layouts/MainLayout.tsx"
    click Context "https://github.com/tdollar15/digi-pro/blob/main/src/context/UserContext.tsx"
    click SupaClient "https://github.com/tdollar15/digi-pro/blob/main/src/lib/supabase.ts"
    click Utils "https://github.com/tdollar15/digi-pro/blob/main/src/lib/utils.ts"
    click Types "https://github.com/tdollar15/digi-pro/blob/main/src/types/supabase.ts"

    classDef frontend fill:#D0E8FF,stroke:#0366D6,color:#0366D6;
    classDef external fill:#E6FFEA,stroke:#28A745,color:#28A745;
    classDef tool fill:#F0F0F0,stroke:#6C757D,color:#6C757D;
    classDef storybook fill:#FFF4E6,stroke:#FF872D,color:#FF872D;
```
