# vicenteanashei/rubis architecture

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

- Interactive diagram: https://gitdiagram.com/vicenteanashei/rubis
- Repository: https://github.com/vicenteanashei/rubis

## Overview

Rubik Timer is a browser speedcubing app: a cuber gets a 3×3 scramble, optionally requests a solution, times an attempt with optional WCA inspection, then reviews saved solves and session statistics. App owns the main orchestration: it generates scrambles, connects timer completion to solve history, and supplies data and callbacks to the UI. The viewer animates cube algorithms; a worker-backed solver handles solution requests. Edges reflect the shown App and hook code; README documentation is absent, so unsampled capabilities and connections are not inferred.

Main entry points: [`src/App.tsx`](https://github.com/vicenteanashei/rubis/blob/main/src/App.tsx) (App orchestration), [`src/lib/format.ts`](https://github.com/vicenteanashei/rubis/blob/main/src/lib/format.ts) (Time formatting), [`src/hooks/useTimer.ts`](https://github.com/vicenteanashei/rubis/blob/main/src/hooks/useTimer.ts) (Timer state), [`src/components/CubeViewer.tsx`](https://github.com/vicenteanashei/rubis/blob/main/src/components/CubeViewer.tsx) (Cube viewer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Solve workflow"]
  node_app["App orchestration<br/>[App.tsx]"]
  node_scramble["Scramble generation<br/>[App.tsx]"]
  node_timer["Timer state<br/>[useTimer.ts]"]
  node_scramble_service["Scramble service"]
end

subgraph group_interface["User interface"]
  node_viewer["Cube viewer<br/>[CubeViewer.tsx]"]
  node_scramble_ui["Scramble controls<br/>[ScramblePanel.tsx]"]
  node_timer_ui["Timer display<br/>[TimerView.tsx]"]
  node_history_ui["Solve history<br/>[SolveHistory.tsx]"]
  node_stats_ui["Stats display<br/>[StatsPanel.tsx]"]
  node_twisty["Twisty player"]
end

subgraph group_solver["Solution engine"]
  node_solver_hook["Solver client<br/>[useSolver.ts]"]
  node_worker["Solver worker<br/>[solver.worker.ts]"]
  node_cubejs["Cube solver engine<br/>[cubejs.vendor.js]"]
end

subgraph group_records["Solve records"]
  node_stats["Session statistics<br/>[stats.ts]"]
  node_storage["Local persistence<br/>[storage.ts]"]
  node_browser_store[("Browser local storage")]
  node_format["Time formatting<br/>[format.ts]"]
end

node_cuber(("Cuber"))

node_cuber -->|"uses app"| node_app
node_app -->|"requests scramble"| node_scramble
node_scramble -->|"requests 3×3 scramble"| node_scramble_service
node_app -->|"renders algorithm"| node_viewer
node_app -->|"renders controls"| node_scramble_ui
node_app -->|"configures timer"| node_timer
node_app -->|"renders timer"| node_timer_ui
node_app -->|"requests solution"| node_solver_hook
node_solver_hook -->|"posts scramble"| node_worker
node_worker -->|"uses solver engine"| node_cubejs
node_timer -->|"reports completion"| node_app
node_app -->|"computes statistics"| node_stats
node_app -->|"supplies statistics"| node_stats_ui
node_app -->|"supplies solve records"| node_history_ui
node_app -->|"loads and saves"| node_storage
node_storage -->|"reads and writes"| node_browser_store
node_history_ui -->|"formats solve times"| node_format
node_stats_ui -->|"formats statistics"| node_format
node_timer_ui -->|"formats timer display"| node_format
node_viewer -->|"controls player"| node_twisty

click node_app "https://github.com/vicenteanashei/rubis/blob/main/src/App.tsx"
click node_scramble "https://github.com/vicenteanashei/rubis/blob/main/src/App.tsx"
click node_timer "https://github.com/vicenteanashei/rubis/blob/main/src/hooks/useTimer.ts"
click node_viewer "https://github.com/vicenteanashei/rubis/blob/main/src/components/CubeViewer.tsx"
click node_scramble_ui "https://github.com/vicenteanashei/rubis/blob/main/src/components/ScramblePanel.tsx"
click node_timer_ui "https://github.com/vicenteanashei/rubis/blob/main/src/components/TimerView.tsx"
click node_history_ui "https://github.com/vicenteanashei/rubis/blob/main/src/components/SolveHistory.tsx"
click node_stats_ui "https://github.com/vicenteanashei/rubis/blob/main/src/components/StatsPanel.tsx"
click node_solver_hook "https://github.com/vicenteanashei/rubis/blob/main/src/hooks/useSolver.ts"
click node_worker "https://github.com/vicenteanashei/rubis/blob/main/src/workers/solver.worker.ts"
click node_cubejs "https://github.com/vicenteanashei/rubis/blob/main/src/lib/cubejs.vendor.js"
click node_stats "https://github.com/vicenteanashei/rubis/blob/main/src/lib/stats.ts"
click node_storage "https://github.com/vicenteanashei/rubis/blob/main/src/lib/storage.ts"
click node_format "https://github.com/vicenteanashei/rubis/blob/main/src/lib/format.ts"

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_scramble,node_timer,node_scramble_service toneBlue
class node_viewer,node_scramble_ui,node_timer_ui,node_history_ui,node_stats_ui,node_twisty toneAmber
class node_solver_hook,node_worker,node_cubejs toneMint
class node_stats,node_storage,node_browser_store,node_format toneRose
class node_cuber toneIndigo
```

## Components

### Solve workflow

- [App orchestration](https://github.com/vicenteanashei/rubis/blob/main/src/App.tsx): `src/App.tsx`
- [Scramble generation](https://github.com/vicenteanashei/rubis/blob/main/src/App.tsx): `src/App.tsx`
- [Timer state](https://github.com/vicenteanashei/rubis/blob/main/src/hooks/useTimer.ts): `src/hooks/useTimer.ts`
- **Scramble service**

### User interface

- [Cube viewer](https://github.com/vicenteanashei/rubis/blob/main/src/components/CubeViewer.tsx): `src/components/CubeViewer.tsx`
- [Scramble controls](https://github.com/vicenteanashei/rubis/blob/main/src/components/ScramblePanel.tsx): `src/components/ScramblePanel.tsx`
- [Timer display](https://github.com/vicenteanashei/rubis/blob/main/src/components/TimerView.tsx): `src/components/TimerView.tsx`
- [Solve history](https://github.com/vicenteanashei/rubis/blob/main/src/components/SolveHistory.tsx): `src/components/SolveHistory.tsx`
- [Stats display](https://github.com/vicenteanashei/rubis/blob/main/src/components/StatsPanel.tsx): `src/components/StatsPanel.tsx`
- **Twisty player**

### Solution engine

- [Solver client](https://github.com/vicenteanashei/rubis/blob/main/src/hooks/useSolver.ts): `src/hooks/useSolver.ts`
- [Solver worker](https://github.com/vicenteanashei/rubis/blob/main/src/workers/solver.worker.ts): `src/workers/solver.worker.ts`
- [Cube solver engine](https://github.com/vicenteanashei/rubis/blob/main/src/lib/cubejs.vendor.js): `src/lib/cubejs.vendor.js`

### Solve records

- [Session statistics](https://github.com/vicenteanashei/rubis/blob/main/src/lib/stats.ts): `src/lib/stats.ts`
- [Local persistence](https://github.com/vicenteanashei/rubis/blob/main/src/lib/storage.ts): `src/lib/storage.ts`
- **Browser local storage**
- [Time formatting](https://github.com/vicenteanashei/rubis/blob/main/src/lib/format.ts): `src/lib/format.ts`

### Other components

- **Cuber**

## Connections

- Cuber → App orchestration: uses app
- App orchestration → Scramble generation: requests scramble (evidence: `src/App.tsx`)
- Scramble generation → Scramble service: requests 3×3 scramble (evidence: `src/App.tsx`)
- App orchestration → Cube viewer: renders algorithm (evidence: `src/App.tsx`)
- App orchestration → Scramble controls: renders controls (evidence: `src/App.tsx`)
- App orchestration → Timer state: configures timer (evidence: `src/App.tsx`)
- App orchestration → Timer display: renders timer (evidence: `src/App.tsx`)
- App orchestration → Solver client: requests solution (evidence: `src/App.tsx`)
- Solver client → Solver worker: posts scramble (evidence: `src/hooks/useSolver.ts`)
- Solver worker → Cube solver engine: uses solver engine (evidence: `src/workers/solver.worker.ts`)
- Timer state → App orchestration: reports completion (evidence: `src/hooks/useTimer.ts`)
- App orchestration → Session statistics: computes statistics (evidence: `src/App.tsx`)
- App orchestration → Stats display: supplies statistics (evidence: `src/App.tsx`)
- App orchestration → Solve history: supplies solve records (evidence: `src/App.tsx`)
- App orchestration → Local persistence: loads and saves (evidence: `src/App.tsx`)
- Local persistence → Browser local storage: reads and writes (evidence: `src/lib/storage.ts`)
- Solve history → Time formatting: formats solve times (evidence: `src/components/SolveHistory.tsx`)
- Stats display → Time formatting: formats statistics (evidence: `src/components/StatsPanel.tsx`)
- Timer display → Time formatting: formats timer display (evidence: `src/components/TimerView.tsx`)
- Cube viewer → Twisty player: controls player (evidence: `src/components/CubeViewer.tsx`)
