# jaiparwani-cyber/mlc architecture

> Architecture diagram of the GitHub repository jaiparwani-cyber/mlc, 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/jaiparwani-cyber/mlc
- Repository: https://github.com/jaiparwani-cyber/mlc

## Overview

This is a browser-based multiplayer chess game for two to six players. A player chooses the game size, then App initializes player matrices and an opponent-facing board. During play, the current player selects pieces and destinations; App delegates move legality to the rules module, updates player state, removes players whose kings are gone, rotates turns, and displays the winner. The board renders pieces and lets players switch opponents. The README is only Create React App boilerplate; architecture is based on the sampled source and tree.

Main entry points: [`src/App.js`](https://github.com/jaiparwani-cyber/mlc/blob/master/src/App.js) (Game coordinator), [`src/components/ChessBoard.js`](https://github.com/jaiparwani-cyber/mlc/blob/master/src/components/ChessBoard.js) (Chess board), [`src/components/LandingPage.js`](https://github.com/jaiparwani-cyber/mlc/blob/master/src/components/LandingPage.js) (Game setup), [`src/rules.js`](https://github.com/jaiparwani-cyber/mlc/blob/master/src/rules.js) (Chess rules)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Game interface"]
  node_entry["React entry<br/>[index.js]"]
  node_landing["Game setup<br/>[LandingPage.js]"]
  node_board["Chess board<br/>[ChessBoard.js]"]
  node_winner["Winner display<br/>[Winner.js]"]
end

subgraph group_control["Game control"]
  node_app["Game coordinator<br/>[App.js]"]
end

subgraph group_domain["Rules and pieces"]
  node_rules["Chess rules<br/>[rules.js]"]
  node_pieces["Piece images<br/>[index.js]"]
end

node_player(("Player"))

node_player -->|"chooses players"| node_landing
node_entry -->|"renders"| node_app
node_app -->|"shows setup"| node_landing
node_landing -->|"starts game"| node_app
node_app -->|"passes game state"| node_board
node_player -->|"selects cells"| node_board
node_board -->|"reports clicks"| node_app
node_board -->|"changes opponent"| node_app
node_app -->|"validates move"| node_rules
node_rules -->|"returns legality"| node_app
node_app -->|"shows winner"| node_winner
node_board -->|"reads image map"| node_pieces

click node_entry "https://github.com/jaiparwani-cyber/mlc/blob/master/src/index.js"
click node_app "https://github.com/jaiparwani-cyber/mlc/blob/master/src/App.js"
click node_landing "https://github.com/jaiparwani-cyber/mlc/blob/master/src/components/LandingPage.js"
click node_board "https://github.com/jaiparwani-cyber/mlc/blob/master/src/components/ChessBoard.js"
click node_winner "https://github.com/jaiparwani-cyber/mlc/blob/master/src/components/Winner.js"
click node_rules "https://github.com/jaiparwani-cyber/mlc/blob/master/src/rules.js"
click node_pieces "https://github.com/jaiparwani-cyber/mlc/blob/master/src/assests/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_entry,node_landing,node_board,node_winner toneBlue
class node_app toneAmber
class node_rules,node_pieces toneMint
class node_player toneIndigo
```

## Components

### Game interface

- [React entry](https://github.com/jaiparwani-cyber/mlc/blob/master/src/index.js): `src/index.js`
- [Game setup](https://github.com/jaiparwani-cyber/mlc/blob/master/src/components/LandingPage.js): `src/components/LandingPage.js`
- [Chess board](https://github.com/jaiparwani-cyber/mlc/blob/master/src/components/ChessBoard.js): `src/components/ChessBoard.js`
- [Winner display](https://github.com/jaiparwani-cyber/mlc/blob/master/src/components/Winner.js): `src/components/Winner.js`

### Game control

- [Game coordinator](https://github.com/jaiparwani-cyber/mlc/blob/master/src/App.js): `src/App.js`

### Rules and pieces

- [Chess rules](https://github.com/jaiparwani-cyber/mlc/blob/master/src/rules.js): `src/rules.js`
- [Piece images](https://github.com/jaiparwani-cyber/mlc/blob/master/src/assests/index.js): `src/assests/index.js`

### Other components

- **Player**

## Connections

- Player → Game setup: chooses players
- React entry → Game coordinator: renders
- Game coordinator → Game setup: shows setup
- Game setup → Game coordinator: starts game
- Game coordinator → Chess board: passes game state
- Player → Chess board: selects cells
- Chess board → Game coordinator: reports clicks
- Chess board → Game coordinator: changes opponent
- Game coordinator → Chess rules: validates move
- Chess rules → Game coordinator: returns legality
- Game coordinator → Winner display: shows winner
- Chess board → Piece images: reads image map
