# adeogu/dotsandboxesgame-adeogu-patch-3 architecture

> Architecture diagram of the GitHub repository adeogu/dotsandboxesgame-adeogu-patch-3, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/adeogu/dotsandboxesgame-adeogu-patch-3
- Repository: https://github.com/adeogu/dotsandboxesgame-adeogu-patch-3

## Overview

##### Project type and purpose
- It’s deployed to Heroku (Procfile present, deployment link in README).

##### File structure
- Top level:
- server.js – Express HTTP & WebSocket server entrypoint
- Procfile – Heroku startup directive (“web: node server.js”)
- package.json / package-lock.json – Node dependencies (likely express, socket.io)
- index.html, styles.css – UI shell + styling
- script.js – core game logic & UI rendering
- client.js + online.js – network layer (WebSocket/socket.io client code for turn‐by‐turn events)
- node_modules/ – dependencies

##### README
- Only contains the Heroku deployment URL. No database—game state is held in server memory.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client
    Browser["Browser / Player UI"]:::frontend

    %% Platform
    HerokuPlatform["Heroku PaaS"]:::platform

    %% Node.js Server Group
    subgraph "Node.js Server"
        HTTPServer["HTTP Server (Express)"]:::server
        WS["WebSocket Endpoint (socket.io/ws)"]:::server
        GSM["Game State Manager (in-memory)"]:::server

        subgraph "Static Asset Store"
            indexHTML["index.html"]:::frontend
            scriptJS["script.js"]:::frontend
            stylesCSS["styles.css"]:::frontend
            clientJS["client.js"]:::network
            onlineJS["online.js"]:::network
        end

        subgraph "Node.js Dependencies"
            pkgJSON["package.json"]:::modules
            pkgLock["package-lock.json"]:::modules
            nodeMods["node_modules/"]:::modules
        end
    end

    Procfile["Procfile"]:::modules
    README["README.md"]:::modules

    %% Connections
    Browser -->|"GET /index.html, /script.js, /styles.css, /client.js, /online.js"| HTTPServer
    Browser -->|"WS connect"| WS
    Browser -->|"&#39;move&#39; event"| WS
    WS -->|"&#39;state update&#39; broadcast"| Browser
    HTTPServer -->|serves static assets| indexHTML
    HTTPServer -->|serves static assets| scriptJS
    HTTPServer -->|serves static assets| stylesCSS
    HTTPServer -->|serves static assets| clientJS
    HTTPServer -->|serves static assets| onlineJS

    pkgJSON -->|loaded by| HTTPServer
    pkgLock -->|locked deps| HTTPServer
    nodeMods -->|provides modules| HTTPServer

    Procfile -->|startup directive| HerokuPlatform
    README -->|deployment info| HerokuPlatform
    HerokuPlatform -->|routes web traffic| HTTPServer
    HerokuPlatform -->|routes websocket traffic| WS

    %% Click Events
    click indexHTML "https://github.com/adeogu/dotsandboxesgame-adeogu-patch-3/blob/main/DotsAndBoxesGame-adeogu-patch-1/index.html"
    click scriptJS "https://github.com/adeogu/dotsandboxesgame-adeogu-patch-3/blob/main/DotsAndBoxesGame-adeogu-patch-1/script.js"
    click stylesCSS "https://github.com/adeogu/dotsandboxesgame-adeogu-patch-3/blob/main/DotsAndBoxesGame-adeogu-patch-1/styles.css"
    click clientJS "https://github.com/adeogu/dotsandboxesgame-adeogu-patch-3/blob/main/DotsAndBoxesGame-adeogu-patch-1/client.js"
    click onlineJS "https://github.com/adeogu/dotsandboxesgame-adeogu-patch-3/blob/main/DotsAndBoxesGame-adeogu-patch-1/online.js"
    click HTTPServer "https://github.com/adeogu/dotsandboxesgame-adeogu-patch-3/blob/main/DotsAndBoxesGame-adeogu-patch-1/server.js"
    click WS "https://github.com/adeogu/dotsandboxesgame-adeogu-patch-3/blob/main/DotsAndBoxesGame-adeogu-patch-1/server.js"
    click GSM "https://github.com/adeogu/dotsandboxesgame-adeogu-patch-3/blob/main/DotsAndBoxesGame-adeogu-patch-1/server.js"
    click pkgJSON "https://github.com/adeogu/dotsandboxesgame-adeogu-patch-3/blob/main/DotsAndBoxesGame-adeogu-patch-1/package.json"
    click pkgLock "https://github.com/adeogu/dotsandboxesgame-adeogu-patch-3/blob/main/DotsAndBoxesGame-adeogu-patch-1/package-lock.json"
    click nodeMods "https://github.com/adeogu/dotsandboxesgame-adeogu-patch-3/tree/main/DotsAndBoxesGame-adeogu-patch-1/node_modules/"
    click Procfile "https://github.com/adeogu/dotsandboxesgame-adeogu-patch-3/tree/main/DotsAndBoxesGame-adeogu-patch-1/Procfile"
    click README "https://github.com/adeogu/dotsandboxesgame-adeogu-patch-3/blob/main/DotsAndBoxesGame-adeogu-patch-1/README.md"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef network fill:#87CEFA,stroke:#000,stroke-width:1px
    classDef server fill:#90EE90,stroke:#000,stroke-width:1px
    classDef platform fill:#FFA500,stroke:#000,stroke-width:1px
    classDef modules fill:#E6E6FA,stroke:#000,stroke-width:1px
```
