{"id":23980840,"url":"https://github.com/fourkitchens/scrummy-server","last_synced_at":"2025-10-15T05:18:29.101Z","repository":{"id":138003238,"uuid":"59708025","full_name":"fourkitchens/scrummy-server","owner":"fourkitchens","description":"♠️♣️♥️♦️","archived":false,"fork":false,"pushed_at":"2017-02-18T05:00:28.000Z","size":92,"stargazers_count":2,"open_issues_count":4,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-03T22:33:39.765Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://playscrummy.com","language":"JavaScript","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/fourkitchens.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":"2016-05-26T00:51:28.000Z","updated_at":"2018-06-25T15:17:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"98d25119-7639-4c13-8ad5-76340c3242bf","html_url":"https://github.com/fourkitchens/scrummy-server","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/fourkitchens/scrummy-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fourkitchens%2Fscrummy-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fourkitchens%2Fscrummy-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fourkitchens%2Fscrummy-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fourkitchens%2Fscrummy-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fourkitchens","download_url":"https://codeload.github.com/fourkitchens/scrummy-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fourkitchens%2Fscrummy-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279053014,"owners_count":26094036,"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","status":"online","status_checked_at":"2025-10-15T02:00:07.814Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-01-07T10:18:56.529Z","updated_at":"2025-10-15T05:18:29.060Z","avatar_url":"https://github.com/fourkitchens.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# scrummy-server\n\n[![Four Kitchens](https://img.shields.io/badge/4K-Four%20Kitchens-35AA4E.svg?style=flat-square)](https://fourkitchens.com/)\n[![Travis](https://img.shields.io/travis/fourkitchens/scrummy-server.svg?style=flat-square)](https://travis-ci.org/fourkitchens/scrummy-server/)\n[![Codecov](https://img.shields.io/codecov/c/github/fourkitchens/scrummy-server.svg?style=flat-square)](https://codecov.io/gh/fourkitchens/scrummy-server)\n[![Code Climate](https://img.shields.io/codeclimate/github/fourkitchens/scrummy-server.svg?style=flat-square)](https://codeclimate.com/github/fourkitchens/scrummy-server)\n[![David Dependency Management](https://img.shields.io/david/fourkitchens/scrummy-server.svg?style=flat-square)](https://david-dm.org/fourkitchens/scrummy-server)\n[![David Dependency Management (dev)](https://img.shields.io/david/dev/fourkitchens/scrummy-server.svg?style=flat-square)](https://david-dm.org/dev/fourkitchens/scrummy-server#info=devDependencies\u0026view=table)\n\n## Getting started\n\n### Prerequisites\n\n- Node 6.x\n\n### Installing\n\n- clone this repository\n- install dependencies: `$ npm i`\n- start the server: `$ npm start`\n\n## Running the tests\n\n### Tests\n\n- run the tests: `$ npm t`\n- generate and view test coverage: `$ npm run view-coverage`\n\n- lint code: `$ npm run lint-code`\n- lint writing: `$ npm run lint-writing`\n\n## Usage\n\nThis example code ran in Chrome; your mileage may vary.\n\n### Sending messages\n\n```js\nconst myScrummyClient = new WebSocket('ws://localhost:8080');\nmyScrummyClient.send(JSON.stringify({\n  type: 'signIn',\n  nickname: 'tsmith512',\n}));\n```\n\n### Receiving messages\n\n```js\nconst myScrummyClient = new WebSocket('ws://localhost:8080');\nmyScrummyClient.onmessage = response =\u003e {\n  console.log(JSON.parse(response.data));\n};\n```\n\n\u003ca name=\"Scrummy\"\u003e\u003c/a\u003e\n\n## Scrummy\n**Kind**: global class  \n\n* [Scrummy](#Scrummy)\n    * [new Scrummy()](#new_Scrummy_new)\n    * _instance_\n        * [.shutdown()](#Scrummy+shutdown) ⇒ \u003ccode\u003eundefined\u003c/code\u003e\n    * _static_\n        * [.dispatch(type, data, ws)](#Scrummy.dispatch) ⇒ \u003ccode\u003etype\u003c/code\u003e\n        * [.getGame(gameId)](#Scrummy.getGame) ⇒ \u003ccode\u003etype\u003c/code\u003e\n        * [.handleError(message, ws)](#Scrummy.handleError) ⇒ \u003ccode\u003eundefined\u003c/code\u003e\n        * [.signIn(data, ws)](#Scrummy.signIn) ⇒ \u003ccode\u003eundefined\u003c/code\u003e\n        * [.placeVote(data, ws)](#Scrummy.placeVote) ⇒ \u003ccode\u003eundefined\u003c/code\u003e\n        * [.reset(data)](#Scrummy.reset) ⇒ \u003ccode\u003eundefined\u003c/code\u003e\n        * [.reveal(data)](#Scrummy.reveal) ⇒ \u003ccode\u003eundefined\u003c/code\u003e\n        * [.disconnect(data)](#Scrummy.disconnect) ⇒ \u003ccode\u003eundefined\u003c/code\u003e\n        * [.revokeVote(data)](#Scrummy.revokeVote) ⇒ \u003ccode\u003eundefined\u003c/code\u003e\n\n\u003ca name=\"new_Scrummy_new\"\u003e\u003c/a\u003e\n\n### new Scrummy()\nconstructor\n  Creates a new Scrummy server.\n\n  Starts a websocket server on the port specified in config, creates an empty bucket for\n  storing game related data, specifies which methods are available for invocation via websocket\n  message, and sets up websocket message handling.\n\n  Sets up listeners for messages once a connection to the websocket server exists.\n\n  If the message type is one of the exposed methods, said method executes with the parsed\n  message and the websocket as arguments. Otherwise, the message gets rejected.\n\n\u003ca name=\"Scrummy+shutdown\"\u003e\u003c/a\u003e\n\n### scrummy.shutdown() ⇒ \u003ccode\u003eundefined\u003c/code\u003e\nshutdown - Shuts down the websocket server.\n\n**Kind**: instance method of \u003ccode\u003e[Scrummy](#Scrummy)\u003c/code\u003e  \n\u003ca name=\"Scrummy.dispatch\"\u003e\u003c/a\u003e\n\n### Scrummy.dispatch(type, data, ws) ⇒ \u003ccode\u003etype\u003c/code\u003e\ndispatch - description\n\n**Kind**: static method of \u003ccode\u003e[Scrummy](#Scrummy)\u003c/code\u003e  \n**Returns**: \u003ccode\u003etype\u003c/code\u003e - description  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| type | \u003ccode\u003etype\u003c/code\u003e | description |\n| data | \u003ccode\u003etype\u003c/code\u003e | description |\n| ws | \u003ccode\u003etype\u003c/code\u003e | description |\n\n\u003ca name=\"Scrummy.getGame\"\u003e\u003c/a\u003e\n\n### Scrummy.getGame(gameId) ⇒ \u003ccode\u003etype\u003c/code\u003e\ngetGame - description\n\n**Kind**: static method of \u003ccode\u003e[Scrummy](#Scrummy)\u003c/code\u003e  \n**Returns**: \u003ccode\u003etype\u003c/code\u003e - description  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| gameId | \u003ccode\u003etype\u003c/code\u003e | description |\n\n\u003ca name=\"Scrummy.handleError\"\u003e\u003c/a\u003e\n\n### Scrummy.handleError(message, ws) ⇒ \u003ccode\u003eundefined\u003c/code\u003e\nhandleError - Sends an error to the client\n\n**Kind**: static method of \u003ccode\u003e[Scrummy](#Scrummy)\u003c/code\u003e  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| message | \u003ccode\u003eString\u003c/code\u003e | The error message to send |\n| ws | \u003ccode\u003eObject\u003c/code\u003e | The client to send the message to |\n\n\u003ca name=\"Scrummy.signIn\"\u003e\u003c/a\u003e\n\n### Scrummy.signIn(data, ws) ⇒ \u003ccode\u003eundefined\u003c/code\u003e\nsignIn - Signs a user in if they have provided a valid username\n\n**Kind**: static method of \u003ccode\u003e[Scrummy](#Scrummy)\u003c/code\u003e  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| data | \u003ccode\u003eObject\u003c/code\u003e | The signIn message from the client |\n| ws | \u003ccode\u003eObject\u003c/code\u003e | The websocket to respond to |\n\n\u003ca name=\"Scrummy.placeVote\"\u003e\u003c/a\u003e\n\n### Scrummy.placeVote(data, ws) ⇒ \u003ccode\u003eundefined\u003c/code\u003e\nplaceVote - Places a vote on behalf of a client if the vote and game are valid\n\n**Kind**: static method of \u003ccode\u003e[Scrummy](#Scrummy)\u003c/code\u003e  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| data | \u003ccode\u003eObject\u003c/code\u003e | The signIn message from the client |\n| ws | \u003ccode\u003eObject\u003c/code\u003e | The websocket to respond to |\n\n\u003ca name=\"Scrummy.reset\"\u003e\u003c/a\u003e\n\n### Scrummy.reset(data) ⇒ \u003ccode\u003eundefined\u003c/code\u003e\nreset - Resets the given game\n\n**Kind**: static method of \u003ccode\u003e[Scrummy](#Scrummy)\u003c/code\u003e  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| data | \u003ccode\u003eObject\u003c/code\u003e | The message from the client |\n\n\u003ca name=\"Scrummy.reveal\"\u003e\u003c/a\u003e\n\n### Scrummy.reveal(data) ⇒ \u003ccode\u003eundefined\u003c/code\u003e\nreveal - Broadcasts a reveal event to the appropriate game\n\n**Kind**: static method of \u003ccode\u003e[Scrummy](#Scrummy)\u003c/code\u003e  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| data | \u003ccode\u003eObject\u003c/code\u003e | The message from the client |\n\n\u003ca name=\"Scrummy.disconnect\"\u003e\u003c/a\u003e\n\n### Scrummy.disconnect(data) ⇒ \u003ccode\u003eundefined\u003c/code\u003e\ndisconnect - Disconnects a client from the given game\n\n**Kind**: static method of \u003ccode\u003e[Scrummy](#Scrummy)\u003c/code\u003e  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| data | \u003ccode\u003eObject\u003c/code\u003e | The message from the client |\n\n\u003ca name=\"Scrummy.revokeVote\"\u003e\u003c/a\u003e\n\n### Scrummy.revokeVote(data) ⇒ \u003ccode\u003eundefined\u003c/code\u003e\nrevokeVote - Revokes a vote and broadcasts change\n\n**Kind**: static method of \u003ccode\u003e[Scrummy](#Scrummy)\u003c/code\u003e  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| data | \u003ccode\u003eObject\u003c/code\u003e | The message from the client |\n\n\n## Contributors\n\n![Four Kitchens](https://avatars.githubusercontent.com/u/348885?s=130) | ![Taylor](https://avatars.githubusercontent.com/u/1486573?s=130) | ![Flip](https://avatars.githubusercontent.com/u/1306968?s=130) | ![Luke](https://avatars.githubusercontent.com/u/1127238?s=130)\n--- | --- | --- | ---\n[Four Kitchens](https://github.com/fourkitchens) | [Taylor](https://github.com/tsmith512) | [Flip](https://github.com/flipactual) | [Luke](https://github.com/infiniteluke)\n## License\n\nMIT @ [Four Kitchens](https://github.com/fourkitchens)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffourkitchens%2Fscrummy-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffourkitchens%2Fscrummy-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffourkitchens%2Fscrummy-server/lists"}