An open API service indexing awesome lists of open source software.

https://github.com/chen-abudi/tic-tac-toe-realtime

๐Ÿ•น๏ธ Challenge your friends in real-time Tic Tac Toe! Smooth turns, live updates, and a slick UI inspired by Figma โ€” All in one fun little package.
https://github.com/chen-abudi/tic-tac-toe-realtime

design-system express javascript modular-architecture monorepo nextjs nodejs react socket-io storybook tailwindcss test-client typescript vite websocket yarn-workspaces zustand

Last synced: 3 months ago
JSON representation

๐Ÿ•น๏ธ Challenge your friends in real-time Tic Tac Toe! Smooth turns, live updates, and a slick UI inspired by Figma โ€” All in one fun little package.

Awesome Lists containing this project

README

          

# ๐ŸŽฎ โญ•โŒ tic-tac-toe-realtime

A real-time multiplayer Tic Tac Toe game powered by **Node.js**, **Socket.IO**, and a cool UI inspired by a Figma design.

This monorepo is built with a modular mindset and includes both the **backend server**, the **frontend app**, and a **shared design system** with Storybook.

---

## โœจ Features

- Real-time multiplayer game via **`WebSockets`**
- Game rooms and dynamic player sessions
- Turn-based game logic with win/draw detection
- Smooth gameplay with state synchronization
- Modular monorepo powered by **`Yarn Workspaces`**
- Shared Design System using **`Storybook`** (in progress)
- Inspired by [this Figma design](https://www.figma.com/design/ajH9a7AsS7F58ysatXikmv/tic-tac-toe)

---

## ๐Ÿงฑ Tech Stack

### Backend

- โš™๏ธ Node.js + Express
- ๐Ÿ”Œ Socket.IO (WebSockets)
- ๐Ÿง  Game logic in-memory (scalable later)
- ๐Ÿ“Š MongoDB/Mongoose for data persistence
- ๐Ÿ”ค TypeScript, ts-node-dev

### Frontend (In Progress)

- โš›๏ธ React + Next.js
- โšก Vite for ultra-fast development
- ๐ŸŽจ TailwindCSS + Custom animations
- ๐Ÿ’พ Zustand for local state management
- ๐Ÿงฉ Component-driven with reusable UI
- ๐Ÿ“• Storybook for Design System (coming soon)
- ๐Ÿงผ ESLint + Prettier (planned to be added later)

### Dev / Tooling

- ๐Ÿงถ Yarn Workspaces
- ๐Ÿ—‚๏ธ Monorepo Layout
- ๐Ÿ“ Modular architecture
- ๐Ÿงช `test-client` for local socket testing
- ๐Ÿ“ฆ GitHub + Feature branch workflow

---

## ๐Ÿ“ Project Structure

```txt
apps/
โ”œโ”€โ”€ server/ # Backend API & Socket.IO server
โ”œโ”€โ”€ client/ # Frontend app
โ””โ”€โ”€ test-client/ # Simple socket.io client for testing

packages/
โ””โ”€โ”€ shared
โ””โ”€โ”€ ui/ # Shared UI components (Storybook)
```

---

## ๐Ÿš€ Getting Started

### Prerequisites

- Node.js (v18 or higher recommended)
- Yarn package manager
- MongoDB (local or Atlas connection)

### Installation

1. Clone the repository

```bash
git clone https://github.com/Chen-Abudi/tic-tac-toe-realtime.git
cd tic-tac-toe-realtime
```

2. Install all dependencies

```bash
yarn install
```

3. Start the backend server

```bash
yarn workspace server dev
```

**Note**: Server runs on: http://localhost:4001 by default

4. Start the frontend client

```bash
yarn workspace client dev
```

**Note**: Client runs on: http://localhost:3000 by default

5. (Optional) Run the Socket.io test client

```bash
yarn workspace test-client ts-node index.ts
```

Note: This is a simple client for testing purposes. It will connect to the server and emit messages to test the socket connection.

---

## ๐Ÿ›ฃ๏ธ Roadmap

- [x] Setup monorepo with Yarn Workspaces
- [x] Build backend with room management + game logic
- [x] Add test-client for real-time testing
- [x] Create frontend app and hook up sockets
- [x] Add responsive styles and transitions for gameplay
- [x] Fix game state / UI sync across clients
- [**In Progress**] Build out UI with Tailwind & match Figma
- [**In Progress**] Create design system with Storybook
- [ ] Add game animations and sound effects
- [ ] Add persistent database with MongoDB
- [ ] Add lobby / room browser (later on)
- [ ] Finalize design system in Storybook

---

## ๐Ÿค๐Ÿฝ Contributing

Contributions are welcome! Here's how you can contribute:

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## ๐Ÿ“ธ Screenshots

_Coming soon_

## ๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

---

## ๐Ÿ‘ฉ๐Ÿฝโ€๐Ÿ’ป Author

Grace Chen Abudi - [GitHub](https://github.com/Chen-Abudi)