{"id":28066949,"url":"https://github.com/nickytonline/connect-4-backend","last_synced_at":"2025-05-12T15:55:25.597Z","repository":{"id":282650902,"uuid":"946779366","full_name":"nickytonline/connect-4-backend","owner":"nickytonline","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-16T02:33:32.000Z","size":66,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-16T03:25:34.464Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nickytonline.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-03-11T16:59:02.000Z","updated_at":"2025-03-16T02:33:56.000Z","dependencies_parsed_at":"2025-03-16T03:25:48.458Z","dependency_job_id":"6e1d7920-71df-4ccb-a900-72ab6a036215","html_url":"https://github.com/nickytonline/connect-4-backend","commit_stats":null,"previous_names":["nickytonline/connect-4-backend"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickytonline%2Fconnect-4-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickytonline%2Fconnect-4-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickytonline%2Fconnect-4-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickytonline%2Fconnect-4-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nickytonline","download_url":"https://codeload.github.com/nickytonline/connect-4-backend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253770440,"owners_count":21961769,"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":"2025-05-12T15:55:25.064Z","updated_at":"2025-05-12T15:55:25.579Z","avatar_url":"https://github.com/nickytonline.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Connect 4 Workflow\n\nThe game engine for Connect 4 using Temporal.\n\n## Prerequisites\n\n1. [Install the Temporal Server](https://github.com/temporalio/cli/#installation).\n1. Run `npm install` to install dependencies of the project.\n1. Install [wscat](), a command line utility for interacting with a web socket server.\n\n   ```bash\n   npm install -g wscat\n   ```\n\n## Development Environnent Setup\n\n1. Run `temporal server start-dev` to start the Temporal server.\n1. Run `npm run start.watch` to start the Worker.\n1. Run `npm run wss:watch` to start the web socket server in watch mode.\n\n## Interacting with the workflow\n\nUse `wscat` to send commands to the websocket server. Available payloads to send to the web socket server are:\n\n- Start a game\n\n  ```bash\n  { \"type\": \"START_GAME\", \"gameId\": \"game-123\" }\n  ```\n\n- Join a game\n\n  ```bash\n  {\"type\": \"JOIN_GAME\",\"gameId\":\"game-123\",\"playerName\":\"Nick\" }\n  ```\n\n- Make a move\n\n  ```bash\n  {\"type\": \"MAKE_MOVE\", \"gameId\":\"game-123\", \"x\": 5, \"y\": 4, \"playerId\": 1}\n  ```\n\n- Get the current game context\n\n  ```bash\n  { \"type\": \"GET_GAME_CONTEXT\", \"workflowId\": \"game-123\" }\n  ```\n\nFor example to start a game\"\n\n1. Run `wscat -c ws://localhost:8080` from a shell.\n1. Paste in one of the payloads, e.g. `{ \"type\": \"START_GAME\", \"gameId\": \"game-123\" }`\n\n   ```bash\n   ❯ wscat -c ws://localhost:8080\n   Connected (press CTRL+C to quit)\n   \u003e { \"type\": \"START_GAME\", \"gameId\": \"game-123\" }\n   \u003c {\"type\":\"GAME_STARTED\",\"workflowId\":\"game-123\"}\n   \u003e\n   ```\n\n1. Look in the Temporal UI, http://localhost:8233/namespaces/default/workflows. Notice a new workflow has started.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickytonline%2Fconnect-4-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnickytonline%2Fconnect-4-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickytonline%2Fconnect-4-backend/lists"}