{"id":16462422,"url":"https://github.com/syntaxlexx/nextjs-socketio-colyseus-gameserver-testing","last_synced_at":"2025-02-27T07:54:22.974Z","repository":{"id":194628259,"uuid":"691248701","full_name":"syntaxlexx/nextjs-socketio-colyseus-gameserver-testing","owner":"syntaxlexx","description":"A repo showcasing how one would go about creating a game or managing websockets via a Nextjs app and a backend on socket.io, colyseus, e.t.c.","archived":false,"fork":false,"pushed_at":"2023-09-24T21:55:50.000Z","size":19144,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-10T07:54:28.078Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/syntaxlexx.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":"2023-09-13T19:45:15.000Z","updated_at":"2023-09-13T19:48:32.000Z","dependencies_parsed_at":"2023-09-14T10:46:07.985Z","dependency_job_id":"2e354751-fd24-4014-ab9e-c95036ef934f","html_url":"https://github.com/syntaxlexx/nextjs-socketio-colyseus-gameserver-testing","commit_stats":null,"previous_names":["syntaxlexx/nextjs-socketio-colyseus-gameserver-testing"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntaxlexx%2Fnextjs-socketio-colyseus-gameserver-testing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntaxlexx%2Fnextjs-socketio-colyseus-gameserver-testing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntaxlexx%2Fnextjs-socketio-colyseus-gameserver-testing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntaxlexx%2Fnextjs-socketio-colyseus-gameserver-testing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/syntaxlexx","download_url":"https://codeload.github.com/syntaxlexx/nextjs-socketio-colyseus-gameserver-testing/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240993952,"owners_count":19890419,"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":[],"created_at":"2024-10-11T11:11:15.311Z","updated_at":"2025-02-27T07:54:22.951Z","avatar_url":"https://github.com/syntaxlexx.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Next13 + WebSockets + TypeScript\nA sample implementation of how to handle Websockets with Nextjs 13 `app dir`, `socket.io` and `colyseus`.\n\n#### This is a playground to quickly figure out Nextjs stuff\n\nTesting out these ideas\n- [x] A central Typescript typings between all projects\n- [x] A central database to be used between all projects\n- [x] Handling of websockets in Nextjs\n- [x] Handling of auth between Nextjs and Colyseus\n- [ ] Handling of auth between Nextjs and Socket.io\n- [ ] Room mgmt between Nextjs and Socket.io\n- [x] Room mgmt between Nextjs and Colyseus\n\n## Pointers\n- Make use of React's `ContextApi`\n- To avoid duplicate events on `socket.io`, always `socket.off()` on the `useEffect()` cleanup section (return). That prevents memory leaks.\n- To avoid duplicate events/memory leakage on `colyseus`, refactor the `onJoin` so it can be run on the `cleanup` part in `useEffect`\n\n\n## Setup\n- Run `pnpm i` on all 3 projects (i.e.`colyseus`,`nextjs`,`socketio`)\n- Open 3 terminals, run `npm run dev` on all of them.\n\n## License\n- MIT\n- DBAD -\u003e Don't Be A D*ck!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyntaxlexx%2Fnextjs-socketio-colyseus-gameserver-testing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyntaxlexx%2Fnextjs-socketio-colyseus-gameserver-testing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyntaxlexx%2Fnextjs-socketio-colyseus-gameserver-testing/lists"}