{"id":28002352,"url":"https://github.com/drarig29/brackets-toornament-layer","last_synced_at":"2025-08-09T23:09:11.262Z","repository":{"id":93371628,"uuid":"352192152","full_name":"Drarig29/brackets-toornament-layer","owner":"Drarig29","description":"A layer to convert Toornament data to data following the brackets-model","archived":false,"fork":false,"pushed_at":"2024-01-23T19:51:29.000Z","size":137,"stargazers_count":8,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-09T02:44:26.408Z","etag":null,"topics":["bracket","elimination","esports","gaming","group","matches","pnpm","round-robin","seeding","sports","toornament","tournament","tournament-bracket","typescript"],"latest_commit_sha":null,"homepage":"https://replit.com/@Drarig29/Toornament-and-brackets-viewerjs","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/Drarig29.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":"2021-03-27T22:34:46.000Z","updated_at":"2025-02-18T03:04:29.000Z","dependencies_parsed_at":"2024-01-23T20:59:53.328Z","dependency_job_id":"b6f4d8b2-84db-48d6-b6b7-aff991b0eb26","html_url":"https://github.com/Drarig29/brackets-toornament-layer","commit_stats":{"total_commits":34,"total_committers":1,"mean_commits":34.0,"dds":0.0,"last_synced_commit":"0f03e1eef03eb6d060544d2dccceb6b3e8da7cc5"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Drarig29/brackets-toornament-layer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Drarig29%2Fbrackets-toornament-layer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Drarig29%2Fbrackets-toornament-layer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Drarig29%2Fbrackets-toornament-layer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Drarig29%2Fbrackets-toornament-layer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Drarig29","download_url":"https://codeload.github.com/Drarig29/brackets-toornament-layer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Drarig29%2Fbrackets-toornament-layer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269649848,"owners_count":24453541,"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-08-09T02:00:10.424Z","response_time":111,"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":["bracket","elimination","esports","gaming","group","matches","pnpm","round-robin","seeding","sports","toornament","tournament","tournament-bracket","typescript"],"created_at":"2025-05-09T00:17:46.023Z","updated_at":"2025-08-09T23:09:11.236Z","avatar_url":"https://github.com/Drarig29.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# brackets-toornament-layer\n\nA layer to convert Toornament data to [brackets-viewer.js](https://github.com/Drarig29/brackets-viewer.js) data.\n\nYou can use this to view Toornament stages with your own personalized viewer without embedding Toornament's viewer.\n\n[![npm](https://img.shields.io/npm/v/brackets-toornament-layer.svg)](https://www.npmjs.com/package/brackets-toornament-layer)\n\n# Input\n\nYou need to give data for **one tournament** at a time.\n\nToornament API routes needed:\n\n- `/stages` to have the list of stages\n- `/bracket-nodes` to have the `source_node_id` property (used to have the `position` property)\n- `/matches/{match_id}/games` for each match (if you know you have child matches, i.e. Bo3, Bo5, ...)\n\nThe input is constructed as this:\n\n```jsonc\n{\n    \"tournament_id\": \"4468708049713692672\", // Input tournament ID\n    \"stages\": [ \n        // Output of `/stages?tournament_ids=4468708049713692672`\n    ],\n    \"matches\": [ \n        // Output of `/matches?stage_ids=618965765764577354,618931468547654563` for round-robin stages \n        // and `/bracket-nodes?tournament_ids=4468708049713692672` for single and double elimination brackets\n    ],\n    \"match_games\": [ \n        // Flattened list of all `/matches/{match_id}/games` list results\n    ]\n}\n```\n\n**Note:** If `match_games` is omitted, the `child_count` will be set to `0`.\n\n# How to test\n\nFirst, do `npm start`. This will generate the database file `db.json`.\n\nTo quickly test the results, you can use `json-server`.\n\n```bash\nnpx json-server ./output/db.json\n```\n\nThen, open the `./demo/index.html` file from the [brackets-viewer.js](https://github.com/Drarig29/brackets-viewer.js) project.\n\nAnd tada! You are viewing Toornament data with your own viewer! 🎉\n\n# Credits\n\nThis library has been created to be used by the [Nantarena](https://nantarena.net/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrarig29%2Fbrackets-toornament-layer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrarig29%2Fbrackets-toornament-layer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrarig29%2Fbrackets-toornament-layer/lists"}