# t1modo/eventory architecture

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

- Interactive diagram: https://gitdiagram.com/t1modo/eventory
- Repository: https://github.com/t1modo/eventory

## Overview

##### Main Components

A. Frontend Layer:
- Pages (Home, Event Discovery, RSVP)
- Components (Navbar, EventCard, EventFilter, MapView, etc.)
- Layouts (AuthLayout, MainLayout)

B. API Layer:
- WebSocket connection (indicated by websocket.js config)

C. State Management & Data Flow:
- Custom Hooks Layer (useEventAPI, useWebSocket)
- API Client Utilities

D. External Services (to be represented as separate components):
- Service (implied by MapView component)
- Event Data Store (backend database - show as external system)
- WebSocket Server (for real-time updates)

##### Component Relationships

- User Interface → API Client
- API Client → Backend API
- WebSocket Client → WebSocket Server
- Components → Custom Hooks
- Pages → Layouts → Components

##### Architectural Patterns to Highlight

A. Client-Side Architecture:
- Next.js page router structure
- Component composition
- Custom hooks pattern

B. API Architecture:
- REST API endpoints
- WebSocket real-time communication
- API client abstraction

##### Important Details

- Authentication flow (indicated by AuthLayout)
- Real-time updates via WebSocket
- Event management workflow
- RSVP processing flow
- Integration

##### External Services Layer

Left to Right:

##### Technical Stack Callouts

- Next.js Framework
- Tailwind CSS (indicated by tailwind.config.mjs)
- WebSocket Implementation
- API Integration
- Service Integration

- Component relationships
- Data flow patterns
- External service integration
- Real-time communication
- State management
- Authentication flow

This system design should effectively communicate how the various parts of Eventory work together to provide event management functionality with real-time updates and map integration.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        Pages["Pages"]
        Components["Components"]
        Layouts["Layouts"]

        subgraph Pages
            HomePage["Home Page"]:::frontend
            EventDiscovery["Event Discovery"]:::frontend
            RSVPPage["RSVP Page"]:::frontend
        end

        subgraph Components
            Navbar["Navbar"]:::frontend
            EventCard["EventCard"]:::frontend
            EventFilter["EventFilter"]:::frontend
            MapView["MapView"]:::frontend
            RSVPButton["RSVPButton"]:::frontend
            EventList["Event List"]:::frontend
            EventDetails["Event Details"]:::frontend
            RSVPForm["RSVP Form"]:::frontend
        end

        subgraph Layouts
            AuthLayout["Auth Layout"]:::frontend
            MainLayout["Main Layout"]:::frontend
        end
    end

    subgraph "Application Logic"
        Hooks["Custom Hooks"]
        Utils["Utilities"]

        subgraph Hooks
            UseEventAPI["useEventAPI"]:::logic
            UseWebSocket["useWebSocket"]:::logic
        end

        subgraph Utils
            APIClient["API Client"]:::logic
        end
    end

    subgraph "API Layer"
        APIRoutes["API Routes"]:::api
        WebSocketConfig["WebSocket Config"]:::api
        APIConfig["API Config"]:::api
    end

    subgraph "External Services"
        MapService["Map Service"]:::external
        EventStore["Event Data Store"]:::external
        WebSocketServer["WebSocket Server"]:::external
    end

    %% Relationships
    Pages --> Layouts
    Layouts --> Components
    Components --> Hooks
    Hooks --> Utils
    Utils --> APIRoutes
    APIRoutes --> EventStore
    MapView --> MapService
    UseWebSocket --> WebSocketServer
    APIClient --> APIRoutes
    WebSocketConfig --> WebSocketServer

    %% Click Events
    click HomePage "https://github.com/t1modo/Eventory/blob/main/src/app/page.jsx"
    click EventDiscovery "https://github.com/t1modo/Eventory/blob/main/src/app/event-discovery/page.jsx"
    click RSVPPage "https://github.com/t1modo/Eventory/blob/main/src/app/rsvp/page.jsx"
    click Navbar "https://github.com/t1modo/Eventory/blob/main/src/app/components/Navbar.jsx"
    click EventCard "https://github.com/t1modo/Eventory/blob/main/src/app/components/EventCard.jsx"
    click EventFilter "https://github.com/t1modo/Eventory/blob/main/src/app/components/EventFilter.jsx"
    click MapView "https://github.com/t1modo/Eventory/blob/main/src/app/components/MapView.jsx"
    click RSVPButton "https://github.com/t1modo/Eventory/blob/main/src/app/components/RSVPButton.jsx"
    click AuthLayout "https://github.com/t1modo/Eventory/blob/main/src/app/layouts/AuthLayout.jsx"
    click MainLayout "https://github.com/t1modo/Eventory/blob/main/src/app/layouts/MainLayout.jsx"
    click APIRoutes "https://github.com/t1modo/Eventory/blob/main/src/app/api/route.js"
    click APIConfig "https://github.com/t1modo/Eventory/blob/main/src/app/config/api.js"
    click WebSocketConfig "https://github.com/t1modo/Eventory/blob/main/src/app/config/websocket.js"
    click UseEventAPI "https://github.com/t1modo/Eventory/blob/main/src/app/hooks/useEventAPI.js"
    click UseWebSocket "https://github.com/t1modo/Eventory/blob/main/src/app/hooks/useWebSocket.js"
    click APIClient "https://github.com/t1modo/Eventory/blob/main/src/app/utils/apiClient.js"
    click EventList "https://github.com/t1modo/Eventory/blob/main/src/app/event-discovery/EventList.jsx"
    click EventDetails "https://github.com/t1modo/Eventory/blob/main/src/app/event-discovery/EventDetails.jsx"
    click RSVPForm "https://github.com/t1modo/Eventory/blob/main/src/app/rsvp/RSVPForm.jsx"

    %% Styling
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef logic fill:#9b59b6,stroke:#8e44ad,color:white
    classDef api fill:#2ecc71,stroke:#27ae60,color:white
    classDef external fill:#f1c40f,stroke:#f39c12,color:white

    %% Legend
    subgraph Legend
        Frontend_L["Frontend Components"]:::frontend
        Logic_L["Application Logic"]:::logic
        API_L["API Layer"]:::api
        External_L["External Services"]:::external
    end
```
