{"id":18917804,"url":"https://github.com/oyvinddd/office-tournament-dotnet","last_synced_at":"2025-09-04T05:46:26.324Z","repository":{"id":241578445,"uuid":"807070591","full_name":"oyvinddd/office-tournament-dotnet","owner":"oyvinddd","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-28T18:43:25.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-29T05:16:35.007Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","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/oyvinddd.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":"2024-05-28T12:32:18.000Z","updated_at":"2024-05-29T05:16:40.732Z","dependencies_parsed_at":"2024-05-29T05:16:39.991Z","dependency_job_id":"0072c462-624b-462c-a32d-1c88cdc5f158","html_url":"https://github.com/oyvinddd/office-tournament-dotnet","commit_stats":null,"previous_names":["oyvinddd/office-tournament-dotnet"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oyvinddd%2Foffice-tournament-dotnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oyvinddd%2Foffice-tournament-dotnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oyvinddd%2Foffice-tournament-dotnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oyvinddd%2Foffice-tournament-dotnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oyvinddd","download_url":"https://codeload.github.com/oyvinddd/office-tournament-dotnet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239914930,"owners_count":19717760,"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-08T10:28:16.796Z","updated_at":"2025-02-20T20:41:45.288Z","avatar_url":"https://github.com/oyvinddd.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# API\n\n## Auth\n\n### Registration\n\n```\n[POST] /api/v1/register\n\nREQUEST BODY:\n{\n    \"username\": \"the_username\",\n    \"password\": \"the_password\"\n}\n```\n\n### Basic (TEMP)\n\nIf a valid username/password combo is found in the Accounts table, we create a JWT token with the GUID of the account and return it to the user in the response body.\n\n```\n[POST] /api/v1/login\n\nREQUEST BODY:\n{\n    \"username\": \"the_username\",\n    \"password\": \"the_password\"\n}\n```\n\n### Sign in with Apple / Google\n\nTODO: ...\n\n## Accounts\n\n### My account\n\n```\n[GET] /api/v1/account\n```\n\n## Tournaments\n\nA given account can only have one active tournament at a time.\n\n### Create tournament\n\n```\n[POST] /api/v1/tournaments\n\nREQUEST BODY:\n{\n    \"title\": \"Tietoevry Ping Pong\",\n    \"reset_interval\": 0\n}\n```\n\n### Search for tournament\n\nSearch for tournaments matching the query parameter. Returns a list of tournaments.\n\n```\n[GET] /api/v1/tournaments/search/{query}\n```\n\n### Join tournament\n\n```\n[PUT] /api/v1/tournaments/join/{tournament_id}\n\nREQUEST BODY:\n{\n    \"code\": \"the_code\"\n}\n```\n\n### Get tournament\n\n```\n[GET] /api/v1/tournaments\n\nRESPONSE BODY:\n\n{\n    \"id\": \"the_guid\",\n    \"title\": \"the_title\",\n    \"scoreboard\": [\n        {\n            \"id\": \"the_player_id\",\n            \"username\": \"the_player_username\",\n            \"score\": 0,\n            \"matches_played\": 12,\n            \"matches_won\": 10\n        },\n        ...\n    ]\n}\n```\n\n### Leave tournament\n\n```\n[PUT] /api/v1/tournaments/leave\n```\n\n### Register match\n\n```\n[POST] /api/v1/tournaments/match/{opponent_id}\n```\n\n## Models\n\n### Account table\n\n* id (GUID): primary key\n* tournament_id (GIUD): foreign key, nullable\n* email: valid email (will come from SSO-provider)\n* username: the username\n* score: integer, default = 1600, ELO-based score\n* matches_won: integer, default = 0\n* matches_played: integer, default = 0\n* created_at: unix timestamp\n\n### Tournament table\n\n* id (GUID): primary key\n* admin_id (GUID): foreign key\n* title: the tournament title\n* reset_interval: integer (0 = monthly, 1 = weekly, 2 = yearly, 3 = never)\n* code: string, 6 alphanumeric randomly generated characters (A-Z, a-z, 0-9)\n\n### Match table\n\n* id (GUID): primary key\n* tournament_id (GUID): foreign key\n* winner_id (GUID): the id of the winner\n* winner_delta_score: integer, how many points the winner got\n* loser_id (GUID): the id of the loser\n* loser_delta_score: integer, how many points the loser lost\n* date: unix timestamp of when the match was registered\n\n## Example users\n\n### User 1\n\n{\n    \"id\": \"43c9f799-55c1-45e6-ab25-1df1f55cd9cb\",\n    \"email\": \"user@test1.com\",\n    \"username\": \"user1\"\n}\n\nThe \"sub\" claim contains the user ID.\n\neyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI0M2M5Zjc5OS01NWMxLTQ1ZTYtYWIyNS0xZGYxZjU1Y2Q5Y2IiLCJpYXQiOjE1MTYyMzkwMjJ9.nsJkcfkjt_9wOvzJd5ZMEOHGIyqrZ8tShQZIVbUxExg \n\n### User 2\n\n{\n    \"id\": \"8f2902ab-a646-4fac-a9e3-e33d2283f5d8\",\n    \"email\": \"user@test2.com\",\n    \"username\": \"user2\"\n}\n\nThe \"sub\" claim contains the user ID.\n\neyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI4ZjI5MDJhYi1hNjQ2LTRmYWMtYTllMy1lMzNkMjI4M2Y1ZDgiLCJpYXQiOjE1MTYyMzkwMjJ9.HhA7T5nAfQCIgJKhkgPBM_U8SwP48JRhdps0675wwxY\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foyvinddd%2Foffice-tournament-dotnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foyvinddd%2Foffice-tournament-dotnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foyvinddd%2Foffice-tournament-dotnet/lists"}