# kavin25r/rock-paper-scissors-game architecture

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

- Interactive diagram: https://gitdiagram.com/kavin25r/rock-paper-scissors-game
- Repository: https://github.com/kavin25r/rock-paper-scissors-game

## Overview

This is a Spring Boot Rock-Paper-Scissors game exposed through a REST API. A client can start a game, submit choices for rounds, or quit; the service generates computer choices, updates the score and returns a message and scores. The application entry point starts Spring Boot. The excerpts show the controller-to-service calls and the service’s use of Score; no database or other external integration is evident.

Main entry points: [`src/main/java/com/game/rock_paper_scissors/controller/RPS_Controller.java`](https://github.com/kavin25r/rock-paper-scissors-game/blob/main/src/main/java/com/game/rock_paper_scissors/controller/RPS_Controller.java) (Game Controller), [`src/main/java/com/game/rock_paper_scissors/service/RPS_Service.java`](https://github.com/kavin25r/rock-paper-scissors-game/blob/main/src/main/java/com/game/rock_paper_scissors/service/RPS_Service.java) (Game Service), [`src/main/java/com/game/rock_paper_scissors/util/Score.java`](https://github.com/kavin25r/rock-paper-scissors-game/blob/main/src/main/java/com/game/rock_paper_scissors/util/Score.java) (Game Score)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_controller["Game Controller"]
end

subgraph group_game["Game Runtime"]
  node_service["Game Service<br/>[RPS_Service.java]"]
  node_score["Game Score<br/>[Score.java]"]
end

subgraph group_platform["Application Startup"]
  node_application["Boot Application"]
end

node_client(("API Client"))

node_client -->|"calls endpoints"| node_controller
node_controller -->|"dispatches actions"| node_service
node_service -->|"reads and updates"| node_score

click node_controller "https://github.com/kavin25r/rock-paper-scissors-game/blob/main/src/main/java/com/game/rock_paper_scissors/controller/RPS_Controller.java"
click node_service "https://github.com/kavin25r/rock-paper-scissors-game/blob/main/src/main/java/com/game/rock_paper_scissors/service/RPS_Service.java"
click node_score "https://github.com/kavin25r/rock-paper-scissors-game/blob/main/src/main/java/com/game/rock_paper_scissors/util/Score.java"
click node_application "https://github.com/kavin25r/rock-paper-scissors-game/blob/main/src/main/java/com/game/rock_paper_scissors/RockPaperScissorsApplication.java"

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_client toneBlue
class node_service,node_score toneAmber
class node_application toneMint
```

## Components

### HTTP API

- [Game Controller](https://github.com/kavin25r/rock-paper-scissors-game/blob/main/src/main/java/com/game/rock_paper_scissors/controller/RPS_Controller.java): `src/main/java/com/game/rock_paper_scissors/controller/RPS_Controller.java`

### Game Runtime

- [Game Service](https://github.com/kavin25r/rock-paper-scissors-game/blob/main/src/main/java/com/game/rock_paper_scissors/service/RPS_Service.java): `src/main/java/com/game/rock_paper_scissors/service/RPS_Service.java`
- [Game Score](https://github.com/kavin25r/rock-paper-scissors-game/blob/main/src/main/java/com/game/rock_paper_scissors/util/Score.java): `src/main/java/com/game/rock_paper_scissors/util/Score.java`

### Application Startup

- [Boot Application](https://github.com/kavin25r/rock-paper-scissors-game/blob/main/src/main/java/com/game/rock_paper_scissors/RockPaperScissorsApplication.java): `src/main/java/com/game/rock_paper_scissors/RockPaperScissorsApplication.java`

### Other components

- **API Client**

## Connections

- API Client → Game Controller: calls endpoints (evidence: `src/main/java/com/game/rock_paper_scissors/controller/RPS_Controller.java`)
- Game Controller → Game Service: dispatches actions (evidence: `src/main/java/com/game/rock_paper_scissors/controller/RPS_Controller.java`)
- Game Service → Game Score: reads and updates (evidence: `src/main/java/com/game/rock_paper_scissors/service/RPS_Service.java`)
