# lukaleskovsek/not-your-boring-slides architecture

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

- Interactive diagram: https://gitdiagram.com/lukaleskovsek/not-your-boring-slides
- Repository: https://github.com/lukaleskovsek/not-your-boring-slides

## Overview

##### Main Components

A. Frontend Layer:
- Divide into three main sections:
1. Core Presentation Components
- PresentationProvider (state management)
- PresentationViewer
- PresentationEditor
- Slide Components
2. UI Components Library
- As a collection of reusable components
3. Feature Components
- Charts (PieChart, ProgressBar)
- Effects (FlyingEmoji)

B. State Management & Hooks Layer:
- This below the Frontend Layer
- Include:
- Zustand Store (presentationStore)
- Custom Hooks
- useKeyboardNavigation
- usePresentationContext
- useSlideEffect

C. Backend Layer:
- At the bottom
- Include:
1. API Routes
2. Controllers
3. Repositories
4. Middleware Components

##### Component Relationships

- Frontend → Backend API calls
- Component hierarchy in the frontend
- Data flow through the application
- Middleware pipeline in the backend

##### Specific Implementation Details

**┌─────────────────────────── Frontend Layer ───────────────────────────┐**

- ┌─ Core Presentation ─┐  ┌─── UI Library ───┐  ┌─── Features ────┐ │
- PresentationViewer│  │ - Button         │  │ - PieChart      │ │
- PresentationEditor│  │ - Dialog         │  │ - ProgressBar   │ │
- Slide Components  │  │ - Form Controls  │  │ - FlyingEmoji   │ │
- ┘  └────────────────┘ │

- State Management & Hooks Layer ─────────────────┤

- ┌─── Zustand Store ──┐  ┌─────── Hooks ──────┐                   │
- PresentationStore  │  │ useKeyboardNav     │                   │
- Slides          │  │ usePresentContext   │                   │
- Settings        │  │ useSlideEffect      │                   │
- ┘  └──────────────────────┘                   │

- Backend Layer ────────────────────────────┤

- ┌─── API Routes ────┐  ┌─── Controllers ───┐  ┌── Middleware ──┐ │
- /presentation     │  │ PresentationCtrl  │  │ ErrorHandler   │ │
- ┘  └─────────────────┘  │ RateLimiter    │ │
- Logger         │ │
- ┌── Repositories ──┐                      └───────────────┘ │
- PresentationRepo │                                        │
- ┘                                         │
- ┘

##### Additional Elements

- Technology labels:
- React + TypeScript
- TailwindCSS
- Express
- Zustand
- Error handling paths
- Authentication/authorization boundaries

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef frontend fill:#e6f3ff,stroke:#3182ce
    classDef state fill:#e9d8fd,stroke:#805ad5
    classDef backend fill:#c6f6d5,stroke:#38a169
    classDef feature fill:#fed7d7,stroke:#e53e3e
    classDef ui fill:#feebc8,stroke:#dd6b20

    subgraph Frontend["Frontend Layer"]
        subgraph Core["Core Presentation"]
            PP[PresentationProvider]
            PV[PresentationViewer]
            PE[PresentationEditor]
            SC[Slide Components]
        end

        subgraph UILib["UI Components Library"]
            Dialog[Dialog]
            Button[Button]
            Form[Form Controls]
        end

        subgraph Features["Feature Components"]
            subgraph Charts
                PC[PieChart]
                PB[ProgressBar]
            end
            FE[FlyingEmoji]
        end
    end

    subgraph State["State Management & Hooks Layer"]
        subgraph Store["Zustand Store"]
            PS[PresentationStore]
        end

        subgraph Hooks["Custom Hooks"]
            KN[useKeyboardNavigation]
            PCT[usePresentationContext]
            SE[useSlideEffect]
        end
    end

    subgraph Backend["Backend Layer"]
        subgraph API["API Routes"]
            Routes["/presentation"]
        end

        subgraph Controllers
            PC2[PresentationController]
        end

        subgraph Middleware
            EH[ErrorHandler]
            RL[RateLimiter]
            Log[Logger]
        end

        subgraph Repos["Repositories"]
            PR[PresentationRepository]
        end
    end

    %% Relationships
    PP --> PS
    PV --> PS
    PE --> PS
    SC --> PP
    KN --> PV
    PCT --> PP
    SE --> SC
    PS --> Routes
    Routes --> PC2
    PC2 --> PR
    Routes --> EH
    Routes --> RL
    Routes --> Log

    %% Click Events
    click PP "https://github.com/LukaLeskovsek/not-your-boring-slides/blob/main/src/components/presentation/PresentationProvider.tsx"
    click PV "https://github.com/LukaLeskovsek/not-your-boring-slides/blob/main/src/components/presentation/PresentationViewer.tsx"
    click PE "https://github.com/LukaLeskovsek/not-your-boring-slides/blob/main/src/components/presentation/PresentationEditor.tsx"
    click SC "https://github.com/LukaLeskovsek/not-your-boring-slides/blob/main/src/components/presentation/Slide.tsx"
    click Dialog "https://github.com/LukaLeskovsek/not-your-boring-slides/blob/main/src/components/ui/dialog.tsx"
    click Button "https://github.com/LukaLeskovsek/not-your-boring-slides/blob/main/src/components/ui/button.tsx"
    click Form "https://github.com/LukaLeskovsek/not-your-boring-slides/blob/main/src/components/ui/form.tsx"
    click UILib "https://github.com/LukaLeskovsek/not-your-boring-slides/tree/main/src/components/ui/*"
    click PC "https://github.com/LukaLeskovsek/not-your-boring-slides/blob/main/src/components/charts/PieChart.tsx"
    click PB "https://github.com/LukaLeskovsek/not-your-boring-slides/blob/main/src/components/charts/ProgressBar.tsx"
    click FE "https://github.com/LukaLeskovsek/not-your-boring-slides/blob/main/src/components/effects/FlyingEmoji.tsx"
    click PS "https://github.com/LukaLeskovsek/not-your-boring-slides/blob/main/src/data/presentation/presentationStore.ts"
    click KN "https://github.com/LukaLeskovsek/not-your-boring-slides/blob/main/src/hooks/useKeyboardNavigation.ts"
    click PCT "https://github.com/LukaLeskovsek/not-your-boring-slides/blob/main/src/hooks/usePresentationContext.ts"
    click SE "https://github.com/LukaLeskovsek/not-your-boring-slides/blob/main/src/hooks/useSlideEffect.ts"
    click Routes "https://github.com/LukaLeskovsek/not-your-boring-slides/blob/main/src/server/routes/presentation.ts"
    click PC2 "https://github.com/LukaLeskovsek/not-your-boring-slides/blob/main/src/server/controllers/presentationController.ts"
    click PR "https://github.com/LukaLeskovsek/not-your-boring-slides/blob/main/src/server/repositories/presentationRepository.ts"
    click EH "https://github.com/LukaLeskovsek/not-your-boring-slides/blob/main/src/server/middleware/errorHandler.ts"
    click RL "https://github.com/LukaLeskovsek/not-your-boring-slides/blob/main/src/server/middleware/rateLimiter.ts"
    click Log "https://github.com/LukaLeskovsek/not-your-boring-slides/blob/main/src/server/middleware/logger.ts"

    %% Style Applications
    class PP,PV,PE,SC frontend
    class Dialog,Button,Form ui
    class PC,PB,FE feature
    class PS,KN,PCT,SE state
    class Routes,PC2,PR,EH,RL,Log backend
```
