How davo999666/chess_next_ts works
This is a child-focused chess teaching app: a teacher arranges pieces on an interactive board, demonstrates moves, and adds arrows or circles to explain positions. The page composes the board and sidebars; board interactions coordinate piece placement, move history, legal-move display, and visual annotations. Chess rules and board transformations form an internal logic layer. The README documents the teaching capabilities; unsampled component internals are represented only where the README or source index supports them, so some links are intentionally omitted.
Main entry points: Board.tsx Interactive board · page.tsx Lesson page · PieceImage.tsx Piece image · BoardGrid.tsx Board grid
Components 20
App composition
- Lesson page
src/app/page.tsx - Board controls
src/component/sidebar/Sidebar.tsx - Right sidebar
src/component/sidebar/SidebarRight.tsx
Board interaction
- Interactive board
src/component/board/Board.tsx - Board commands
src/hooks/useBoardHandlers.ts - Move history
src/context/HistoryContext.tsx - Board grid
src/component/board/BoardGrid.tsx - Drag layer
src/component/board/DragLayer.tsx
Teaching visuals
- Move arrows
src/component/MoveArrows.tsx - Square circles
src/component/RightClickCircles.tsx - Arrow drawing
src/hooks/useArrowDrawing.ts
Chess logic
- Legal moves
src/utils/legalMoves.ts - Pseudo moves
src/utils/pseudoMovesForPiece.ts - Board utilities
src/utils/boardUtils.ts - Chess constants
src/utils/constant.ts
Pieces and layout
- Piece pools
src/component/PiecePools.tsx - Piece image
src/component/PieceImage.tsx - Piece mapping
src/utils/pieceMap.ts - Responsive sizing
src/utils/classNameSize.ts
Other components
- Teacher
Connections 25
- Teacher → Lesson page: opens lesson
README.md - Lesson page → Interactive board: renders
src/app/page.tsx - Lesson page → Board controls: renders
src/app/page.tsx - Lesson page → Right sidebar: renders
src/app/page.tsx - Board controls → Board commands: invokes commands
src/component/sidebar/Sidebar.tsx - Interactive board → Board commands: registers commands
src/component/board/Board.tsx - Interactive board → Move history: uses history
src/component/board/Board.tsx - Interactive board → Board grid: renders grid
src/component/board/Board.tsx - Interactive board → Piece pools: renders pools
src/component/board/Board.tsx - Interactive board → Move arrows: renders annotations
src/component/board/Board.tsx - Interactive board → Square circles: renders annotations
src/component/board/Board.tsx - Interactive board → Arrow drawing: tracks drawing
src/component/board/Board.tsx - Interactive board → Legal moves: requests moves
src/component/board/Board.tsx - Interactive board → Board utilities: flips board
src/component/board/Board.tsx - Board grid → Piece image: renders pieces
src/component/board/BoardGrid.tsx - Board grid → Drag layer: renders drag layer
src/component/board/BoardGrid.tsx - Drag layer → Piece image: renders piece
src/component/board/DragLayer.tsx - Piece pools → Piece mapping: uses piece images
src/component/PiecePools.tsx - Piece pools → Responsive sizing: uses sizing
src/component/PiecePools.tsx - Piece image → Piece mapping: resolves image
src/component/PieceImage.tsx - Piece image → Responsive sizing: uses sizing
src/component/PieceImage.tsx - Legal moves → Pseudo moves: filters moves
src/utils/legalMoves.ts - Legal moves → Chess constants: uses rules
src/utils/legalMoves.ts - Pseudo moves → Chess constants: checks bounds
src/utils/pseudoMovesForPiece.ts - Board utilities → Piece mapping: types board
src/utils/boardUtils.ts