# gautam7991679867/rps-rock-paper-scissors-project architecture

> Architecture diagram of the GitHub repository gautam7991679867/rps-rock-paper-scissors-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gautam7991679867/rps-rock-paper-scissors-project
- Repository: https://github.com/gautam7991679867/rps-rock-paper-scissors-project

## Overview

This is a browser-based Rock–Paper–Scissors game controlled by hand gestures. The player starts a round, shows a gesture to the camera, and the app recognizes it, chooses a robot gesture, determines the winner, updates scores, and begins another round. The graph separates camera setup, gesture recognition, game control, and presentation. Source excerpts show the main calls; the README confirms the game’s purpose. The camera and model libraries are external dependencies, not repository subsystems.

Main entry points: [`src/index.js`](https://github.com/gautam7991679867/rps-rock-paper-scissors-project/blob/main/src/index.js) (Game controller), [`src/js/Prediction.js`](https://github.com/gautam7991679867/rps-rock-paper-scissors-project/blob/main/src/js/Prediction.js) (Gesture prediction), [`src/js/UI.js`](https://github.com/gautam7991679867/rps-rock-paper-scissors-project/blob/main/src/js/UI.js) (Game UI), [`src/js/CameraConfig.js`](https://github.com/gautam7991679867/rps-rock-paper-scissors-project/blob/main/src/js/CameraConfig.js) (Camera settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_game["Game flow"]
  node_controller["Game controller<br/>[index.js]"]
  node_camera_config["Camera settings<br/>[CameraConfig.js]"]
end

subgraph group_recognition["Gesture recognition"]
  node_prediction["Gesture prediction<br/>[Prediction.js]"]
  node_gesture_defs["Gesture definitions<br/>[Gestures.js]"]
  node_sample_image["Warm-up image<br/>[SampleImage.js]"]
end

subgraph group_presentation["Game presentation"]
  node_ui["Game UI<br/>[UI.js]"]
  node_styles["Game styles<br/>[index.scss]"]
end

node_player(("Player"))
node_camera_api["Browser camera"]
node_handpose["Handpose model library"]
node_fingerpose["Fingerpose library"]

node_player -->|"starts rounds"| node_controller
node_controller -->|"controls display"| node_ui
node_controller -->|"requests predictions"| node_prediction
node_controller -->|"uses settings"| node_camera_config
node_controller -->|"imports styles"| node_styles
node_ui -->|"requests video"| node_camera_api
node_prediction -->|"estimates hands"| node_handpose
node_prediction -->|"estimates gestures"| node_fingerpose
node_prediction -->|"uses definitions"| node_gesture_defs
node_prediction -->|"warms model"| node_sample_image

click node_controller "https://github.com/gautam7991679867/rps-rock-paper-scissors-project/blob/main/src/index.js"
click node_camera_config "https://github.com/gautam7991679867/rps-rock-paper-scissors-project/blob/main/src/js/CameraConfig.js"
click node_ui "https://github.com/gautam7991679867/rps-rock-paper-scissors-project/blob/main/src/js/UI.js"
click node_styles "https://github.com/gautam7991679867/rps-rock-paper-scissors-project/blob/main/src/styles/index.scss"
click node_prediction "https://github.com/gautam7991679867/rps-rock-paper-scissors-project/blob/main/src/js/Prediction.js"
click node_gesture_defs "https://github.com/gautam7991679867/rps-rock-paper-scissors-project/blob/main/src/js/Gestures.js"
click node_sample_image "https://github.com/gautam7991679867/rps-rock-paper-scissors-project/blob/main/src/js/SampleImage.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_camera_config,node_camera_api toneBlue
class node_prediction,node_gesture_defs,node_sample_image toneAmber
class node_ui,node_styles toneMint
class node_player,node_handpose,node_fingerpose toneIndigo
```

## Components

### Game flow

- [Game controller](https://github.com/gautam7991679867/rps-rock-paper-scissors-project/blob/main/src/index.js): `src/index.js`
- [Camera settings](https://github.com/gautam7991679867/rps-rock-paper-scissors-project/blob/main/src/js/CameraConfig.js): `src/js/CameraConfig.js`

### Gesture recognition

- [Gesture prediction](https://github.com/gautam7991679867/rps-rock-paper-scissors-project/blob/main/src/js/Prediction.js): `src/js/Prediction.js`
- [Gesture definitions](https://github.com/gautam7991679867/rps-rock-paper-scissors-project/blob/main/src/js/Gestures.js): `src/js/Gestures.js`
- [Warm-up image](https://github.com/gautam7991679867/rps-rock-paper-scissors-project/blob/main/src/js/SampleImage.js): `src/js/SampleImage.js`

### Game presentation

- [Game UI](https://github.com/gautam7991679867/rps-rock-paper-scissors-project/blob/main/src/js/UI.js): `src/js/UI.js`
- [Game styles](https://github.com/gautam7991679867/rps-rock-paper-scissors-project/blob/main/src/styles/index.scss): `src/styles/index.scss`

### Other components

- **Player**
- **Browser camera**
- **Handpose model library**
- **Fingerpose library**

## Connections

- Player → Game controller: starts rounds (evidence: `src/index.js`)
- Game controller → Game UI: controls display (evidence: `src/index.js`)
- Game controller → Gesture prediction: requests predictions (evidence: `src/index.js`)
- Game controller → Camera settings: uses settings (evidence: `src/index.js`)
- Game controller → Game styles: imports styles (evidence: `src/index.js`)
- Game UI → Browser camera: requests video (evidence: `src/js/UI.js`)
- Gesture prediction → Handpose model library: estimates hands (evidence: `src/js/Prediction.js`)
- Gesture prediction → Fingerpose library: estimates gestures (evidence: `src/js/Prediction.js`)
- Gesture prediction → Gesture definitions: uses definitions (evidence: `src/js/Prediction.js`)
- Gesture prediction → Warm-up image: warms model (evidence: `src/js/Prediction.js`)
