# team-greencamp/roly-poly architecture

> Architecture diagram of the GitHub repository team-greencamp/roly-poly, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/team-greencamp/roly-poly
- Repository: https://github.com/team-greencamp/roly-poly

## Overview

Roly-Poly is a Unity multiplayer party game centered on wobbly physics-based characters, obstacle interaction, and cooperative stage progression, with an Express/MySQL lobby service. The documented player flow is input and movement, world interaction, cooperation toward a goal, then progression to another round; room discovery and joining form a separate lobby flow. The tree does not contain the documented Unity gameplay scripts, scenes, or UI, so those capabilities are represented at the existing Assets directory level. Unity subsystem links rely on README statements; backend links are supported by the sampled source.

Main entry points: [`Assets`](https://github.com/team-greencamp/roly-poly/tree/main/Assets) (Player), [`backend/src/app.js`](https://github.com/team-greencamp/roly-poly/blob/main/backend/src/app.js) (Room REST API), [`backend/src/db.js`](https://github.com/team-greencamp/roly-poly/blob/main/backend/src/db.js) (MySQL Pool), [`backend/src/server.js`](https://github.com/team-greencamp/roly-poly/blob/main/backend/src/server.js) (HTTP Server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gameplay["Unity Gameplay"]
  node_player["Player"]
  node_physics["Character Physics"]
  node_actions["Player Actions"]
  node_world["World Interactables"]
  node_progression["Stage Progression"]
end

subgraph group_network["Networking"]
  node_netcode["Netcode Sync"]
  node_relay{{"Unity Relay"}}
end

subgraph group_lobby["Lobby Service"]
  node_roomclient["Room API Client"]
  node_httpapi["Room REST API<br/>[app.js]"]
  node_server["HTTP Server<br/>[server.js]"]
  node_pool["MySQL Pool<br/>[db.js]"]
  node_mysql[("MySQL Rooms")]
end

subgraph group_presentation["Client Presentation"]
  node_ui["Game UI"]
end

node_player_actor(("Player"))

node_player_actor -->|"controls"| node_player
node_player -->|"drives movement"| node_physics
node_physics -->|"enables actions"| node_actions
node_player -->|"interacts with"| node_world
node_world -->|"supports goals"| node_progression
node_progression -->|"advances round"| node_player
node_netcode -->|"syncs state"| node_physics
node_netcode -->|"syncs gimmicks"| node_world
node_player -->|"submits input"| node_netcode
node_ui -.->|"uses room API"| node_roomclient
node_roomclient -->|"calls REST"| node_httpapi
node_httpapi -->|"queries rooms"| node_pool
node_pool -->|"reads and writes"| node_mysql
node_server -->|"serves app"| node_httpapi
node_netcode -.->|"may use Relay"| node_relay

click node_player "https://github.com/team-greencamp/roly-poly/tree/main/Assets"
click node_physics "https://github.com/team-greencamp/roly-poly/tree/main/Assets"
click node_actions "https://github.com/team-greencamp/roly-poly/tree/main/Assets"
click node_world "https://github.com/team-greencamp/roly-poly/tree/main/Assets"
click node_progression "https://github.com/team-greencamp/roly-poly/tree/main/Assets"
click node_netcode "https://github.com/team-greencamp/roly-poly/tree/main/Assets"
click node_ui "https://github.com/team-greencamp/roly-poly/tree/main/Assets"
click node_roomclient "https://github.com/team-greencamp/roly-poly/tree/main/Assets"
click node_httpapi "https://github.com/team-greencamp/roly-poly/blob/main/backend/src/app.js"
click node_server "https://github.com/team-greencamp/roly-poly/blob/main/backend/src/server.js"
click node_pool "https://github.com/team-greencamp/roly-poly/blob/main/backend/src/db.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_player,node_physics,node_actions,node_world,node_progression toneBlue
class node_netcode,node_relay toneAmber
class node_roomclient,node_httpapi,node_server,node_pool,node_mysql toneMint
class node_ui toneRose
class node_player_actor toneIndigo
```

## Components

### Unity Gameplay

- [Player](https://github.com/team-greencamp/roly-poly/tree/main/Assets): `Assets`
- [Character Physics](https://github.com/team-greencamp/roly-poly/tree/main/Assets): `Assets`
- [Player Actions](https://github.com/team-greencamp/roly-poly/tree/main/Assets): `Assets`
- [World Interactables](https://github.com/team-greencamp/roly-poly/tree/main/Assets): `Assets`
- [Stage Progression](https://github.com/team-greencamp/roly-poly/tree/main/Assets): `Assets`

### Networking

- [Netcode Sync](https://github.com/team-greencamp/roly-poly/tree/main/Assets): `Assets`
- **Unity Relay**

### Lobby Service

- [Room API Client](https://github.com/team-greencamp/roly-poly/tree/main/Assets): `Assets`
- [Room REST API](https://github.com/team-greencamp/roly-poly/blob/main/backend/src/app.js): `backend/src/app.js`
- [HTTP Server](https://github.com/team-greencamp/roly-poly/blob/main/backend/src/server.js): `backend/src/server.js`
- [MySQL Pool](https://github.com/team-greencamp/roly-poly/blob/main/backend/src/db.js): `backend/src/db.js`
- **MySQL Rooms**

### Client Presentation

- [Game UI](https://github.com/team-greencamp/roly-poly/tree/main/Assets): `Assets`

### Other components

- **Player**

## Connections

- Player → Player: controls (evidence: `README.md`)
- Player → Character Physics: drives movement (evidence: `README.md`)
- Character Physics → Player Actions: enables actions (evidence: `README.md`)
- Player → World Interactables: interacts with (evidence: `README.md`)
- World Interactables → Stage Progression: supports goals (evidence: `README.md`)
- Stage Progression → Player: advances round (evidence: `README.md`)
- Netcode Sync → Character Physics: syncs state (evidence: `README.md`)
- Netcode Sync → World Interactables: syncs gimmicks (evidence: `README.md`)
- Player → Netcode Sync: submits input (evidence: `README.md`)
- Game UI → Room API Client: uses room API
- Room API Client → Room REST API: calls REST (evidence: `README.md`)
- Room REST API → MySQL Pool: queries rooms (evidence: `backend/src/app.js`)
- MySQL Pool → MySQL Rooms: reads and writes (evidence: `backend/src/db.js`)
- HTTP Server → Room REST API: serves app (evidence: `backend/src/server.js`)
- Netcode Sync → Unity Relay: may use Relay (evidence: `README.md`)
