{"id":24576184,"url":"https://github.com/burakjs/online-xox-nodejs","last_synced_at":"2026-05-12T19:03:12.418Z","repository":{"id":270763007,"uuid":"911350154","full_name":"burakJs/Online-XOX-NodeJs","owner":"burakJs","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-02T22:43:41.000Z","size":7417,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-23T22:23:46.598Z","etag":null,"topics":["nodejs","socket-io","tic-tac-toe","typescript","xox"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/burakJs.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":"2025-01-02T20:08:52.000Z","updated_at":"2025-01-02T22:48:15.000Z","dependencies_parsed_at":"2025-01-02T23:37:51.393Z","dependency_job_id":null,"html_url":"https://github.com/burakJs/Online-XOX-NodeJs","commit_stats":null,"previous_names":["burakjs/online-xox-nodejs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/burakJs%2FOnline-XOX-NodeJs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/burakJs%2FOnline-XOX-NodeJs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/burakJs%2FOnline-XOX-NodeJs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/burakJs%2FOnline-XOX-NodeJs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/burakJs","download_url":"https://codeload.github.com/burakJs/Online-XOX-NodeJs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244036398,"owners_count":20387507,"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":["nodejs","socket-io","tic-tac-toe","typescript","xox"],"created_at":"2025-01-23T22:22:01.313Z","updated_at":"2026-05-12T19:03:07.392Z","avatar_url":"https://github.com/burakJs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Online XOX Game - Backend Service 🎮\n\n[![Node.js](https://img.shields.io/badge/Node.js-18.x-339933?logo=node.js)](https://nodejs.org)\n[![Express.js](https://img.shields.io/badge/Express.js-4.x-000000?logo=express)](https://expressjs.com)\n[![Socket.IO](https://img.shields.io/badge/Socket.IO-4.x-010101?logo=socket.io)](https://socket.io)\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.x-3178C6?logo=typescript)](https://typescriptlang.org)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nReal-time multiplayer Tic-tac-toe game server built with Node.js and Socket.IO. Designed to work seamlessly with the Flutter mobile client.\n\n## ✨ Features\n\n- 🎮 Real-time multiplayer gameplay\n- 🔄 WebSocket-based communication\n- 🎯 Game session management\n- 🛡️ Move validation\n- 🔌 Reconnection support\n- 🧹 Automatic cleanup\n\n## 🛠️ Tech Stack\n\n- **Runtime:** Node.js\n- **Framework:** Express.js\n- **WebSocket:** Socket.IO\n- **Language:** TypeScript\n- **Logging:** Winston\n- **Utils:** UUID\n\n## 🏗️ Project Structure\n\n```\nbackend/\n├── src/\n│   ├── config/        # Configuration\n│   ├── models/        # Data models\n│   ├── services/      # Business logic\n│   ├── types/         # TypeScript types\n│   ├── utils/         # Utilities\n│   └── app.ts         # App entry\n├── package.json\n└── tsconfig.json\n```\n\n## 🚀 Getting Started\n\n1. **Clone and Install**\n   ```bash\n   npm install\n   ```\n\n2. **Environment Setup**\n   ```bash\n   cp .env.example .env\n   ```\n\n3. **Development**\n   ```bash\n   npm run dev\n   ```\n\n4. **Production**\n   ```bash\n   npm run build\n   npm start\n   ```\n\n## 📡 WebSocket Events\n\n### Server to Client\n```typescript\ninterface ServerToClientEvents {\n  game_update: (data: GameState) =\u003e void;\n  game_created: (data: { gameId: string }) =\u003e void;\n  game_joined: (data: GameState) =\u003e void;\n  game_over: (data: { winner?: string, gameState: GameState }) =\u003e void;\n  player_left: (data: { playerId: string }) =\u003e void;\n  error: (data: { message: string, code: string }) =\u003e void;\n  move_error: (data: { message: string }) =\u003e void;\n}\n```\n\n### Client to Server\n```typescript\ninterface ClientToServerEvents {\n  create_game: (data: { playerName: string }) =\u003e void;\n  join_game: (data: { gameId: string, playerName: string }) =\u003e void;\n  make_move: (data: PlayerMove) =\u003e void;\n  cancel_game: (data: { gameId: string }) =\u003e void;\n  leave_game: (data: { gameId: string }) =\u003e void;\n  disconnect_game: () =\u003e void;\n}\n```\n\n## 🎯 Game Rules\n\n1. Two players take turns (X and O)\n2. First to get 3 in a row wins\n3. Game ends on:\n   - Win condition met\n   - Board full (draw)\n   - Player disconnection\n   - Game cancellation\n\n## 📱 Mobile Support\n\n- App lifecycle handling\n- Efficient reconnection\n- Network state management\n- Background state handling\n\n## 🔧 Available Scripts\n\n```json\n{\n  \"dev\": \"ts-node-dev --respawn src/app.ts\",\n  \"build\": \"tsc\",\n  \"start\": \"node dist/app.js\",\n  \"lint\": \"eslint . --ext .ts\",\n  \"format\": \"prettier --write \\\"src/**/*.ts\\\"\"\n}\n```\n\n## 🧪 Testing\n\nTo test with Flutter client:\n\n1. Start the backend server\n2. Configure client WebSocket URL\n3. Test scenarios:\n   - Game creation/joining\n   - Move validation\n   - Disconnection handling\n   - Game completion\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fburakjs%2Fonline-xox-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fburakjs%2Fonline-xox-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fburakjs%2Fonline-xox-nodejs/lists"}