{"id":19975410,"url":"https://github.com/briangershon/planning-poker","last_synced_at":"2025-05-04T02:33:49.167Z","repository":{"id":45546580,"uuid":"413187162","full_name":"briangershon/planning-poker","owner":"briangershon","description":"Planning Poker built with Cloudflare Workers, Workers KV, Durable Objects, Websockets, and Cloudflare Pages. Also React, Redux Toolkit, TypeScript and Snowpack.","archived":false,"fork":false,"pushed_at":"2023-10-12T20:16:10.000Z","size":5639,"stargazers_count":13,"open_issues_count":8,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2023-10-14T22:42:42.047Z","etag":null,"topics":["cloudflare-api","cloudflare-kv","cloudflare-pages","cloudflare-workers","durable-objects","planning-poker","react","redux-toolkit","snowpack","typescript","websockets"],"latest_commit_sha":null,"homepage":"","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/briangershon.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-03T20:16:35.000Z","updated_at":"2023-10-12T20:13:35.000Z","dependencies_parsed_at":"2023-02-09T21:30:54.211Z","dependency_job_id":null,"html_url":"https://github.com/briangershon/planning-poker","commit_stats":null,"previous_names":[],"tags_count":14,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/briangershon%2Fplanning-poker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/briangershon%2Fplanning-poker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/briangershon%2Fplanning-poker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/briangershon%2Fplanning-poker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/briangershon","download_url":"https://codeload.github.com/briangershon/planning-poker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224380123,"owners_count":17301582,"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":["cloudflare-api","cloudflare-kv","cloudflare-pages","cloudflare-workers","durable-objects","planning-poker","react","redux-toolkit","snowpack","typescript","websockets"],"created_at":"2024-11-13T03:18:16.568Z","updated_at":"2024-11-13T03:18:17.165Z","avatar_url":"https://github.com/briangershon.png","language":"TypeScript","funding_links":[],"categories":["🎮 游戏与实时应用 (Games \u0026 Real-Time)"],"sub_categories":[],"readme":"# planning-poker\n\n![Build Status](https://github.com/briangershon/planning-poker/workflows/Continuous%20Integration/badge.svg)\n\n## About\n\nThis game began as an entry in the [Cloudflare Developer Challenge](https://challenge.developers.cloudflare.com). See [Changelog](./CHANGELOG.md) for `v1.0.0`.\n\nWebsocket support was added in `v2.0.0`.\n\nThe Cloudflare Developer Challenge is an event where developers are challenged to build an application using at least two of the products from the Cloudflare developer platform.\n\nThis project uses Cloudflare Workers, Workers KV, Durable Objects, Websockets and Cloudflare Pages. Also React, Redux Toolkit, TypeScript and Snowpack.\n\nCloudflare `Durable Objects` was ideal for maintaining persistent state for each game and its players, as well as being the central point for consolidating `Websocket` requests coming in from the network edge.\n\n## Screenshot\n\n![Planning Poker screenshot](planning-poker-screenshot.png?raw=true)\n\n## What's new?\n\nSee [Changelog](./CHANGELOG.md).\n\n## Github publishing instructions\n\n- Create PR.\n- Update changelog in the feature branch. Remember to add link at the bottom too. Commit and push.\n- Merge PR.\n- Bring down `main` branch.\n- Tag it. For example `git tag -a v2.0.0 -m \"Add full websocket support\"`\n- Push tag. For example `git push origin v2.0.0`\n\n## Run application locally\n\n    # setup nvm to manage Node.js versions\n\n    # in on terminal window run the backend\n    cd workers\n    nvm use       # miniflare needs Node \u003e 12.x\n\n    # create and add development env SECRETS\n    cp .env.TEMPLATE .env.local\n    # edit .env.local\n    GITHUB_CLIENT_ID\n    GITHUB_CLIENT_SECRET\n    GITHUB_CLIENT_SUCCESS_URL to http://localhost:8080\n\n\n    npm run dev   # uses miniflare instead of `wrangler dev`\n    # api is running at http://localhost:8787/api\n\n    # in second terminal window run the frontend\n    cd frontend\n    nvm use\n    npm install\n    npm start\n    # visit http://localhost:8080/\n\n### Run front-end tests\n\n    cd frontend\n    npm test\n\n## Deploy / Publish\n\n### Frontend\n\nSetup Cloudflare Pages for PRODUCTION:\n\n- Build command: `npm run build:prod`\n- Build output directory: `/build`\n- Root directory: `/frontend`\n\nTo deploy, `push` commits to this github repo.\n\n### Backend / Cloudflare worker\n\n    # setup Github oAuth secrets for production via wrangler\n    wrangler secret put GITHUB_CLIENT_ID\n    wrangler secret put GITHUB_CLIENT_SECRET\n    wrangler secret put GITHUB_CLIENT_SUCCESS_URL to https://planningpoker.games\n\n    cd workers\n    nvm use\n    npm i @cloudflare/wrangler -g\n    wrangler publish\n\n## What is the game architecture?\n\nScope:\n\n- A game has an ID, a status, a story sentence, and array of users and their card votes.\n- No concept of game ownership/admin. Anyone can join and do anything in a game if they have the ID.\n- Real-time updates via websockets\n\nWorkflow:\n\n- Logged-in user creates game\n  - create unique gameId to be used in both route and in Durable Object ID\n  - persist gameId by user -- key: `userId:gameId` with value of `createDate` so we can delete games later.\n- Visit any valid game route to participate in game. (Participant needs to be logged in)\n- Users can cast votes, change story sentence, flip cards\n- Poll for updates\n- Only creator of game can delete it, albeit `delete` button shows up for all users.\n\n## How is this project organized?\n\n- `/frontend` for static React site.\n\n  - `./src/containers` are components that pull in data from websockets, redux, api calls.\n  - `./src/components` should be presentation-only React components.\n  - `./src/lib` code modules that don't have a UI\n\n- `/workers` for back-end Cloudflare code.\n\n### SVG Assets\n\n- T-shirt SVG from \u003chttps://svgsilh.com/image/34481.html\u003e\n- Link icon from \u003chttps://icons.getbootstrap.com\u003e\n\n## FAQs\n\n### When running locally, I see a \"TypeError\"\n\nWhen running locally, if you see `TypeError` and `The first argument must be of type string or an instance of Buffer. Received an instance of Uint8Array` you're using an old version of Node.js. Run `nvm use` to get the latest version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbriangershon%2Fplanning-poker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbriangershon%2Fplanning-poker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbriangershon%2Fplanning-poker/lists"}