# ewanbrinkman/do-you-know-there architecture

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

- Interactive diagram: https://gitdiagram.com/ewanbrinkman/do-you-know-there
- Repository: https://github.com/ewanbrinkman/do-you-know-there

## Overview

##### Main Components

a. Frontend Layer:
- Next.js Application (Core)
- Game Components
- GameContainer
- GameLocationImage
- GameMap
- ResultsContainer
- Common Components
- Button
- Container
- LocationImage
- Map
- Layout Components
- Navbar

b. Data Layer:
- Assets and Configuration
- Area Data (locations.json, map.json, info.json)
- Game Configuration
- Theme Configuration
- Image Storage
- Location Images
- Processed/Optimized Images

c. Build/Processing Layer:
- Image Processing Pipeline
- Static Site Generation

##### Component Relationships

**[Client Browser] ←→ [Next.js Frontend]**
- ↓
**[Frontend Components] → [Game Logic] → [Data Layer]**
- ↓
**[Static Assets] ← [Build Pipeline] ← [Raw Assets]**

##### Specific Implementation Details

- Blue rectangles for React components
- Yellow diamonds for processing pipelines
- Gray rectangles for configuration files
- Purple hexagons for build/optimization processes

##### Key Architectural Patterns to Highlight

a. Component Architecture:
- Hierarchy of components (Features > Game > specific components)
- Shared Common components

b. Data Flow:
- How location data flows from static files to game components
- Image processing pipeline

c. Build Process:
- Demonstrate image optimization flow
- Static site generation process

##### Important Elements

- Version/environment information
- External dependencies (if any)
- Entry points and user interaction flows

##### Specific Implementation Notes

- Annotations for key configuration points
- Notes about image processing requirements

##### The component hierarchy and reuse patterns

Remember to include a note about the single-area current limitation and future multi-area support plans.

This architecture should be represented in a clean, professional manner that clearly shows the modern Next.js application structure while highlighting the game-specific components and data flow.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Web Browser"]
    end

    subgraph NextApp["Next.js Application"]
        direction TB
        AppCore["Next.js Core"]:::core
        click AppCore "https://github.com/ewanbrinkman/do-you-know-there/tree/main/src/app"

        subgraph Components["Component Layer"]
            direction TB
            
            subgraph GameComponents["Game Components"]
                direction TB
                GC["GameContainer"]:::component
                GLI["GameLocationImage"]:::component
                GM["GameMap"]:::component
                RC["ResultsContainer"]:::component
                click GC "https://github.com/ewanbrinkman/do-you-know-there/blob/main/src/app/components/Features/Game/GameContainer/GameContainer.tsx"
                click GLI "https://github.com/ewanbrinkman/do-you-know-there/blob/main/src/app/components/Features/Game/GameLocationImage/GameLocationImage.tsx"
                click GM "https://github.com/ewanbrinkman/do-you-know-there/blob/main/src/app/components/Features/Game/GameMap/GameMap.tsx"
                click RC "https://github.com/ewanbrinkman/do-you-know-there/blob/main/src/app/components/Features/Game/ResultsContainer/ResultsContainer.tsx"
            end

            subgraph CommonComponents["Common Components"]
                direction TB
                Btn["Button"]:::component
                Cont["Container"]:::component
                LImg["LocationImage"]:::component
                Map["Map"]:::component
                click Btn "https://github.com/ewanbrinkman/do-you-know-there/blob/main/src/app/components/Common/Button/Button.tsx"
                click Cont "https://github.com/ewanbrinkman/do-you-know-there/blob/main/src/app/components/Common/Container/Container.tsx"
                click LImg "https://github.com/ewanbrinkman/do-you-know-there/blob/main/src/app/components/Common/LocationImage/LocationImage.tsx"
                click Map "https://github.com/ewanbrinkman/do-you-know-there/blob/main/src/app/components/Common/Map/Map.tsx"
            end

            subgraph LayoutComponents["Layout Components"]
                Nav["Navbar"]:::component
                click Nav "https://github.com/ewanbrinkman/do-you-know-there/blob/main/src/app/components/Layouts/Navbar/Navbar.tsx"
            end
        end

        subgraph DataLayer["Data Layer"]
            direction TB
            AreaData[("Area Data")]:::data
            GameConfig[("Game Config")]:::config
            ThemeConfig[("Theme Config")]:::config
            MapConfig[("Map Config")]:::config
            click AreaData "https://github.com/ewanbrinkman/do-you-know-there/tree/main/src/assets/data/areas/sfu-burnaby"
            click GameConfig "https://github.com/ewanbrinkman/do-you-know-there/blob/main/src/assets/config/game.json"
            click ThemeConfig "https://github.com/ewanbrinkman/do-you-know-there/blob/main/src/assets/config/theme.json"
            click MapConfig "https://github.com/ewanbrinkman/do-you-know-there/blob/main/src/assets/config/map.json"
        end

        subgraph ImageStorage["Image Storage"]
            direction TB
            LocationImages[("Location Images")]:::storage
            RawImages[("Raw Images")]:::storage
            click LocationImages "https://github.com/ewanbrinkman/do-you-know-there/tree/main/public/images/areas/sfu-burnaby/locations"
            click RawImages "https://github.com/ewanbrinkman/do-you-know-there/tree/main/src/assets/images/areas/sfu-burnaby/locations"
        end

        subgraph BuildLayer["Build/Processing Layer"]
            direction TB
            ImageProcessor{{"Image Processing Pipeline"}}:::process
            click ImageProcessor "https://github.com/ewanbrinkman/do-you-know-there/blob/main/scripts/buildImages.ts"
        end

        subgraph Utils["Utilities"]
            direction TB
            Loaders["Data Loaders"]:::util
            Getters["Data Getters"]:::util
            click Loaders "https://github.com/ewanbrinkman/do-you-know-there/tree/main/src/app/utils/loaders"
            click Getters "https://github.com/ewanbrinkman/do-you-know-there/tree/main/src/app/utils/getters"
        end

        subgraph Types["Type Definitions"]
            direction TB
            GameTypes["Game Types"]:::type
            DataTypes["Data Types"]:::type
            CommonTypes["Common Types"]:::type
            click GameTypes "https://github.com/ewanbrinkman/do-you-know-there/tree/main/src/app/types/game"
            click DataTypes "https://github.com/ewanbrinkman/do-you-know-there/tree/main/src/app/types/data"
            click CommonTypes "https://github.com/ewanbrinkman/do-you-know-there/tree/main/src/app/types/common"
        end
    end

    Browser <--> AppCore
    AppCore --> Components
    Components --> DataLayer
    ImageProcessor --> LocationImages
    RawImages --> ImageProcessor
    Utils --> DataLayer
    Types --> Components

    classDef core fill:#1E40AF,color:white
    classDef component fill:#60A5FA,color:black
    classDef data fill:#059669,color:white
    classDef config fill:#D97706,color:black
    classDef storage fill:#7C3AED,color:white
    classDef process fill:#DC2626,color:white
    classDef util fill:#DB2777,color:white
    classDef type fill:#4B5563,color:white

    %% Legend
    subgraph Legend
        L1["Core"]:::core
        L2["Component"]:::component
        L3["Data Store"]:::data
        L4["Configuration"]:::config
        L5["Storage"]:::storage
        L6["Process"]:::process
        L7["Utility"]:::util
        L8["Types"]:::type
    end
```
