# bixxzy326/glug-organizer architecture

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

- Interactive diagram: https://gitdiagram.com/bixxzy326/glug-organizer
- Repository: https://github.com/bixxzy326/glug-organizer

## Overview

##### Main Components
- Frontend Application: Since everything is client-side, focus on the SPA architecture.
- Entry Point: Highlight the src/main.tsx as the bootstrapping file that initializes the React app.
- Pages: Include the pages directory (Index.tsx, Events.tsx, Glugs.tsx, Profile.tsx, NotFound.tsx) which defines the route-based views.
- UI Components: Show the components folder with its subdirectories (regular components such as Navbar.tsx, Hero.tsx, EventCard.tsx, GlugCard.tsx, etc.) and the extensive UI components inside components/ui (the building blocks provided by shadcn-ui).
- Build & Development Tooling: Represent the configuration files for Vite, Tailwind CSS, PostCSS and TypeScript (vite.config.ts, tailwind.config.ts, postcss.config.js, tsconfig.json, etc.) as supporting elements in the build pipeline.

##### Relationships and Data Flow
- User Interaction: Start with a user interacting via the browser on the index.html (located at the root) which loads the app.
- React Component Hierarchy: From the main.tsx file, show how the React component tree is built, differentiating between “Pages” (which serve as different routes) and common “Components” (such as Navbar, Hero, etc.).
- Component Composition: Illustrate how the higher-level components (for example, App.tsx) import and compose lower-level components and UI elements.
- Data and State Flow: Even if not using an explicit state management library, indicate the flow of data through props and hooks (custom hooks in the src/hooks directory) between components.

##### Architectural Patterns and Design Principles
- Component-Based Architecture: Clearly mark the separation between reusable UI components (in components/ui) and page-specific components (in pages).
- Separation of Concerns: Demonstrate that layout, business logic (if any within custom hooks or context usage), and UI styling (via Tailwind CSS) are kept modular.
- Build Process: Include a small “build & deployment” block showing the integration of Vite (with relevant configuration files like vite.config.ts) to produce the optimized bundle.

##### Relevant Technologies
- Vite: Indicate that the build and bundling process is handled by Vite.
- React & TypeScript: Mark the primary development framework and language.
- shadcn-ui & Tailwind CSS: Show that the UI components and styling are driven by these libraries.
- (Optional) ESLint: Mention eslint.config.js for code quality checking.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Global Nodes
    user["User/Browser"]:::user
    indexHtml["index.html (Bootstrapping SPA)"]:::entry
    mainTs["src/main.tsx (Entry Point)"]:::entry
    appTs["src/App.tsx (Core App)"]:::entry

    %% Primary Flow
    user -->|"loads"| indexHtml
    indexHtml -->|"initializes"| mainTs
    mainTs -->|"bootstraps"| appTs

    %% Pages Subgraph
    subgraph "Pages"
        indexPage["Index Page"]:::pages
        eventsPage["Events Page"]:::pages
        glugsPage["Glugs Page"]:::pages
        profilePage["Profile Page"]:::pages
        notFoundPage["NotFound Page"]:::pages
    end
    appTs -->|"renders"| indexPage
    appTs -->|"renders"| eventsPage
    appTs -->|"renders"| glugsPage
    appTs -->|"renders"| profilePage
    appTs -->|"renders"| notFoundPage

    %% Common UI Components Subgraph
    subgraph "Common Components"
        navbar["Navbar"]:::components
        hero["Hero"]:::components
        eventCard["Event Card"]:::components
        glugCard["Glug Card"]:::components
    end
    indexPage -->|"includes"| navbar
    indexPage -->|"includes"| hero
    indexPage -->|"includes"| eventCard
    indexPage -->|"includes"| glugCard

    %% UI Library Components Subgraph
    subgraph "UI Library Components"
        uiLib["shadcn-ui Components"]:::uilib
    end
    navbar -->|"composes"| uiLib

    %% Hooks and Lib Subgraph
    subgraph "Hooks and Lib"
        %% Custom Hooks Subgraph
        subgraph "Custom Hooks"
            useMobile["use-mobile"]:::hooks
            useToast["use-toast"]:::hooks
            uiUseToast["UI use-toast"]:::hooks
        end
        %% Utility Functions Subgraph
        subgraph "Utility Functions"
            mockData["Mock Data"]:::lib
            utils["Utility Functions"]:::lib
        end
    end
    appTs -->|"uses"| useMobile
    appTs -->|"uses"| useToast
    appTs -->|"uses"| uiUseToast
    indexPage -->|"calls"| mockData
    indexPage -->|"calls"| utils

    %% Build & Config Subgraph
    subgraph "Build & Config"
        viteConfig["Vite Config"]:::config
        tailwindConfig["Tailwind Config"]:::config
        postcssConfig["PostCSS Config"]:::config
        tsConfig["tsconfig.json"]:::config
        tsConfigApp["tsconfig.app.json"]:::config
        tsConfigNode["tsconfig.node.json"]:::config
    end
    viteConfig -->|"configures"| mainTs
    tsConfig -->|"packages"| appTs

    %% Deployment Subgraph
    subgraph "Deployment"
        deploymentFlow["Dev->Commits->Lovable Publishing"]:::deployment
    end
    tsConfig -->|"packages"| deploymentFlow

    %% Click Events
    click indexHtml "https://github.com/bixxzy326/glug-organizer/blob/main/index.html"
    click mainTs "https://github.com/bixxzy326/glug-organizer/blob/main/src/main.tsx"
    click appTs "https://github.com/bixxzy326/glug-organizer/blob/main/src/App.tsx"
    click indexPage "https://github.com/bixxzy326/glug-organizer/blob/main/src/pages/Index.tsx"
    click eventsPage "https://github.com/bixxzy326/glug-organizer/blob/main/src/pages/Events.tsx"
    click glugsPage "https://github.com/bixxzy326/glug-organizer/blob/main/src/pages/Glugs.tsx"
    click profilePage "https://github.com/bixxzy326/glug-organizer/blob/main/src/pages/Profile.tsx"
    click notFoundPage "https://github.com/bixxzy326/glug-organizer/blob/main/src/pages/NotFound.tsx"
    click navbar "https://github.com/bixxzy326/glug-organizer/blob/main/src/components/Navbar.tsx"
    click hero "https://github.com/bixxzy326/glug-organizer/blob/main/src/components/Hero.tsx"
    click eventCard "https://github.com/bixxzy326/glug-organizer/blob/main/src/components/EventCard.tsx"
    click glugCard "https://github.com/bixxzy326/glug-organizer/blob/main/src/components/GlugCard.tsx"
    click uiLib "https://github.com/bixxzy326/glug-organizer/tree/main/src/components/ui"
    click useMobile "https://github.com/bixxzy326/glug-organizer/blob/main/src/hooks/use-mobile.tsx"
    click useToast "https://github.com/bixxzy326/glug-organizer/blob/main/src/hooks/use-toast.ts"
    click uiUseToast "https://github.com/bixxzy326/glug-organizer/blob/main/src/components/ui/use-toast.ts"
    click mockData "https://github.com/bixxzy326/glug-organizer/blob/main/src/lib/mockData.ts"
    click utils "https://github.com/bixxzy326/glug-organizer/blob/main/src/lib/utils.ts"
    click viteConfig "https://github.com/bixxzy326/glug-organizer/blob/main/vite.config.ts"
    click tailwindConfig "https://github.com/bixxzy326/glug-organizer/blob/main/tailwind.config.ts"
    click postcssConfig "https://github.com/bixxzy326/glug-organizer/blob/main/postcss.config.js"
    click tsConfig "https://github.com/bixxzy326/glug-organizer/blob/main/tsconfig.json"
    click tsConfigApp "https://github.com/bixxzy326/glug-organizer/blob/main/tsconfig.app.json"
    click tsConfigNode "https://github.com/bixxzy326/glug-organizer/blob/main/tsconfig.node.json"

    %% Styles
    classDef user fill:#FFEFD5,stroke:#FF8C00,stroke-width:2px;
    classDef entry fill:#D1E7DD,stroke:#0F5132,stroke-width:2px;
    classDef pages fill:#CFE2FF,stroke:#084298,stroke-width:2px;
    classDef components fill:#FCE5CD,stroke:#D46A6A,stroke-width:2px;
    classDef uilib fill:#E2E3E5,stroke:#6C757D,stroke-width:2px;
    classDef hooks fill:#F8D7DA,stroke:#C82333,stroke-width:2px;
    classDef lib fill:#FFF3CD,stroke:#C69500,stroke-width:2px;
    classDef config fill:#D1E7DD,stroke:#0D6EFD,stroke-width:2px;
    classDef deployment fill:#DBE9F4,stroke:#0A58CA,stroke-width:2px;
```
