# alokshukla92/rpsls_bbt architecture

> Architecture diagram of the GitHub repository alokshukla92/rpsls_bbt, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/alokshukla92/rpsls_bbt
- Repository: https://github.com/alokshukla92/rpsls_bbt

## Overview

##### Project type and purpose
- This is a standalone desktop game application written in Python that uses a camera for gesture recognition (rock-paper-scissors-lizard-Spock).
- It combines a Kivy-based GUI (frontend.py + RPSLS.kv), a TensorFlow/Keras model (rock-paper-scissors-model3.h5), OpenCV for video capture, and game-logic in play.py.

##### File structure
- Top-level files:
- README.md – setup instructions
- requirements.txt – Python dependencies (Kivy, OpenCV, TensorFlow, etc.)
- RPSLS/ directory:
- frontend.py & RPSLS.kv – defines the GUI view and controllers
- play.py – core game loop: grab frames, run ML model, decide winner
- rock-paper-scissors-model3.h5 – pretrained gesture-classification model
- frontend.spec – PyInstaller spec for packaging

##### README for additional insights
- Dependencies installation: pip install -r requirements.txt
- About toggling between default camera (0) and external (1) in play.py.
- “Run the frontend.py file” to start the app.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Main components
    User(("User")):::hardware
    Camera["Camera Module<br/>(OpenCV)"]:::hardware
    Game["Game Logic Module<br/>(play.py)"]:::code
    Model["ML Model<br/>(rock-paper-scissors-model3.h5)"]:::ml
    Frontend["Frontend/UI<br/>(frontend.py + RPSLS.kv)"]:::code
    Assets["Assets<br/>(images/)"]:::resources

    %% Project metadata
    subgraph "Project Metadata"
        spec["Packaging<br/>(frontend.spec)"]:::code
        req["Dependencies<br/>(requirements.txt)"]:::docs
        readme["README.md"]:::docs
    end

    %% Data & control flow
    User -->|"gesture"| Camera
    Camera -->|"cv2.Frame"| Game
    Game -->|"Tensor array"| Model
    Model -->|"classification"| Game
    Game -->|"GameResult"| Frontend
    Assets --> Frontend
    Frontend -->|"display"| User

    %% Metadata relations
    spec -.-> Frontend
    spec -.-> Game
    req -.-> Game
    req -.-> Frontend
    readme -.-> req

    %% Click Events
    click Frontend "https://github.com/alokshukla92/rpsls_bbt/blob/main/RPSLS/frontend.py"
    click Camera "https://github.com/alokshukla92/rpsls_bbt/blob/main/RPSLS/play.py"
    click Assets "https://github.com/alokshukla92/rpsls_bbt/tree/main/RPSLS/images/"
    click Model "https://github.com/alokshukla92/rpsls_bbt/blob/main/RPSLS/rock-paper-scissors-model3.h5"
    click spec "https://github.com/alokshukla92/rpsls_bbt/blob/main/RPSLS/frontend.spec"
    click req "https://github.com/alokshukla92/rpsls_bbt/blob/main/RPSLS/requirements.txt"
    click readme "https://github.com/alokshukla92/rpsls_bbt/blob/main/README.md"
    click Frontend "https://github.com/alokshukla92/rpsls_bbt/blob/main/RPSLS/RPSLS.kv"

    %% Styles
    classDef code fill:#D0E8FF,stroke:#0366D6,color:#0366D6,stroke-width:1px;
    classDef ml fill:#E2F7D4,stroke:#28A745,color:#28A745,stroke-width:1px;
    classDef hardware fill:#FFE5B4,stroke:#FF8C00,color:#FF8C00,stroke-width:1px;
    classDef resources fill:#FFF5BA,stroke:#D4A017,color:#D4A017,stroke-width:1px;
    classDef docs fill:#F0F0F0,stroke:#6A737D,color:#6A737D,stroke-width:1px;
```
