{"id":17715760,"url":"https://github.com/bnhovde/tvparty","last_synced_at":"2025-05-13T01:26:33.466Z","repository":{"id":38810641,"uuid":"130451454","full_name":"bnhovde/TVPARTY","owner":"bnhovde","description":"Boilerplate for building multiplayer games for the TV","archived":false,"fork":false,"pushed_at":"2023-01-04T02:46:09.000Z","size":34639,"stargazers_count":3,"open_issues_count":22,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-21T09:54:56.813Z","etag":null,"topics":["framework","game","multiplayer","react","websockets"],"latest_commit_sha":null,"homepage":"","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/bnhovde.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}},"created_at":"2018-04-21T07:39:42.000Z","updated_at":"2024-01-02T22:41:18.000Z","dependencies_parsed_at":"2022-08-30T05:05:31.763Z","dependency_job_id":null,"html_url":"https://github.com/bnhovde/TVPARTY","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnhovde%2FTVPARTY","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnhovde%2FTVPARTY/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnhovde%2FTVPARTY/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnhovde%2FTVPARTY/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bnhovde","download_url":"https://codeload.github.com/bnhovde/TVPARTY/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253852532,"owners_count":21973957,"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":["framework","game","multiplayer","react","websockets"],"created_at":"2024-10-25T12:07:09.199Z","updated_at":"2025-05-13T01:26:33.427Z","avatar_url":"https://github.com/bnhovde.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TVPARTY 📺🎉\n\nBoilerplate for building multiplayer games for the tv.\n\n## What is it?\n\nTVPARTY is a react app/node server with some helpers on place for building real-time multiplayer games like kahoot or jackbox.\n\nTake a look at the example game included for a super simple example.\n\nFor an idea of what you could do, [check out the demo](https://tvparty-io.herokuapp.com/) ([source](https://github.com/bnhovde/TVPARTY-example)).\n\n## Running locally:\n\n1: Clone the repo\n\n2: Add config variables\n\n\u003e TVPARTY uses firebase for the real-time database. Create a new firebase app and copy the config variables to the `/constants/config.js` file.\n\n3: Start the client and server\n\n```\nnpm install\nnpm start\n```\n\n```\nnode server\n```\n\n## Creating a new game\n\nTVPARTY provides a few helper methods and events, but it's up to you to build your own games.\n\n\u003e TIP: Have a look at the [example repo](https://github.com/bnhovde/TVPARTY-example) inspiration.\n\nTo create a new game:\n\n* 1: Create a new folder in the `/Games` directory to hold your game logic.\n* 2: Add any static assets (images etc) to the `/public/assets/[gameName]` folder.\n* 3: Add your game to the `/Games/games.js` file to make it available to the app.\n* 4: Go wild!\n\n## API\n\nThe `GameWrapper` is a higher-order component that will provides the following props and API to your game.\n\nProps:\n\n```\nisHost          - (Bool)    True if host, false if player\ngameData        - (Object)  All game data (real-time)\ngameCode        - (String)  4-digit game code\ncurrentPlayer   - (Object)  Current player data\ncurrentPlayerId - (String)  Current player id\nsocket          - (Object)  Socket.io object (for attaching event listeners)\n```\n\nEvents:\n\n### `updateGameData(gameCode, data)`\n\nPost updates to firebase\n\n#### Parameters\n\n* gameCode (String) 4-digit code of game to modify\n* data (Object) Data object (replaces old data)\n\n### `updatePlayerData(gameCode, playerId, data)`\n\nPost updates to firebase\n\n#### Parameters\n\n* gameCode (String) 4-digit code of game to modify\n* playerId (String) playerId to modify\n* data (Object) Data object (replaces old data)\n\n### `sendEvent(data)`\n\nSend generic websocket event from player. (Events are sent to players in current room only!)\n\n#### Parameters\n\n* data (Object) Data to send\n\n#### Example\n\n```\n  // In gamepad.js (player controller)\n  this.props.sendEvent({\n    type: 'submitClicked',\n    player: playerName,\n  });\n\n  // In splash.js (A game host scene)\n  this.props.socket.on('event', data =\u003e {\n    if (data.type === 'submitClicked') {\n      console.log('submit clicked!', data);\n    }\n  };\n```\n\n### `speak(message)`\n\nText-to-speech output with queuing built in using the native webSpeechAPI.\n\n#### Parameters\n\n* message (string) The text to read aloud\n\n#### Example\n\n```\n  this.props.speak(`${data.name} has joined the game!`);\n```\n\n#### Tips:\n\nIf you want automatic linting (using prettier), add the prettier ext to your editor and enable `formatOnSave`.\n\nThe `/Primitives` folder contains a bunch of useful UI elements you can use. These are built with styled components. You're free to create your own UI and style it however you like.\n\n#### Useful links\n\n[Syncing esling with prettier](https://howtoember.wordpress.com/2017/04/20/syncing-eslint-with-prettier/)\n\n## Authors\n\n[Bård Nyheim Hovde](https://github.com/bnhovde) and [Audun Øygard](https://github.com/apers)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbnhovde%2Ftvparty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbnhovde%2Ftvparty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbnhovde%2Ftvparty/lists"}