How saiteja05-code/2048-react-cicd works
This is a browser-based React and TypeScript implementation of 2048, with animated tile movement and value changes. The user starts or restarts a game in the app shell; the Game component uses game state and movement logic, then renders that state on a board of animated tiles. The graph separates game rules/state from board layout and tile presentation. Some source excerpts are partial, so links involving unsampled Game and reducer behavior are limited to relationships named in the source index or shown in excerpts.
Main entry points: useGame.ts Game state and moves · Board.tsx Board renderer · App.tsx App and restart · Game.tsx Game view
Components 17
App shell
- App and restart
src/App.tsx - Restart button
src/components/Button/Button.tsx - React entry point
src/index.tsx - Web vitals reporting
src/reportWebVitals.ts
Game logic
- Game view
src/components/Game/Game.tsx - Game state and moves
src/components/Game/hooks/useGame/useGame.ts - Game reducer
src/components/Game/hooks/useGame/reducer.ts - Tile ID generator
src/components/Game/hooks/useIds.ts
Board layout
- Board renderer
src/components/Board/Board.tsx - Board dimensions
src/components/Board/models/Board.ts - Board context
src/components/Board/context/BoardContext.tsx - Board settings hook
src/components/Board/hooks/useBoard.ts - Grid renderer
src/components/Grid/Grid.tsx
Tile presentation
- Tile renderer
src/components/Tile/Tile.tsx - Tile metadata
src/components/Tile/models/Tile.ts - Previous prop hook
src/hooks/usePrevProps.ts
Other components
- Player
Connections 18
- Player → App and restart: plays and restarts
src/App.tsx - App and restart → Restart button: renders
src/App.tsx - App and restart → Game view: renders
src/App.tsx - Game view → Game state and moves: uses
src/components/Game/Game.tsx - Game view → Board renderer: renders
src/components/Game/Game.tsx - Game state and moves → Game reducer: dispatches actions
src/components/Game/hooks/useGame/useGame.ts - Game state and moves → Tile ID generator: generates tile IDs
src/components/Game/hooks/useGame/useGame.ts - Game state and moves → Board dimensions: uses board settings
src/components/Game/hooks/useGame/useGame.ts - Game state and moves → Tile metadata: uses tile metadata
src/components/Game/hooks/useGame/useGame.ts - Board renderer → Board context: provides dimensions
src/components/Board/Board.tsx - Board renderer → Grid renderer: renders
src/components/Board/Board.tsx - Board renderer → Tile renderer: renders
src/components/Board/Board.tsx - Board renderer → Board dimensions: uses dimensions
src/components/Board/Board.tsx - Board settings hook → Board context: reads context
src/components/Board/hooks/useBoard.ts - Tile renderer → Board settings hook: reads board settings
src/components/Tile/Tile.tsx - Tile renderer → Previous prop hook: tracks prior value
src/components/Tile/Tile.tsx - React entry point → App and restart: renders
src/index.tsx - React entry point → Web vitals reporting: reports metrics
src/index.tsx