# panditbhavik/skills-introduction-to-git architecture

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

- Interactive diagram: https://gitdiagram.com/panditbhavik/skills-introduction-to-git
- Repository: https://github.com/panditbhavik/skills-introduction-to-git

## Overview

This repository implements a browser-based coding-themed falling-block puzzle. A player uses keyboard controls to move, rotate, drop, and pause pieces; the game updates its board, checks for a target error pattern, awards points, and renders the result. The main runtime is concentrated in `src/index.js`, with pattern definitions in `src/patterns.js`. The HTML and CSS are present but were not sampled, so their detailed wiring is not inferred.

Main entry points: [`src/index.js`](https://github.com/panditbhavik/skills-introduction-to-git/blob/main/src/index.js) (Pattern Matching), [`src/patterns.js`](https://github.com/panditbhavik/skills-introduction-to-git/blob/main/src/patterns.js) (Error Patterns), [`src/index.html`](https://github.com/panditbhavik/skills-introduction-to-git/blob/main/src/index.html) (Game Page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_play["Game Play"]
  node_controls["Keyboard Controls<br/>[index.js]"]
  node_game["Game Loop<br/>[index.js]"]
  node_piece["Piece Mechanics<br/>[index.js]"]
  node_collision["Collision Check<br/>[index.js]"]
  node_board["Board State<br/>[index.js]"]
end

subgraph group_patterns["Pattern Scoring"]
  node_patterncheck["Pattern Matching<br/>[index.js]"]
  node_catalog["Error Patterns<br/>[patterns.js]"]
  node_scoring["Score Updates<br/>[index.js]"]
end

subgraph group_display["Browser Display"]
  node_canvas["Canvas Rendering<br/>[index.js]"]
  node_page["Game Page<br/>[index.html]"]
  node_status["Game Status UI<br/>[index.js]"]
end

node_player(("Player"))

node_player -->|"presses keys"| node_controls
node_controls -->|"moves pieces"| node_piece
node_controls -->|"toggles pause"| node_game
node_game -->|"drops pieces"| node_piece
node_piece -->|"checks movement"| node_collision
node_piece -->|"locks pieces"| node_board
node_piece -->|"checks on lock"| node_patterncheck
node_patterncheck -.->|"uses patterns"| node_catalog
node_patterncheck -->|"reads and clears"| node_board
node_patterncheck -->|"awards points"| node_scoring
node_patterncheck -->|"sets next target"| node_game
node_game -->|"draws frame"| node_canvas
node_canvas -->|"draws on canvas"| node_page
node_scoring -->|"updates score"| node_status
node_game -->|"updates game state"| node_status

click node_controls "https://github.com/panditbhavik/skills-introduction-to-git/blob/main/src/index.js"
click node_game "https://github.com/panditbhavik/skills-introduction-to-git/blob/main/src/index.js"
click node_piece "https://github.com/panditbhavik/skills-introduction-to-git/blob/main/src/index.js"
click node_collision "https://github.com/panditbhavik/skills-introduction-to-git/blob/main/src/index.js"
click node_board "https://github.com/panditbhavik/skills-introduction-to-git/blob/main/src/index.js"
click node_patterncheck "https://github.com/panditbhavik/skills-introduction-to-git/blob/main/src/index.js"
click node_catalog "https://github.com/panditbhavik/skills-introduction-to-git/blob/main/src/patterns.js"
click node_scoring "https://github.com/panditbhavik/skills-introduction-to-git/blob/main/src/index.js"
click node_canvas "https://github.com/panditbhavik/skills-introduction-to-git/blob/main/src/index.js"
click node_page "https://github.com/panditbhavik/skills-introduction-to-git/blob/main/src/index.html"
click node_status "https://github.com/panditbhavik/skills-introduction-to-git/blob/main/src/index.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_controls,node_game,node_piece,node_collision,node_board toneBlue
class node_patterncheck,node_catalog,node_scoring toneAmber
class node_canvas,node_page,node_status toneMint
class node_player toneIndigo
```

## Components

### Game Play

- [Keyboard Controls](https://github.com/panditbhavik/skills-introduction-to-git/blob/main/src/index.js): `src/index.js`
- [Game Loop](https://github.com/panditbhavik/skills-introduction-to-git/blob/main/src/index.js): `src/index.js`
- [Piece Mechanics](https://github.com/panditbhavik/skills-introduction-to-git/blob/main/src/index.js): `src/index.js`
- [Collision Check](https://github.com/panditbhavik/skills-introduction-to-git/blob/main/src/index.js): `src/index.js`
- [Board State](https://github.com/panditbhavik/skills-introduction-to-git/blob/main/src/index.js): `src/index.js`

### Pattern Scoring

- [Pattern Matching](https://github.com/panditbhavik/skills-introduction-to-git/blob/main/src/index.js): `src/index.js`
- [Error Patterns](https://github.com/panditbhavik/skills-introduction-to-git/blob/main/src/patterns.js): `src/patterns.js`
- [Score Updates](https://github.com/panditbhavik/skills-introduction-to-git/blob/main/src/index.js): `src/index.js`

### Browser Display

- [Canvas Rendering](https://github.com/panditbhavik/skills-introduction-to-git/blob/main/src/index.js): `src/index.js`
- [Game Page](https://github.com/panditbhavik/skills-introduction-to-git/blob/main/src/index.html): `src/index.html`
- [Game Status UI](https://github.com/panditbhavik/skills-introduction-to-git/blob/main/src/index.js): `src/index.js`

### Other components

- **Player**

## Connections

- Player → Keyboard Controls: presses keys (evidence: `src/index.js`)
- Keyboard Controls → Piece Mechanics: moves pieces (evidence: `src/index.js`)
- Keyboard Controls → Game Loop: toggles pause (evidence: `src/index.js`)
- Game Loop → Piece Mechanics: drops pieces (evidence: `src/index.js`)
- Piece Mechanics → Collision Check: checks movement (evidence: `src/index.js`)
- Piece Mechanics → Board State: locks pieces (evidence: `src/index.js`)
- Piece Mechanics → Pattern Matching: checks on lock (evidence: `src/index.js`)
- Pattern Matching → Error Patterns: uses patterns
- Pattern Matching → Board State: reads and clears (evidence: `src/index.js`)
- Pattern Matching → Score Updates: awards points (evidence: `src/index.js`)
- Pattern Matching → Game Loop: sets next target (evidence: `src/index.js`)
- Game Loop → Canvas Rendering: draws frame (evidence: `src/index.js`)
- Canvas Rendering → Game Page: draws on canvas (evidence: `src/index.js`)
- Score Updates → Game Status UI: updates score (evidence: `src/index.js`)
- Game Loop → Game Status UI: updates game state (evidence: `src/index.js`)
