{"id":29027026,"url":"https://github.com/endel/realtime-statesync-socket.io","last_synced_at":"2026-04-28T17:01:30.226Z","repository":{"id":298370144,"uuid":"996815954","full_name":"endel/realtime-statesync-socket.io","owner":"endel","description":"Real-time State Sync with Socket.IO","archived":false,"fork":false,"pushed_at":"2025-06-10T18:39:07.000Z","size":25,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-26T06:02:04.849Z","etag":null,"topics":["socket-io","state-sync","state-synchronization"],"latest_commit_sha":null,"homepage":"https://endel.medium.com/full-stack-state-sync-with-socket-io-72ae50c7a989","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/endel.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,"zenodo":null}},"created_at":"2025-06-05T14:01:15.000Z","updated_at":"2025-06-24T16:19:18.000Z","dependencies_parsed_at":"2025-06-10T20:04:14.398Z","dependency_job_id":null,"html_url":"https://github.com/endel/realtime-statesync-socket.io","commit_stats":null,"previous_names":["endel/fullstack-statesync-socket.io"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/endel/realtime-statesync-socket.io","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endel%2Frealtime-statesync-socket.io","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endel%2Frealtime-statesync-socket.io/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endel%2Frealtime-statesync-socket.io/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endel%2Frealtime-statesync-socket.io/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/endel","download_url":"https://codeload.github.com/endel/realtime-statesync-socket.io/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endel%2Frealtime-statesync-socket.io/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32390067,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T14:34:11.604Z","status":"ssl_error","status_checked_at":"2026-04-28T14:32:37.009Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["socket-io","state-sync","state-synchronization"],"created_at":"2025-06-26T06:01:59.279Z","updated_at":"2026-04-28T17:01:30.202Z","avatar_url":"https://github.com/endel.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Real-time State Sync with Socket.IO\n\nThis example demonstrates how to use [`@colyseus/schema`](https://docs.colyseus.io/state/schema) with Socket.IO for efficient real-time state synchronization.\n\n## Features\n\n- **Easy to Use**: Clean API similar to regular Socket.IO\n- **Efficient State Sync**: Only sends what changed, not the entire state\n- **Type Safety**: TypeScript support with schema decorators - catches errors at compile time\n- **Reactive Callbacks**: Listen to specific property changes\n\n### Limitations\n\nThis example uses a single `Encoder` for all connections. You may extend it to support a multiple `Encoder`‘s per Socket.io Room. As `@colyseus/schema` is in-memory and single-threaded, it is not possible to scale the same `Encoder` between multiple servers or processes. If you're interested in scaling this approach, you can check how to [scale Colyseus applications (without Socket.IO)](https://docs.colyseus.io/deployment/scalability).\n\n## Quick Start\n\n1. **Install dependencies**:\n   ```bash\n   npm install\n   ```\n\n2. **Run the server**:\n   ```bash\n   npm start\n   ```\n\n3. **Start the client**:\n   ```bash\n   npm run client\n   ```\n\n## How It Works\n\n### Shared Schema Definition (`src/GameState.ts`)\n- Defines `Player` and `GameState` classes with `@colyseus/schema` decorators\n- Provides type safety and efficient serialization\n\n### Server (`src/server.ts`)\n- Uses `Encoder` to track and send only state changes\n\n### Client (`src/client.ts`)\n- Uses `Decoder` to apply state updates\n- Reactive callbacks respond to specific changes\n\nThe result is a robust foundation for real-time multiplayer applications.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendel%2Frealtime-statesync-socket.io","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fendel%2Frealtime-statesync-socket.io","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendel%2Frealtime-statesync-socket.io/lists"}