# karinatiurina/rock_paper_scissors architecture

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

- Interactive diagram: https://gitdiagram.com/karinatiurina/rock_paper_scissors
- Repository: https://github.com/karinatiurina/rock_paper_scissors

## Overview

This Rails app serves a browser-based Rock–Paper–Scissors game. A player opens the game, chooses rock, scissors, or paper, and the show action generates a computer choice, determines the winner or a draw, and renders the result. The rules and random choice are implemented directly in the controller; no persistence layer is indicated. The view files are present in the tree, but their contents were not sampled, so their detailed form and rendering behavior is inferred from the README and filenames.

Main entry points: [`app/controllers/games_controller.rb`](https://github.com/karinatiurina/rock_paper_scissors/blob/master/app/controllers/games_controller.rb) (Games controller), [`config/routes.rb`](https://github.com/karinatiurina/rock_paper_scissors/blob/master/config/routes.rb) (Game routes), [`app/views/games/new.html.erb`](https://github.com/karinatiurina/rock_paper_scissors/blob/master/app/views/games/new.html.erb) (New game view), [`app/views/games/show.html.erb`](https://github.com/karinatiurina/rock_paper_scissors/blob/master/app/views/games/show.html.erb) (Round result view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web entry"]
  node_routes["Game routes<br/>[routes.rb]"]
end

subgraph group_game["Game round"]
  node_controller["Games controller"]
  node_round["Choice and winner"]
end

subgraph group_ui["Game interface"]
  node_new_view["New game view<br/>[new.html.erb]"]
  node_show_view["Round result view<br/>[show.html.erb]"]
end

node_player(("Player"))

node_player -->|"requests game"| node_routes
node_routes -->|"dispatches"| node_controller
node_controller -->|"renders new"| node_new_view
node_new_view -->|"offers choices"| node_player
node_player -->|"submits choice"| node_routes
node_controller -->|"generates and judges"| node_round
node_controller -->|"renders result"| node_show_view
node_show_view -->|"displays outcome"| node_player

click node_routes "https://github.com/karinatiurina/rock_paper_scissors/blob/master/config/routes.rb"
click node_controller "https://github.com/karinatiurina/rock_paper_scissors/blob/master/app/controllers/games_controller.rb"
click node_round "https://github.com/karinatiurina/rock_paper_scissors/blob/master/app/controllers/games_controller.rb"
click node_new_view "https://github.com/karinatiurina/rock_paper_scissors/blob/master/app/views/games/new.html.erb"
click node_show_view "https://github.com/karinatiurina/rock_paper_scissors/blob/master/app/views/games/show.html.erb"

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_routes toneBlue
class node_controller,node_round toneAmber
class node_new_view,node_show_view toneMint
class node_player toneIndigo
```

## Components

### Web entry

- [Game routes](https://github.com/karinatiurina/rock_paper_scissors/blob/master/config/routes.rb): `config/routes.rb`

### Game round

- [Games controller](https://github.com/karinatiurina/rock_paper_scissors/blob/master/app/controllers/games_controller.rb): `app/controllers/games_controller.rb`
- [Choice and winner](https://github.com/karinatiurina/rock_paper_scissors/blob/master/app/controllers/games_controller.rb): `app/controllers/games_controller.rb`

### Game interface

- [New game view](https://github.com/karinatiurina/rock_paper_scissors/blob/master/app/views/games/new.html.erb): `app/views/games/new.html.erb`
- [Round result view](https://github.com/karinatiurina/rock_paper_scissors/blob/master/app/views/games/show.html.erb): `app/views/games/show.html.erb`

### Other components

- **Player**

## Connections

- Player → Game routes: requests game
- Game routes → Games controller: dispatches
- Games controller → New game view: renders new
- New game view → Player: offers choices
- Player → Game routes: submits choice
- Games controller → Choice and winner: generates and judges
- Games controller → Round result view: renders result
- Round result view → Player: displays outcome
