A modern Tic Tac Toe web app built with React, TypeScript, and Material UI, featuring:
- Interactive board with X and O players
- Move history and ability to jump to any previous move
- Session score tracking (current game session)
- All-time score tracking (persisted on the server)
- Auto-updating all-time scoreboard every 3 seconds
- Demo
- Features
- Tech Stack
- Project Structure
- Installation
- Running the App
- API Endpoints
- Future Improvements
- Interactive Tic Tac Toe board
- Material UI design: Creamy white background, X in FC Barcelona blue, O in red
- Move history panel with jump-to functionality
- Session scoreboard: Tracks X & O wins in the current session
- All-time scoreboard: Persisted on server and updated automatically
- Server-side game history: Stores all completed games for analytics
- Frontend: React, TypeScript, Material UI
- Backend: Node.js, Express, TypeScript
- HTTP Requests: Axios
- State Management: React Hooks (
useState,useEffect) - Utilities: Custom hooks for game logic & score management
tic-tac-toe/
├── src/
│ ├── components/
│ │ ├── Board.tsx
│ │ └── Scoreboard.tsx
│ ├── hooks/
│ │ ├── useGame.ts
│ │ └── useVictories.ts
│ ├── services/
│ │ └── api.ts
│ ├── utils/
│ │ ├── calculateWinner.ts
│ │ └── getWinningSquares.ts
│ ├── App.tsx
│ └── index.tsx
├── server/
│ ├── index.ts
│ └── routes.ts
├── package.json
└── README.md
- Clone the repository
git clone https://github.com/yourusername/tic-tac-toe.git
cd tic-tac-toe- Install frontend dependencies
cd tic-tac-toe
npm install- Install server dependencies
cd server
npm install- Start the server
cd server
npm run dev- Start the frontend
cd tic-tac-toe
npm startOpen http://localhost:3000 in your browser.
- POST
/victory/:player - Params:
player–"X"or"O" - Description: Increments all-time victory for the specified player.
- Response:
{
"allTimeVictories": {
"X": 10,
"O": 7
}
}- GET
/history - Description: Returns an array of all past game winners.
- Response:
["X", "O", "X", "X", "O"]- Leaderboard table showing full game history
- AI opponent for single-player mode
- Animations for winning squares
- Unit tests for hooks and utilities
- Mobile-friendly design enhancements
MIT License © [Ariel Kerzhner]
