Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abdullahnettoor/tictactoe-backend
https://github.com/abdullahnettoor/tictactoe-backend
Last synced: 20 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/abdullahnettoor/tictactoe-backend
- Owner: abdullahnettoor
- Created: 2024-11-07T12:07:17.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-07T12:55:17.000Z (about 2 months ago)
- Last Synced: 2024-11-07T13:49:42.924Z (about 2 months ago)
- Language: JavaScript
- Size: 202 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TicTacToe CLI Backend
Backend and landing page for a developer-friendly TicTacToe game that runs in your terminal. Take a break from coding and enjoy a quick game without leaving your development environment! ⌨️
## Features
- Real-time multiplayer using WebSocket
- Rate limiting for connection security
- Username validation
- Game session management
- Automatic opponent matching
- Timeout handling for inactive games
- Development and production configurations
- Error logging with Winston## Getting Started
1. Clone the repository:
```bash
git clone https://github.com/abdullahnettoor/tictactoe-backend.git
cd tictactoe-backend
```2. Install dependencies:
```bash
npm install
```3. Run the development server:
```bash
npm run dev
```Open [http://localhost:3000](http://localhost:3000) with your browser to see the landing page.
## Environment Variables
- `NODE_ENV`: Set to 'production' for production environment
- `PORT`: Server port (default: 3000)
- `HOST`: Server hostname (default: localhost)## API Documentation
### WebSocket Endpoints
- `/ws`: Main WebSocket endpoint for game communication
### Message Types
- `register`: Register new user
- `findGame`: Find opponent for game
- `move`: Make a move in the game
- `gameStart`: Game start notification
- `searching`: Searching for opponent
- `userCount`: Online players count update## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Author
**Abdullah Nettoor**
- GitHub: [@abdullahnettoor](https://github.com/abdullahnettoor)
- Email: [email protected]## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.