# solvro/web-eventownik architecture

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

- Interactive diagram: https://gitdiagram.com/solvro/web-eventownik
- Repository: https://github.com/solvro/web-eventownik

## Overview

##### Main Components

A. Frontend Layer:
- Next.js Application (Client-Side)
- Landing Page Components (/src/components/landing/*)
- UI Components (/src/components/ui/*)
- Event Management Views (/src/pages/event/*)
- Registration System (/src/pages/rejestracja/*)

B. Backend Layer:
- Next.js API Routes (Server-Side)
- Supabase Integration (/src/lib/supabase.ts)
- Authentication
- Real-time Database
- API Layer

C. Data Layer:
- Supabase Database
- User Management
- Event Data
- Reservations
- Blocks (Rooms/Tables)

##### Key Interactions to Highlight

- Client-Server Communication
- Real-time Updates Flow
- Authentication Flow
- Data Management Flow

##### Architectural Patterns to Emphasize

- Next.js Pages Router Architecture
- Client-Side State Management (using atoms - /src/atoms/)
- Component Hierarchy
- API Integration Pattern

##### Specific Implementation Details

a) Core Features:
- Event Management
- Registration System
- Block Management (Rooms/Tables)
- User Management

b) Technical Implementation:
- TypeScript Integration
- Tailwind CSS Styling
- Supabase Real-time Features
- Form Handling (useZodForm)

**┌─ Client Layer ─────────────────────┐**
- Landing Page                     │
- Event Management UI              │
- Registration System              │
- UI Components                    │
- Application Layer ────────────────┤
- Next.js Routes                   │
- State Management                 │
- Form Handling                    │
- Integration Layer ────────────────┤
- Supabase Client                  │
- API Services                     │
- Real-time Subscriptions         │
- Data Layer ──────────────────────┤
- Supabase Database               │
- Authentication                   │
- Storage                         │
- ┘

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        LP["Landing Page"]:::frontend
        click LP "https://github.com/Solvro/web-eventownik/tree/main/src/components/landing/*"
        
        subgraph UI["UI Components"]
            Forms["Form Components"]:::frontend
            click Forms "https://github.com/Solvro/web-eventownik/blob/main/src/components/ui/form.tsx"
            Dialog["Dialog Components"]:::frontend
            click Dialog "https://github.com/Solvro/web-eventownik/blob/main/src/components/ui/dialog.tsx"
            BasicUI["Basic UI Elements"]:::frontend
            click BasicUI "https://github.com/Solvro/web-eventownik/blob/main/src/components/ui/button.tsx"
        end
        
        subgraph EventMgmt["Event Management"]
            EventPages["Event Pages"]:::frontend
            click EventPages "https://github.com/Solvro/web-eventownik/tree/main/src/pages/event/[slug]/*"
            EventSettings["Settings"]:::frontend
            click EventSettings "https://github.com/Solvro/web-eventownik/blob/main/src/pages/event/[slug]/settings.tsx"
        end
        
        subgraph RegSystem["Registration System"]
            RegFlow["Registration Flow"]:::frontend
            click RegFlow "https://github.com/Solvro/web-eventownik/tree/main/src/pages/rejestracja/[participationSlug]/*"
            RegForm["Registration Form"]:::frontend
            click RegForm "https://github.com/Solvro/web-eventownik/blob/main/src/pages/rejestracja/[participationSlug]/[blockId]/formularz.tsx"
        end
    end
    
    subgraph AppLayer["Application Layer"]
        StateManagement["State Management"]:::state
        click StateManagement "https://github.com/Solvro/web-eventownik/blob/main/src/atoms/userRegistrations.ts"
        FormHandling["Form Handling"]:::logic
        click FormHandling "https://github.com/Solvro/web-eventownik/blob/main/src/lib/useZodForm.ts"
        EventHooks["Event Hooks"]:::logic
        click EventHooks "https://github.com/Solvro/web-eventownik/blob/main/src/lib/useEvent.ts"
    end
    
    subgraph Integration["Integration Layer"]
        SupabaseClient["Supabase Client"]:::integration
        click SupabaseClient "https://github.com/Solvro/web-eventownik/blob/main/src/lib/supabase.ts"
        SSRClient["Server-Side Client"]:::integration
        click SSRClient "https://github.com/Solvro/web-eventownik/blob/main/src/lib/supabaseSSR.ts"
        RealTime["Real-time Subscriptions"]:::integration
    end
    
    subgraph DataLayer["Data Layer"]
        Database[(Supabase Database)]:::database
        BlockTypes["Block Types"]:::types
        click BlockTypes "https://github.com/Solvro/web-eventownik/blob/main/src/types/Block.ts"
        ReservationTypes["Reservation Types"]:::types
        click ReservationTypes "https://github.com/Solvro/web-eventownik/blob/main/src/types/reservation.ts"
    end
    
    %% Connections
    LP --> UI
    UI --> EventMgmt
    UI --> RegSystem
    EventMgmt --> StateManagement
    RegSystem --> FormHandling
    FormHandling --> SupabaseClient
    EventHooks --> SupabaseClient
    StateManagement --> SupabaseClient
    SupabaseClient --> Database
    SSRClient --> Database
    RealTime --> Database
    
    %% Styles
    classDef frontend fill:#3b82f6,color:#fff
    classDef state fill:#8b5cf6,color:#fff
    classDef logic fill:#059669,color:#fff
    classDef integration fill:#ea580c,color:#fff
    classDef database fill:#0369a1,color:#fff
    classDef types fill:#737373,color:#fff
    
    %% Legend
    subgraph Legend
        Frontend["Frontend Components"]:::frontend
        State["State Management"]:::state
        Logic["Business Logic"]:::logic
        Int["Integration Layer"]:::integration
        DB["Database"]:::database
        Types["Type Definitions"]:::types
    end
```
