{"id":17793375,"url":"https://github.com/devcyclehq-sandbox/cloudflare-tictactoe","last_synced_at":"2025-08-20T12:18:49.686Z","repository":{"id":258635978,"uuid":"873891006","full_name":"DevCycleHQ-Sandbox/cloudflare-tictactoe","owner":"DevCycleHQ-Sandbox","description":"Tic Tac Toe with Cloudflare Workers and Durable Objects","archived":false,"fork":false,"pushed_at":"2024-10-19T04:48:16.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-02T02:18:20.260Z","etag":null,"topics":["cloudflare","devcycle","durable-objects","game","tic-tac-toe","workers"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DevCycleHQ-Sandbox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-16T22:37:25.000Z","updated_at":"2024-10-18T14:54:29.000Z","dependencies_parsed_at":"2024-10-27T11:09:07.075Z","dependency_job_id":null,"html_url":"https://github.com/DevCycleHQ-Sandbox/cloudflare-tictactoe","commit_stats":null,"previous_names":["devcyclehq-sandbox/cloudflare-tictactoe"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevCycleHQ-Sandbox%2Fcloudflare-tictactoe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevCycleHQ-Sandbox%2Fcloudflare-tictactoe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevCycleHQ-Sandbox%2Fcloudflare-tictactoe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevCycleHQ-Sandbox%2Fcloudflare-tictactoe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DevCycleHQ-Sandbox","download_url":"https://codeload.github.com/DevCycleHQ-Sandbox/cloudflare-tictactoe/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246741117,"owners_count":20826067,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudflare","devcycle","durable-objects","game","tic-tac-toe","workers"],"created_at":"2024-10-27T11:08:12.771Z","updated_at":"2025-04-02T02:18:24.131Z","avatar_url":"https://github.com/DevCycleHQ-Sandbox.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cloudflare Multi-player Tic Tac Toe Game\n\nThis repository is a companion to the [DevTools \u0026 DevCools: Cloudflare Edition](https://youtube.com/live/KTAIN2RAa8E) livestream. If you missed the stream or want to catch it again, [you can watch it here!](https://youtube.com/live/KTAIN2RAa8E).\n\n[![IMAGE ALT TEXT](http://img.youtube.com/vi/KTAIN2RAa8E/0.jpg)](http://www.youtube.com/watch?v=KTAIN2RAa8E 'Diving into Durable Objects with Harshil Agrawal from Cloudflare | DevTools \u0026 DevCools')\n\n## Table of Contents\n\n1. [Project Overview](#project-overview)\n2. [Features](#features)\n3. [Tech Stack](#tech-stack)\n4. [Game Flow](#game-flow)\n5. [Setup and Deployment](#setup-and-deployment)\n6. [Contributing](#contributing)\n7. [License](#license)\n\n## Project Overview\n\nIn this project, we built a multiplayer Tic Tac Toe game using Cloudflare Workers and Durable Objects to manage game state across clients. Players can create or join a room and play Tic Tac Toe in real-time, with game data synchronized between the players through WebSocket communication.\n\n## Features\n\n- **Real-Time Multiplayer:** Players can create or join rooms and play Tic Tac Toe in real time.\n- **Durable Game State:** Game state is persisted and synchronized using Cloudflare Durable Objects.\n- **WebSocket Communication:** WebSocket is used for efficient real-time communication between clients.\n- **Responsive UI:** Built with Tailwind CSS for a simple and responsive interface.\n\n## Tech Stack\n\n- **Cloudflare Workers:** These are serverless functions that run on Cloudflare's global network. In this project, they serve as the backend, handling requests to create or join game rooms and managing real-time communication via WebSockets.\n\n- **Durable Objects:** These are stateful objects that allow data to be persisted and synchronized across clients. In this project, each game room has its own Durable Object instance, which stores the game state (board, player turns) and ensures it stays consistent between players in real time.\n\n## Game Flow\n\n1. **Create or Join Room:**\n\n   - A player can create a new room, generating a unique room code.\n   - Another player can join the room using the room code.\n\n2. **Game Start:**\n\n   - Once both players are in the room, the game board becomes visible, and the game starts.\n\n3. **Gameplay:**\n\n   - Players take turns marking cells on the board (X and O).\n   - The game detects win conditions and displays the result (win or draw).\n\n4. **Restart Game:**\n\n   - A \"Restart\" button allows players to reset the game board and start a new round.\n\n## Setup and Deployment\n\nTo deploy this project, follow these steps:\n\n### Prerequisites\n\n- Install [Wrangler](https://developers.cloudflare.com/workers/wrangler/get-started/) CLI to manage Cloudflare Workers.\n- A Cloudflare account with Workers and Durable Objects enabled.\n\n### Steps\n\n1. **Clone the repository:**\n\n   ```bash\n   git clone https://github.com/DevCycleHQ-Sandbox/cloudflare-tictactoe.git\n   cd cloudflare-tictactoe\n   ```\n\n2. **Install dependencies:**\n\n   Install the necessary dependencies by running:\n\n   ```bash\n   npm install\n   ```\n\n3. **Configure Wrangler:**\n\n   Ensure your `wrangler.toml` is set up correctly for Durable Objects, assets, and other configurations (this is provided in the repository).\n\n4. **Run the project locally:**\n\n   Start the development server:\n\n   ```bash\n   npm run dev\n   ```\n\n   This will run the Workers project locally, allowing you to test the application at `http://localhost:8787/`.\n\n5. **Deploy to Cloudflare Workers:**\n\n   Once you're ready to deploy, use:\n\n   ```bash\n   npm run deploy\n   ```\n\n   This will push your code to Cloudflare and make it available at your worker's URL.\n\n## Contributing\n\nContributions are welcome! If you would like to contribute to this project, please fork the repository and submit a pull request.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevcyclehq-sandbox%2Fcloudflare-tictactoe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevcyclehq-sandbox%2Fcloudflare-tictactoe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevcyclehq-sandbox%2Fcloudflare-tictactoe/lists"}