{"id":22845426,"url":"https://github.com/r3dacted42/tic-tac-toe","last_synced_at":"2026-04-27T22:33:02.382Z","repository":{"id":235982892,"uuid":"791663511","full_name":"r3dacted42/tic-tac-toe","owner":"r3dacted42","description":"multiplayer tic-tac-toe game using phaser and pusher","archived":false,"fork":false,"pushed_at":"2024-08-03T13:43:19.000Z","size":163,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-31T05:28:53.929Z","etag":null,"topics":["multiplayer-game","online-game","phaser3","phaserjs","tic-tac-toe","tictactoe","two-player"],"latest_commit_sha":null,"homepage":"https://tic-tac-toe-chi-liart.vercel.app","language":"JavaScript","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/r3dacted42.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-04-25T06:14:01.000Z","updated_at":"2025-03-05T21:56:19.000Z","dependencies_parsed_at":"2024-04-28T12:22:37.108Z","dependency_job_id":"8e1622fc-d6ad-484a-b5a3-432e5b1b3669","html_url":"https://github.com/r3dacted42/tic-tac-toe","commit_stats":null,"previous_names":["r3dacted42/tic-tac-toe"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/r3dacted42/tic-tac-toe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r3dacted42%2Ftic-tac-toe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r3dacted42%2Ftic-tac-toe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r3dacted42%2Ftic-tac-toe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r3dacted42%2Ftic-tac-toe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r3dacted42","download_url":"https://codeload.github.com/r3dacted42/tic-tac-toe/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r3dacted42%2Ftic-tac-toe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32358509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["multiplayer-game","online-game","phaser3","phaserjs","tic-tac-toe","tictactoe","two-player"],"created_at":"2024-12-13T03:17:11.709Z","updated_at":"2026-04-27T22:33:02.366Z","avatar_url":"https://github.com/r3dacted42.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tic-tac-toe\ntic-tac-toe game using phaser and pusher\n\n## architecture\n- backend runs on express\n- pusher used by server for matchmaking and clients for intercommunication\n- clients make rest calls to server for game events\n- server maintains the game state and verifies moves before modifying the state\n\n## flow\n- pusher authentication and room assignment\n    - client sends user's chosen name to authentication endpoint\n    - server returns the assigned user-id and room-id for the client\n    - server also sends the user-id, and user-info (name, room-id) of the new user to pusher\n    - server stores the newly created room's status as waiting, with a member count of 0\n    - client joins the lobby channel and subscribes to the count change event to keep track of the number of users waiting to play\n    - on success, the client loads the `Lobby` scene and presents the room-id, a text box to enter an existing room-id, and a button to join a random existing room\n- pusher authorization and room joining\n    - client sends the user-id and room-id (which when prefixed with 'presence-' becomes the channel name) to the authorization endpoint\n    - server verifies if the room exists and is valid, and then queries pusher to get the number of users in that room\n    - if the number of users is less than 2, the user is provided entry into the room and the room is marked as ready when the user-count reaches 2\n    - when the room is ready, the server stores the user-id of the player who will make the first move, the first move type (X), the scores (0, 0), and the board state (empty)\n    - if a user tries to join a room that already has 2 players, they are notified that the room is full\n    - when the room is ready (2 users have joined), the client leaves the lobby channel and loads the `Play` scene\n    - when the endpoint for joining a random room is called, the server finds the first room that has 1 user and returns the room id. if no such rooms exist, the user's room is marked as random and a searching message is displayed\n    - the users are also able to communicate through text messages that can be sent through a text box at the bottom left\n- game initiation\n    - clients query the server at the room-status endpoint to receive the initial state of the game\n    - clients set up the board and the player who's marked as the first player is displayed the possible moves they can make (a bunch of X's accross the board)\n- game flow\n    - on selection of a move by the user, it is sent to the server at the make-move endpoint and is verified to be valid\n    - on validation, the client receives the updated state of the game and sends the result to the other user in the room through pusher\n    - both clients update the views and the next user is displayed the possible moves\n    - this goes on until there's a winner or a tie, with the server validating each step and deciding the outcome\n    - when the match ends, the result is displayed on the clients and a timer of 10 seconds is started\n- game reset\n    - when the timer ends, both the clients make a request to the reset-game endpoint\n    - client whose request reaches first is responded that the reset has been initiated\n    - the server sets the room status as resetting and resets the game state, with the losing player getting the first move\n    - on arrival of the second client's request, the room is marked as ready and the new state of the game is sent back\n    - client who received the state then forwards it to the other client in the room and both reset the board\n    - the game begins again with the losing user's client displaying the possible moves\n    - this keeps on going until the users reload the page\n    - if a user leaves mid-match, the user who is still in the room is notified and the page reloads in 10 seconds (not implemented yet)\n\n## api endpoints\n- /api/auth (pusher authentication)\n- /api/auth-chan (pusher authorization)\n- /api/room-status\n- /api/join-random\n- /api/make-move\n- /api/reset-game\n\n## thanks\nphaser, pusher, vercel, the community  \npeace ☮ \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr3dacted42%2Ftic-tac-toe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr3dacted42%2Ftic-tac-toe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr3dacted42%2Ftic-tac-toe/lists"}