# sriharichincholi/manashot-io architecture

> Architecture diagram of the GitHub repository sriharichincholi/manashot-io, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sriharichincholi/manashot-io
- Repository: https://github.com/sriharichincholi/manashot-io

## Overview

ManaShot.io is a browser-based, first-person arena game with real-time multiplayer synchronization. The main loop takes player input through the game controller, updates movement and combat against demons, and presents status and effects through the HUD, audio, and rendered scene. The server serves the browser assets and relays player and spell events. The README is empty, and source excerpts are partial; the graph reflects documented behavior and sampled code, leaving uncertain wiring out.

Main entry points: [`public/client.js`](https://github.com/sriharichincholi/manashot-io/blob/main/public/client.js) (Game controller), [`server/server.js`](https://github.com/sriharichincholi/manashot-io/blob/main/server/server.js) (Game server), [`public/js/weapon.js`](https://github.com/sriharichincholi/manashot-io/blob/main/public/js/weapon.js) (Weapon and projectiles), [`public/js/demons.js`](https://github.com/sriharichincholi/manashot-io/blob/main/public/js/demons.js) (Demon AI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser game"]
  node_controller["Game controller<br/>[client.js]"]
end

subgraph group_gameplay["Arena gameplay"]
  node_environment["Arena environment<br/>[environment.js]"]
  node_weapon["Weapon and projectiles<br/>[weapon.js]"]
  node_demons["Demon AI<br/>[demons.js]"]
end

subgraph group_presentation["Game presentation"]
  node_particles["Particle effects<br/>[particles.js]"]
  node_hud["HUD<br/>[hud.js]"]
  node_audio["Procedural audio<br/>[audio.js]"]
end

subgraph group_multiplayer["Multiplayer"]
  node_network["Network manager<br/>[network.js]"]
  node_server["Game server<br/>[server.js]"]
  node_player_state[("Player state<br/>[server.js]")]
end

node_player(("Player"))
node_browser(("Browser"))

node_player -->|"plays in"| node_browser
node_browser -->|"loads game"| node_controller
node_controller -->|"creates arena"| node_environment
node_controller -->|"handles firing"| node_weapon
node_controller -->|"updates combat"| node_demons
node_controller -->|"syncs gameplay"| node_network
node_controller -->|"updates display"| node_hud
node_controller -->|"updates effects"| node_particles
node_controller -->|"plays landing sound"| node_audio
node_weapon -->|"spawns trails"| node_particles
node_weapon -->|"plays firing sound"| node_audio
node_demons -->|"spawns trails"| node_particles
node_demons -->|"reports player hits"| node_controller
node_controller -->|"reports combat events"| node_hud
node_network -->|"emits socket events"| node_server
node_server -->|"broadcasts game events"| node_network
node_server -->|"updates player records"| node_player_state
node_browser -->|"requests game assets"| node_server
node_server -->|"serves public files"| node_browser

click node_controller "https://github.com/sriharichincholi/manashot-io/blob/main/public/client.js"
click node_environment "https://github.com/sriharichincholi/manashot-io/blob/main/public/js/environment.js"
click node_weapon "https://github.com/sriharichincholi/manashot-io/blob/main/public/js/weapon.js"
click node_demons "https://github.com/sriharichincholi/manashot-io/blob/main/public/js/demons.js"
click node_particles "https://github.com/sriharichincholi/manashot-io/blob/main/public/js/particles.js"
click node_hud "https://github.com/sriharichincholi/manashot-io/blob/main/public/js/hud.js"
click node_audio "https://github.com/sriharichincholi/manashot-io/blob/main/public/js/audio.js"
click node_network "https://github.com/sriharichincholi/manashot-io/blob/main/public/js/network.js"
click node_server "https://github.com/sriharichincholi/manashot-io/blob/main/server/server.js"
click node_player_state "https://github.com/sriharichincholi/manashot-io/blob/main/server/server.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_controller,node_browser toneBlue
class node_environment,node_weapon,node_demons toneAmber
class node_particles,node_hud,node_audio toneMint
class node_network,node_server,node_player_state toneRose
class node_player toneIndigo
```

## Components

### Browser game

- [Game controller](https://github.com/sriharichincholi/manashot-io/blob/main/public/client.js): `public/client.js`

### Arena gameplay

- [Arena environment](https://github.com/sriharichincholi/manashot-io/blob/main/public/js/environment.js): `public/js/environment.js`
- [Weapon and projectiles](https://github.com/sriharichincholi/manashot-io/blob/main/public/js/weapon.js): `public/js/weapon.js`
- [Demon AI](https://github.com/sriharichincholi/manashot-io/blob/main/public/js/demons.js): `public/js/demons.js`

### Game presentation

- [Particle effects](https://github.com/sriharichincholi/manashot-io/blob/main/public/js/particles.js): `public/js/particles.js`
- [HUD](https://github.com/sriharichincholi/manashot-io/blob/main/public/js/hud.js): `public/js/hud.js`
- [Procedural audio](https://github.com/sriharichincholi/manashot-io/blob/main/public/js/audio.js): `public/js/audio.js`

### Multiplayer

- [Network manager](https://github.com/sriharichincholi/manashot-io/blob/main/public/js/network.js): `public/js/network.js`
- [Game server](https://github.com/sriharichincholi/manashot-io/blob/main/server/server.js): `server/server.js`
- [Player state](https://github.com/sriharichincholi/manashot-io/blob/main/server/server.js): `server/server.js`

### Other components

- **Player**
- **Browser**

## Connections

- Player → Browser: plays in
- Browser → Game controller: loads game
- Game controller → Arena environment: creates arena
- Game controller → Weapon and projectiles: handles firing
- Game controller → Demon AI: updates combat
- Game controller → Network manager: syncs gameplay
- Game controller → HUD: updates display
- Game controller → Particle effects: updates effects
- Game controller → Procedural audio: plays landing sound
- Weapon and projectiles → Particle effects: spawns trails
- Weapon and projectiles → Procedural audio: plays firing sound
- Demon AI → Particle effects: spawns trails
- Demon AI → Game controller: reports player hits
- Game controller → HUD: reports combat events
- Network manager → Game server: emits socket events
- Game server → Network manager: broadcasts game events
- Game server → Player state: updates player records
- Browser → Game server: requests game assets
- Game server → Browser: serves public files
