# hmbenicio/slotsenginegame architecture

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

- Interactive diagram: https://gitdiagram.com/hmbenicio/slotsenginegame
- Repository: https://github.com/hmbenicio/slotsenginegame

## Overview

SlotsEngineGame is a client-side React Native slot-machine app: users enter through login or account creation, then play in the casino, where local state handles deposits, wagers, spins, payouts, withdrawals, sound, and settings; the bottom bar also opens the profile. There is no backend or real-money transaction processing. The graph follows documented routing and source-index references; account-address lookup is included as a documented ViaCEP integration, but its implementation was not sampled.

Main entry points: [`SlotsEngineGame/frontend/src/pages/CasinoPage.js`](https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/pages/CasinoPage.js) (Casino screen), [`SlotsEngineGame/frontend/src/styles/main.js`](https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/styles/main.js) (Shared styles), [`SlotsEngineGame/frontend/App.js`](https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/App.js) (App router), [`SlotsEngineGame/frontend/src/hooks/useSlotMachine.js`](https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/hooks/useSlotMachine.js) (Slot machine state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["App navigation"]
  node_app["App router<br/>[App.js]"]
  node_login["Login<br/>[LoginPage.js]"]
  node_signup["Account creation"]
  node_profile["Profile<br/>[ProfilePage.js]"]
end

subgraph group_casino["Casino experience"]
  node_casino["Casino screen<br/>[CasinoPage.js]"]
  node_deposit["Deposit controls<br/>[DepositSection.js]"]
  node_bet["Bet selector<br/>[BetSelector.js]"]
  node_board["Slot board<br/>[SlotBoard.js]"]
  node_stats["Play statistics<br/>[StatsRow.js]"]
  node_banner["Status banner<br/>[MessageBanner.js]"]
  node_withdraw["Withdrawal modal<br/>[WithdrawModal.js]"]
  node_settings["Settings modal<br/>[SettingsModal.js]"]
  node_bottom["Bottom navigation<br/>[BottomBar.js]"]
  node_header["Casino header<br/>[HeaderSection.js]"]
end

subgraph group_engine["Game and state engine"]
  node_state["Slot machine state<br/>[useSlotMachine.js]"]
  node_logic["Spin and payouts<br/>[slotLogic.js]"]
  node_grid["Grid conversion<br/>[grid.js]"]
  node_sounds["Sound playback<br/>[useSounds.js]"]
end

subgraph group_shared["Shared presentation"]
  node_gameconfig["Game settings<br/>[game.js]"]
  node_theme["Theme palette<br/>[theme.js]"]
  node_format["BRL formatting<br/>[format.js]"]
  node_styles["Shared styles<br/>[main.js]"]
end

node_player(("Player"))
node_viacep["ViaCEP"]

node_player -->|"opens app"| node_app
node_app -->|"starts at"| node_login
node_app -->|"routes to"| node_signup
node_app -->|"routes to"| node_casino
node_app -->|"routes to"| node_profile
node_login -->|"submits login"| node_app
node_signup -->|"submits or cancels"| node_app
node_signup -.->|"looks up address"| node_viacep
node_casino -->|"opens profile"| node_profile
node_casino -->|"uses game state"| node_state
node_casino -->|"renders"| node_deposit
node_casino -->|"renders"| node_bet
node_casino -->|"renders"| node_board
node_casino -->|"renders"| node_stats
node_casino -->|"renders"| node_banner
node_casino -->|"renders"| node_withdraw
node_casino -->|"renders"| node_settings
node_casino -->|"renders"| node_bottom
node_casino -->|"renders"| node_header
node_state -->|"runs rounds"| node_logic
node_state -->|"formats results"| node_grid
node_state -->|"plays cues"| node_sounds
node_state -->|"reads settings"| node_gameconfig
node_state -->|"formats amounts"| node_format
node_casino -->|"selects palette"| node_theme
node_casino -->|"reads game settings"| node_gameconfig
node_casino -->|"formats display"| node_format
node_withdraw -->|"reads colors"| node_theme
node_bet -->|"formats bet"| node_format
node_stats -->|"formats totals"| node_format
node_login -->|"uses palette"| node_theme
node_signup -->|"uses palette"| node_theme
node_profile -->|"uses palette"| node_theme
node_deposit -->|"uses styles"| node_styles
node_bet -->|"uses styles"| node_styles
node_board -->|"uses styles"| node_styles
node_stats -->|"uses styles"| node_styles
node_banner -->|"uses styles"| node_styles
node_withdraw -->|"uses styles"| node_styles
node_settings -->|"uses styles"| node_styles
node_bottom -->|"uses styles"| node_styles
node_header -->|"uses styles"| node_styles

click node_app "https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/App.js"
click node_login "https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/pages/LoginPage.js"
click node_signup "https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/pages/CreateAccountPage.js"
click node_profile "https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/pages/ProfilePage.js"
click node_casino "https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/pages/CasinoPage.js"
click node_deposit "https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/components/DepositSection.js"
click node_bet "https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/components/BetSelector.js"
click node_board "https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/components/SlotBoard.js"
click node_stats "https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/components/StatsRow.js"
click node_banner "https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/components/MessageBanner.js"
click node_withdraw "https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/components/WithdrawModal.js"
click node_settings "https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/components/SettingsModal.js"
click node_bottom "https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/components/BottomBar.js"
click node_header "https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/components/HeaderSection.js"
click node_state "https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/hooks/useSlotMachine.js"
click node_logic "https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/game/slotLogic.js"
click node_grid "https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/utils/grid.js"
click node_sounds "https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/hooks/useSounds.js"
click node_gameconfig "https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/constants/game.js"
click node_theme "https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/constants/theme.js"
click node_format "https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/utils/format.js"
click node_styles "https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/styles/main.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_app,node_login,node_signup,node_profile toneBlue
class node_casino,node_deposit,node_bet,node_board,node_stats,node_banner,node_withdraw,node_settings,node_bottom,node_header toneAmber
class node_state,node_logic,node_grid,node_sounds toneMint
class node_gameconfig,node_theme,node_format,node_styles toneRose
class node_player,node_viacep toneIndigo
```

## Components

### App navigation

- [App router](https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/App.js): `SlotsEngineGame/frontend/App.js`
- [Login](https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/pages/LoginPage.js): `SlotsEngineGame/frontend/src/pages/LoginPage.js`
- [Account creation](https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/pages/CreateAccountPage.js): `SlotsEngineGame/frontend/src/pages/CreateAccountPage.js`
- [Profile](https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/pages/ProfilePage.js): `SlotsEngineGame/frontend/src/pages/ProfilePage.js`

### Casino experience

- [Casino screen](https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/pages/CasinoPage.js): `SlotsEngineGame/frontend/src/pages/CasinoPage.js`
- [Deposit controls](https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/components/DepositSection.js): `SlotsEngineGame/frontend/src/components/DepositSection.js`
- [Bet selector](https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/components/BetSelector.js): `SlotsEngineGame/frontend/src/components/BetSelector.js`
- [Slot board](https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/components/SlotBoard.js): `SlotsEngineGame/frontend/src/components/SlotBoard.js`
- [Play statistics](https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/components/StatsRow.js): `SlotsEngineGame/frontend/src/components/StatsRow.js`
- [Status banner](https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/components/MessageBanner.js): `SlotsEngineGame/frontend/src/components/MessageBanner.js`
- [Withdrawal modal](https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/components/WithdrawModal.js): `SlotsEngineGame/frontend/src/components/WithdrawModal.js`
- [Settings modal](https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/components/SettingsModal.js): `SlotsEngineGame/frontend/src/components/SettingsModal.js`
- [Bottom navigation](https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/components/BottomBar.js): `SlotsEngineGame/frontend/src/components/BottomBar.js`
- [Casino header](https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/components/HeaderSection.js): `SlotsEngineGame/frontend/src/components/HeaderSection.js`

### Game and state engine

- [Slot machine state](https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/hooks/useSlotMachine.js): `SlotsEngineGame/frontend/src/hooks/useSlotMachine.js`
- [Spin and payouts](https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/game/slotLogic.js): `SlotsEngineGame/frontend/src/game/slotLogic.js`
- [Grid conversion](https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/utils/grid.js): `SlotsEngineGame/frontend/src/utils/grid.js`
- [Sound playback](https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/hooks/useSounds.js): `SlotsEngineGame/frontend/src/hooks/useSounds.js`

### Shared presentation

- [Game settings](https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/constants/game.js): `SlotsEngineGame/frontend/src/constants/game.js`
- [Theme palette](https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/constants/theme.js): `SlotsEngineGame/frontend/src/constants/theme.js`
- [BRL formatting](https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/utils/format.js): `SlotsEngineGame/frontend/src/utils/format.js`
- [Shared styles](https://github.com/hmbenicio/slotsenginegame/blob/main/SlotsEngineGame/frontend/src/styles/main.js): `SlotsEngineGame/frontend/src/styles/main.js`

### Other components

- **Player**
- **ViaCEP**

## Connections

- Player → App router: opens app (evidence: `README.md`)
- App router → Login: starts at (evidence: `SlotsEngineGame/frontend/App.js`)
- App router → Account creation: routes to (evidence: `SlotsEngineGame/frontend/App.js`)
- App router → Casino screen: routes to (evidence: `SlotsEngineGame/frontend/App.js`)
- App router → Profile: routes to (evidence: `SlotsEngineGame/frontend/App.js`)
- Login → App router: submits login (evidence: `README.md`)
- Account creation → App router: submits or cancels (evidence: `SlotsEngineGame/frontend/App.js`)
- Account creation → ViaCEP: looks up address (evidence: `README.md`)
- Casino screen → Profile: opens profile (evidence: `README.md`)
- Casino screen → Slot machine state: uses game state (evidence: `SlotsEngineGame/frontend/src/pages/CasinoPage.js`)
- Casino screen → Deposit controls: renders (evidence: `SlotsEngineGame/frontend/src/pages/CasinoPage.js`)
- Casino screen → Bet selector: renders (evidence: `SlotsEngineGame/frontend/src/pages/CasinoPage.js`)
- Casino screen → Slot board: renders (evidence: `SlotsEngineGame/frontend/src/pages/CasinoPage.js`)
- Casino screen → Play statistics: renders (evidence: `SlotsEngineGame/frontend/src/pages/CasinoPage.js`)
- Casino screen → Status banner: renders (evidence: `SlotsEngineGame/frontend/src/pages/CasinoPage.js`)
- Casino screen → Withdrawal modal: renders (evidence: `SlotsEngineGame/frontend/src/pages/CasinoPage.js`)
- Casino screen → Settings modal: renders (evidence: `SlotsEngineGame/frontend/src/pages/CasinoPage.js`)
- Casino screen → Bottom navigation: renders (evidence: `SlotsEngineGame/frontend/src/pages/CasinoPage.js`)
- Casino screen → Casino header: renders (evidence: `SlotsEngineGame/frontend/src/pages/CasinoPage.js`)
- Slot machine state → Spin and payouts: runs rounds (evidence: `SlotsEngineGame/frontend/src/hooks/useSlotMachine.js`)
- Slot machine state → Grid conversion: formats results (evidence: `SlotsEngineGame/frontend/src/hooks/useSlotMachine.js`)
- Slot machine state → Sound playback: plays cues (evidence: `SlotsEngineGame/frontend/src/hooks/useSlotMachine.js`)
- Slot machine state → Game settings: reads settings (evidence: `SlotsEngineGame/frontend/src/hooks/useSlotMachine.js`)
- Slot machine state → BRL formatting: formats amounts (evidence: `SlotsEngineGame/frontend/src/hooks/useSlotMachine.js`)
- Casino screen → Theme palette: selects palette (evidence: `SlotsEngineGame/frontend/src/pages/CasinoPage.js`)
- Casino screen → Game settings: reads game settings (evidence: `SlotsEngineGame/frontend/src/pages/CasinoPage.js`)
- Casino screen → BRL formatting: formats display (evidence: `SlotsEngineGame/frontend/src/pages/CasinoPage.js`)
- Withdrawal modal → Theme palette: reads colors (evidence: `SlotsEngineGame/frontend/src/components/WithdrawModal.js`)
- Bet selector → BRL formatting: formats bet (evidence: `SlotsEngineGame/frontend/src/components/BetSelector.js`)
- Play statistics → BRL formatting: formats totals (evidence: `SlotsEngineGame/frontend/src/components/StatsRow.js`)
- Login → Theme palette: uses palette (evidence: `SlotsEngineGame/frontend/src/pages/LoginPage.js`)
- Account creation → Theme palette: uses palette (evidence: `SlotsEngineGame/frontend/src/pages/CreateAccountPage.js`)
- Profile → Theme palette: uses palette (evidence: `SlotsEngineGame/frontend/src/pages/ProfilePage.js`)
- Deposit controls → Shared styles: uses styles (evidence: `SlotsEngineGame/frontend/src/components/DepositSection.js`)
- Bet selector → Shared styles: uses styles (evidence: `SlotsEngineGame/frontend/src/components/BetSelector.js`)
- Slot board → Shared styles: uses styles (evidence: `SlotsEngineGame/frontend/src/components/SlotBoard.js`)
- Play statistics → Shared styles: uses styles (evidence: `SlotsEngineGame/frontend/src/components/StatsRow.js`)
- Status banner → Shared styles: uses styles (evidence: `SlotsEngineGame/frontend/src/components/MessageBanner.js`)
- Withdrawal modal → Shared styles: uses styles (evidence: `SlotsEngineGame/frontend/src/components/WithdrawModal.js`)
- Settings modal → Shared styles: uses styles (evidence: `SlotsEngineGame/frontend/src/components/SettingsModal.js`)
- Bottom navigation → Shared styles: uses styles (evidence: `SlotsEngineGame/frontend/src/components/BottomBar.js`)
- Casino header → Shared styles: uses styles (evidence: `SlotsEngineGame/frontend/src/components/HeaderSection.js`)
