{"id":18950808,"url":"https://github.com/whywaita/rfid-poker","last_synced_at":"2026-03-05T22:05:19.714Z","repository":{"id":161479196,"uuid":"635855592","full_name":"whywaita/rfid-poker","owner":"whywaita","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-25T15:10:43.000Z","size":20502,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-08T13:29:41.868Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://whywaita.github.io/rfid-poker/","language":"Go","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/whywaita.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":"2023-05-03T15:42:12.000Z","updated_at":"2024-01-21T08:53:34.000Z","dependencies_parsed_at":"2024-06-21T19:10:59.750Z","dependency_job_id":"4fb4c767-9b2d-4a3a-a862-fa50ba08bdaa","html_url":"https://github.com/whywaita/rfid-poker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whywaita%2Frfid-poker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whywaita%2Frfid-poker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whywaita%2Frfid-poker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whywaita%2Frfid-poker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/whywaita","download_url":"https://codeload.github.com/whywaita/rfid-poker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232042676,"owners_count":18464358,"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":"2024-11-08T13:24:44.067Z","updated_at":"2026-03-05T22:05:19.703Z","avatar_url":"https://github.com/whywaita.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Equity viewer for poker (No-limit Texas Hold'em)\n\n![demo](./docs/media/demo.gif)\n\n## Requirements\n\n- M5Stack + RFID module\n  - Players x N (N is the number of players) + 1 (for muck) + 1 (for board)\n  - We tested with...\n    - [M5Stack Core2](https://docs.m5stack.com/en/core/core2)\n    - [Unit RFID2](https://docs.m5stack.com/en/unit/rfid2)\n      - This unit has been confirmed by [Switch Science](https://www.switch-science.com/products/8301) to be compliant with Japan's Radio Law. ([ref](https://mag.switch-science.com/2022/05/24/m5stack-3/))\n- Player cards with NFC chip (ISO/IEC 14443 Type A)\n  - We tested player cards include MIFARE Ultralight EV1\n\n## Setup\n\n### Prepare a config file\n\n```bash\n$ cat config.yaml\ncard_ids:  ## UID of NEC card\n  040e3bd2286b85: As\n  040f43d2286b85: Qc\n  04101b9a776b85: Kc\n  ...\n```\n\n### Run the server\n\nRun the server using the following environment variables\n\n```bash\n# Set the path to the config file\n# You can set path as `http://` or `https://` to get the config file from the server.\nexport RFID_POKER_CONFIG_PATH=\"./config.yaml\"\n\n# Set MySQL connection information\nexport RFID_POKER_MYSQL_USER=\u003cyour_mysql_user\u003e\nexport RFID_POKER_MYSQL_PASS=\u003cyour_mysql_password\u003e\nexport RFID_POKER_MYSQL_HOST=\u003cyour_mysql_host\u003e\nexport RFID_POKER_MYSQL_PORT=\u003cyour_mysql_port\u003e\nexport RFID_POKER_MYSQL_DATABASE=\u003cyour_mysql_database\u003e\n\n# Optional: Auto-clear game when players/board stop sending cards.\n# 0 disables timeout. Default: 10\nexport RFID_POKER_CLIENT_TIMEOUT_SECONDS=10\n\n# Run the server\n$ go run ./cmd/server\n```\n\n## Components\n\n### Server\n\nThe server is a golang application that runs on a server.\n\n#### `GET /ws` (websocket)\n\nThe server will upgrade the connection to a websocket. The server send an info about players to the client.\n\nThe body of the message is as follows:\n\n```json\n{\n  \"board\": [\n    {\n      \"rank\": \"A\",\n      \"suit\": \"hearts\"\n    },\n    {\n      \"rank\": \"K\",\n      \"suit\": \"hearts\"\n    },\n    {\n      \"rank\": \"Q\",\n      \"suit\": \"hearts\"\n    },\n    {\n      \"rank\": \"J\",\n      \"suit\": \"hearts\"\n    },\n    {\n      \"rank\": \"T\",\n      \"suit\": \"hearts\"\n    }\n  ],\n  \"players\": [\n    {\n      \"name\": \"Player 1\",\n      \"hand\": [\n        {\n          \"rank\": \"A\",\n          \"suit\": \"spades\"\n        },\n        {\n          \"rank\": \"K\",\n          \"suit\": \"spades\"\n        }\n      ],\n      \"equity\": 0.5\n    },\n    {\n      \"name\": \"Player 2\",\n      \"hand\": [\n        {\n          \"rank\": \"A\",\n          \"suit\": \"clubs\"\n        },\n        {\n          \"rank\": \"K\",\n          \"suit\": \"clubs\"\n        }\n      ],\n      \"equity\": 0.5\n    }\n  ]\n}\n```\n\n#### POST /device/boot\n\nThe device should POST this message when it boots.\n\n```json\n{\n  \"device_id\": \"device_id\",  // as Mac address (in M5stack)\n  \"pair_ids\": [1, 2, 3, ...] // antenna pair ids\n}\n```\n\n#### POST /card\n\nThe device (or wired client) should POST this message when it reads a card.\n\n```json\n{\n  \"device_id\": \"device_id\",    // as Mac address (in M5stack)\n  \"pair_id\": 1,                // antenna pair id\n  \"uid\": \"040e3bd2286b85\"      // as UID of NFC card (spaces are allowed)\n}\n```\n\n### ui\n\nThis ui is a Next.js application that runs on a client.\n\n[ui](./ui) directory is a Next.js application.\n\nYou can use the newest code in GitHub Pages ([https://whywaita.github.io/rfid-poker/](https://whywaita.github.io/rfid-poker/)).\n\n### Client\n\nThis is a M5Stack application that runs on a M5Stack device.\n\n[clients/m5stack](./clients/m5stack) directory is a M5Stack application.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhywaita%2Frfid-poker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhywaita%2Frfid-poker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhywaita%2Frfid-poker/lists"}