diff --git a/docker-compose.yaml b/docker-compose.yaml index 806b859691e07578036c20d31f48cbd9883cbb85..24136f2993a9586c5aa952444ea5da5336f1b46d 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -28,4 +28,10 @@ services: MONGO_INITDB_ROOT_PASSWORD: asdasd123 ports: - 27017:27017 + volumes: + - mongodata:/data/db + - ./test.json:/docker-entrypoint-initdb.d/test.json +volumes: + mongodata: + driver: local \ No newline at end of file diff --git a/sth-frontend/src/utils/router.jsx b/sth-frontend/src/utils/router.jsx index 19682c747131d7d2d6c1ceb5aab02eb69bd17843..452158e49804e520863512da4d4452ddaa02ea81 100644 --- a/sth-frontend/src/utils/router.jsx +++ b/sth-frontend/src/utils/router.jsx @@ -15,17 +15,23 @@ const baseUrl = import.meta.env.VITE_BASE_URL; const router = createBrowserRouter([ { path: "/", - element: <App/>, + element: ( + <EmailProvider> + <App/> + </EmailProvider> + ), children: [ - {path: "", element: <EmailProvider><Landingpage/></EmailProvider>}, - {path: "/login", element: <LoginPage/>}, + { + path: "", + element: <Landingpage/> + }, + { + path: "/login", + element: <LoginPage/> + }, { path: "/register", - element: ( - <EmailProvider> - <Registerpage/> - </EmailProvider> - ) + element: <Registerpage/> }, { path: "/users/:userId/tournaments", diff --git a/test.json b/test.json new file mode 100644 index 0000000000000000000000000000000000000000..f607286df89187f7c426ea8e130e98dfdb5ce473 --- /dev/null +++ b/test.json @@ -0,0 +1,851 @@ +[{ + "_id": { + "$binary": { + "base64": "h0vx1SGxNwJsy1Sv8uUGjw==", + "subType": "03" + } + }, + "tournamentName": "Test 1", + "state": "INITIALIZED", + "bracket": [ + { + "bracketRoundId": { + "$binary": { + "base64": "t0h4tkT8c1T3cHU63E3kiA==", + "subType": "03" + } + }, + "matches": { + "229e89db-faad-4a5a-9b0e-c3f26b5928f5": { + "_id": { + "$binary": { + "base64": "Wkqt+tuJniL1KFlr8sMOmw==", + "subType": "03" + } + }, + "teamScores": { + "6f17c8ac-6102-4466-99ff-58ece350aacc": 2, + "b0a1ad7e-d90f-4a9a-ab49-fcc452ead831": 0 + }, + "winnerTeamId": { + "$binary": { + "base64": "ZkQCYazIF2/MqlDj7Fj/mQ==", + "subType": "03" + } + }, + "nextMatchId": { + "$binary": { + "base64": "lkVvaQR2YodD5JCjRflwiw==", + "subType": "03" + } + } + }, + "9a12e72d-5595-45d8-aeda-392fe704006c": { + "_id": { + "$binary": { + "base64": "2EWVVS3nEppsAATnLznarg==", + "subType": "03" + } + }, + "teamScores": { + "933902e6-0193-47a3-82eb-62454838edbc": 2, + "bdadddfd-ad8b-469e-9181-a83613e99202": 0 + }, + "winnerTeamId": { + "$binary": { + "base64": "o0eTAeYCOZO87ThIRWLrgg==", + "subType": "03" + } + }, + "nextMatchId": { + "$binary": { + "base64": "lkVvaQR2YodD5JCjRflwiw==", + "subType": "03" + } + } + } + }, + "round": 0 + }, + { + "bracketRoundId": { + "$binary": { + "base64": "50vhJ7mRdcIy37VbOAorsw==", + "subType": "03" + } + }, + "matches": { + "87627604-696f-4596-8b70-f945a390e443": { + "_id": { + "$binary": { + "base64": "lkVvaQR2YodD5JCjRflwiw==", + "subType": "03" + } + }, + "teamScores": { + "933902e6-0193-47a3-82eb-62454838edbc": 0, + "6f17c8ac-6102-4466-99ff-58ece350aacc": 0 + } + } + }, + "round": 1 + } + ], + "teams": { + "6f17c8ac-6102-4466-99ff-58ece350aacc": { + "teamId": { + "$binary": { + "base64": "ZkQCYazIF2/MqlDj7Fj/mQ==", + "subType": "03" + } + }, + "teamName": "Team 2", + "teamMembers": {} + }, + "933902e6-0193-47a3-82eb-62454838edbc": { + "teamId": { + "$binary": { + "base64": "o0eTAeYCOZO87ThIRWLrgg==", + "subType": "03" + } + }, + "teamName": "Team 3", + "teamMembers": {} + }, + "bdadddfd-ad8b-469e-9181-a83613e99202": { + "teamId": { + "$binary": { + "base64": "nkaLrf3drb0CkukTNqiBkQ==", + "subType": "03" + } + }, + "teamName": "Team 1", + "teamMembers": {} + }, + "b0a1ad7e-d90f-4a9a-ab49-fcc452ead831": { + "teamId": { + "$binary": { + "base64": "mkoP2X6tobAx2OpSxPxJqw==", + "subType": "03" + } + }, + "teamName": "Team 4", + "teamMembers": {} + } + }, + "_class": "hdm.mi.sthbackend.model.Tournament" +}, + { + "_id": { + "$binary": { + "base64": "FEKVN7WGLwoYTV6DMLL4kQ==", + "subType": "03" + } + }, + "tournamentName": "Test 2", + "state": "INITIALIZED", + "bracket": [ + { + "bracketRoundId": { + "$binary": { + "base64": "FEPabsawDkibOtBe/4TQsQ==", + "subType": "03" + } + }, + "matches": { + "09129bd1-acef-4a8f-aa83-4bef5fc8ef45": { + "_id": { + "$binary": { + "base64": "j0rvrNGbEglF78hf70uDqg==", + "subType": "03" + } + }, + "teamScores": { + "4cb5b584-6b88-4b48-a2f8-04b6a38b1744": 0, + "2d34d93d-088f-46a4-bd18-7b8232d58512": 0 + }, + "nextMatchId": { + "$binary": { + "base64": "uEjzk25ybg2V4VlSb8ZMkQ==", + "subType": "03" + } + } + }, + "45642558-c202-4144-990b-5e684caaf487": { + "_id": { + "$binary": { + "base64": "REECwlglZEWH9KpMaF4LmQ==", + "subType": "03" + } + }, + "teamScores": { + "a6c68341-2753-43ed-b0e6-b6af6779cbeb": 0, + "cd0d75d9-8269-4de3-be74-2ba7ae70e3ea": 0 + }, + "nextMatchId": { + "$binary": { + "base64": "uEjzk25ybg2V4VlSb8ZMkQ==", + "subType": "03" + } + } + }, + "b704fdb8-e974-493a-9e46-8fee9e42e78d": { + "_id": { + "$binary": { + "base64": "Okl06bj9BLeN50Ke7o9Gng==", + "subType": "03" + } + }, + "teamScores": { + "30983a81-48cf-45f0-b9bf-73c96239ed0a": 0, + "77d3977e-0e2e-4429-91b2-e99b0643a03a": 0 + }, + "nextMatchId": { + "$binary": { + "base64": "kkYzFuckUzu6Wyh9nOaWjQ==", + "subType": "03" + } + } + }, + "9ba329af-4462-43e8-962d-70e0903c9120": { + "_id": { + "$binary": { + "base64": "6ENiRK8po5sgkTyQ4HAtlg==", + "subType": "03" + } + }, + "teamScores": { + "25291875-a9ee-42ee-9272-07631ad189c7": 0, + "be229f55-8174-4525-858e-6d5c17ba6250": 0 + }, + "nextMatchId": { + "$binary": { + "base64": "kkYzFuckUzu6Wyh9nOaWjQ==", + "subType": "03" + } + } + } + }, + "round": 0 + }, + { + "bracketRoundId": { + "$binary": { + "base64": "A04Nf6+fbpNulUR4RCdwpA==", + "subType": "03" + } + }, + "matches": { + "0d6e726e-93f3-48b8-914c-c66f5259e195": { + "_id": { + "$binary": { + "base64": "uEjzk25ybg2V4VlSb8ZMkQ==", + "subType": "03" + } + }, + "teamScores": {}, + "nextMatchId": { + "$binary": { + "base64": "tUb9Qr+HMENK6aGupG21vA==", + "subType": "03" + } + } + }, + "3b5324e7-1633-4692-8d96-e69c7d285bba": { + "_id": { + "$binary": { + "base64": "kkYzFuckUzu6Wyh9nOaWjQ==", + "subType": "03" + } + }, + "teamScores": {}, + "nextMatchId": { + "$binary": { + "base64": "tUb9Qr+HMENK6aGupG21vA==", + "subType": "03" + } + } + } + }, + "round": 1 + }, + { + "bracketRoundId": { + "$binary": { + "base64": "m0bx7zIz/FcxgoL9wj36mA==", + "subType": "03" + } + }, + "matches": { + "433087bf-42fd-46b5-bcb5-6da4aea1e94a": { + "_id": { + "$binary": { + "base64": "tUb9Qr+HMENK6aGupG21vA==", + "subType": "03" + } + }, + "teamScores": {} + } + }, + "round": 2 + } + ], + "teams": { + "4cb5b584-6b88-4b48-a2f8-04b6a38b1744": { + "teamId": { + "$binary": { + "base64": "SEuIa4S1tUxEF4ujtgT4og==", + "subType": "03" + } + }, + "teamName": "Snake", + "teamMembers": {} + }, + "a6c68341-2753-43ed-b0e6-b6af6779cbeb": { + "teamId": { + "$binary": { + "base64": "7UNTJ0GDxqbry3lnr7bmsA==", + "subType": "03" + } + }, + "teamName": "Rabbit", + "teamMembers": {} + }, + "30983a81-48cf-45f0-b9bf-73c96239ed0a": { + "teamId": { + "$binary": { + "base64": "8EXPSIE6mDAK7TliyXO/uQ==", + "subType": "03" + } + }, + "teamName": "Tiger", + "teamMembers": {} + }, + "cd0d75d9-8269-4de3-be74-2ba7ae70e3ea": { + "teamId": { + "$binary": { + "base64": "401pgtl1Dc3q43Cupyt0vg==", + "subType": "03" + } + }, + "teamName": "Goose", + "teamMembers": {} + }, + "77d3977e-0e2e-4429-91b2-e99b0643a03a": { + "teamId": { + "$binary": { + "base64": "KUQuDn6X03c6oEMGm+mykQ==", + "subType": "03" + } + }, + "teamName": "Orca", + "teamMembers": {} + }, + "25291875-a9ee-42ee-9272-07631ad189c7": { + "teamId": { + "$binary": { + "base64": "7kLuqXUYKSXHidEaYwdykg==", + "subType": "03" + } + }, + "teamName": "Duck", + "teamMembers": {} + }, + "be229f55-8174-4525-858e-6d5c17ba6250": { + "teamId": { + "$binary": { + "base64": "JUV0gVWfIr5QYroXXG2OhQ==", + "subType": "03" + } + }, + "teamName": "Gorilla", + "teamMembers": {} + }, + "2d34d93d-088f-46a4-bd18-7b8232d58512": { + "teamId": { + "$binary": { + "base64": "pEaPCD3ZNC0ShdUygnsYvQ==", + "subType": "03" + } + }, + "teamName": "Lion", + "teamMembers": {} + } + }, + "_class": "hdm.mi.sthbackend.model.Tournament" + }, + { + "_id": { + "$binary": { + "base64": "p0RQpmZiwK0eSIhoC96AsQ==", + "subType": "03" + } + }, + "tournamentName": "Test 3", + "state": "INITIALIZED", + "bracket": [ + { + "bracketRoundId": { + "$binary": { + "base64": "C0YVTstmZTahmZtSLMVniw==", + "subType": "03" + } + }, + "matches": { + "61ce5203-698a-4b57-9630-a732055d34ef": { + "_id": { + "$binary": { + "base64": "V0uKaQNSzmHvNF0FMqcwlg==", + "subType": "03" + } + }, + "teamScores": { + "3b3983e2-5440-42f8-ad57-a9989a5807b2": 0, + "9a3e27d8-d19d-41fc-bd3f-6049a0f98525": 0 + }, + "nextMatchId": { + "$binary": { + "base64": "hkRG5PoOLGKo88l2kaainA==", + "subType": "03" + } + } + }, + "f554974b-921d-42d3-88eb-2dd45c083ae6": { + "_id": { + "$binary": { + "base64": "00IdkkuXVPXmOghc1C3riA==", + "subType": "03" + } + }, + "teamScores": { + "303fcad9-ef19-4e33-bc7d-37ca62b96730": 0, + "bb828d9b-ed2e-452f-9cb9-96107f0969de": 0 + }, + "nextMatchId": { + "$binary": { + "base64": "hkRG5PoOLGKo88l2kaainA==", + "subType": "03" + } + } + }, + "253392c2-4d1b-46dc-b7e2-6bdb3510dcce": { + "_id": { + "$binary": { + "base64": "3EYbTcKSMyXO3BA122vitw==", + "subType": "03" + } + }, + "teamScores": { + "58687142-6d0b-42ec-a5ef-ec0b895ab013": 0, + "5f6e244e-5f1b-432e-a6ae-8af90614a9b9": 0 + }, + "nextMatchId": { + "$binary": { + "base64": "wE7+tXbKDyWXbyxLPNXKhw==", + "subType": "03" + } + } + }, + "05d28805-2fbd-48a6-b7a9-d7c29689678d": { + "_id": { + "$binary": { + "base64": "pki9LwWI0gWNZ4mWwteptw==", + "subType": "03" + } + }, + "teamScores": { + "bfd51e67-b24f-457a-9e56-bda05a34ad13": 0, + "3a3c9183-a991-46bf-bcda-e79b521c05f0": 0 + }, + "nextMatchId": { + "$binary": { + "base64": "wE7+tXbKDyWXbyxLPNXKhw==", + "subType": "03" + } + } + }, + "7ddd3d59-b2be-4a32-90e0-82dd25d92fc8": { + "_id": { + "$binary": { + "base64": "Mkq+slk93X3IL9kl3YLgkA==", + "subType": "03" + } + }, + "teamScores": { + "e4748c1c-7540-4f01-9b03-06546f54fe78": 0, + "6abd21be-0a9b-46e4-8f75-79a3f143a7fe": 0 + }, + "nextMatchId": { + "$binary": { + "base64": "lUgKqTuhPUAG22uGd4kekQ==", + "subType": "03" + } + } + }, + "9e0536f7-7601-485b-9285-54ef83b6643e": { + "_id": { + "$binary": { + "base64": "W0gBdvc2BZ4+ZLaD71SFkg==", + "subType": "03" + } + }, + "teamScores": { + "ce9de4ed-2c1f-4d27-9f9a-660a7ee625fb": 0, + "53a6460d-2823-4ce4-97d5-cdc21ea7fd8a": 0 + }, + "nextMatchId": { + "$binary": { + "base64": "lUgKqTuhPUAG22uGd4kekQ==", + "subType": "03" + } + } + }, + "8e912822-178d-48e4-9347-9fec2b60e6ae": { + "_id": { + "$binary": { + "base64": "5EiNFyIokY6u5mAr7J9Hkw==", + "subType": "03" + } + }, + "teamScores": { + "d17e5a9f-3a8c-48de-9dc0-a32038984df9": 0, + "7d014e3c-0180-454d-8929-0df09a2abe0d": 0 + }, + "nextMatchId": { + "$binary": { + "base64": "bEWIsZLUe05DbiNzmboamQ==", + "subType": "03" + } + } + }, + "d31288fb-7fcb-4ff2-8a04-888b22474477": { + "_id": { + "$binary": { + "base64": "8k/Lf/uIEtN3REcii4gEig==", + "subType": "03" + } + }, + "teamScores": { + "0a98cbdd-32d4-4ac8-9910-1c1e92b5081b": 0, + "cf871951-f1c1-404c-8333-83208e5bc63c": 0 + }, + "nextMatchId": { + "$binary": { + "base64": "bEWIsZLUe05DbiNzmboamQ==", + "subType": "03" + } + } + } + }, + "round": 0 + }, + { + "bracketRoundId": { + "$binary": { + "base64": "ikrXxzXXJeNEyh7BZIzgtA==", + "subType": "03" + } + }, + "matches": { + "622c0efa-e446-4486-9ca2-a69176c9f3a8": { + "_id": { + "$binary": { + "base64": "hkRG5PoOLGKo88l2kaainA==", + "subType": "03" + } + }, + "teamScores": {}, + "nextMatchId": { + "$binary": { + "base64": "ykYiLlYvBPmmU0ZAyCJCkA==", + "subType": "03" + } + } + }, + "250fca76-b5fe-4ec0-87ca-d53c4b2c6f97": { + "_id": { + "$binary": { + "base64": "wE7+tXbKDyWXbyxLPNXKhw==", + "subType": "03" + } + }, + "teamScores": {}, + "nextMatchId": { + "$binary": { + "base64": "ykYiLlYvBPmmU0ZAyCJCkA==", + "subType": "03" + } + } + }, + "403da13b-a90a-4895-911e-8977866bdb06": { + "_id": { + "$binary": { + "base64": "lUgKqTuhPUAG22uGd4kekQ==", + "subType": "03" + } + }, + "teamScores": {}, + "nextMatchId": { + "$binary": { + "base64": "bkrqIGCI7JVz7MyPymEDjw==", + "subType": "03" + } + } + }, + "4e7bd492-b188-456c-991a-ba9973236e43": { + "_id": { + "$binary": { + "base64": "bEWIsZLUe05DbiNzmboamQ==", + "subType": "03" + } + }, + "teamScores": {}, + "nextMatchId": { + "$binary": { + "base64": "bkrqIGCI7JVz7MyPymEDjw==", + "subType": "03" + } + } + } + }, + "round": 1 + }, + { + "bracketRoundId": { + "$binary": { + "base64": "b0JZEJU8Jr4FCCXAqac9gw==", + "subType": "03" + } + }, + "matches": { + "f9042f56-2e22-46ca-9042-22c8404653a6": { + "_id": { + "$binary": { + "base64": "ykYiLlYvBPmmU0ZAyCJCkA==", + "subType": "03" + } + }, + "teamScores": {}, + "nextMatchId": { + "$binary": { + "base64": "/0PW7n/YQ50RE6LoEl0omQ==", + "subType": "03" + } + } + }, + "95ec8860-20ea-4a6e-8f03-61ca8fccec73": { + "_id": { + "$binary": { + "base64": "bkrqIGCI7JVz7MyPymEDjw==", + "subType": "03" + } + }, + "teamScores": {}, + "nextMatchId": { + "$binary": { + "base64": "/0PW7n/YQ50RE6LoEl0omQ==", + "subType": "03" + } + } + } + }, + "round": 2 + }, + { + "bracketRoundId": { + "$binary": { + "base64": "EUUljAy31rfg8FTKH9M/jw==", + "subType": "03" + } + }, + "matches": { + "9d43d87f-eed6-43ff-9928-5d12e8a21311": { + "_id": { + "$binary": { + "base64": "/0PW7n/YQ50RE6LoEl0omQ==", + "subType": "03" + } + }, + "teamScores": {} + } + }, + "round": 3 + } + ], + "teams": { + "58687142-6d0b-42ec-a5ef-ec0b895ab013": { + "teamId": { + "$binary": { + "base64": "7EILbUJxaFgTsFqJC+zvpQ==", + "subType": "03" + } + }, + "teamName": "FC Porto", + "teamMembers": {} + }, + "ce9de4ed-2c1f-4d27-9f9a-660a7ee625fb": { + "teamId": { + "$binary": { + "base64": "J00fLO3knc77JeZ+Cmaanw==", + "subType": "03" + } + }, + "teamName": "Borussia Dortmund", + "teamMembers": {} + }, + "bb828d9b-ed2e-452f-9cb9-96107f0969de": { + "teamId": { + "$binary": { + "base64": "L0Uu7ZuNgrveaQl/EJa5nA==", + "subType": "03" + } + }, + "teamName": "FC Barcelona", + "teamMembers": {} + }, + "3b3983e2-5440-42f8-ad57-a9989a5807b2": { + "teamId": { + "$binary": { + "base64": "+EJAVOKDOTuyB1iamKlXrQ==", + "subType": "03" + } + }, + "teamName": "PSV Eindhoven", + "teamMembers": {} + }, + "9a3e27d8-d19d-41fc-bd3f-6049a0f98525": { + "teamId": { + "$binary": { + "base64": "/EGd0dgnPpolhfmgSWA/vQ==", + "subType": "03" + } + }, + "teamName": "Real Madrid", + "teamMembers": {} + }, + "7d014e3c-0180-454d-8929-0df09a2abe0d": { + "teamId": { + "$binary": { + "base64": "TUWAATxOAX0Nviqa8A0piQ==", + "subType": "03" + } + }, + "teamName": "Manchester United", + "teamMembers": {} + }, + "5f6e244e-5f1b-432e-a6ae-8af90614a9b9": { + "teamId": { + "$binary": { + "base64": "LkMbX04kbl+5qRQG+Yqupg==", + "subType": "03" + } + }, + "teamName": "FC Liverpool", + "teamMembers": {} + }, + "cf871951-f1c1-404c-8333-83208e5bc63c": { + "teamId": { + "$binary": { + "base64": "TEDB8VEZh888xluOIIMzgw==", + "subType": "03" + } + }, + "teamName": "Arsenal London", + "teamMembers": {} + }, + "e4748c1c-7540-4f01-9b03-06546f54fe78": { + "teamId": { + "$binary": { + "base64": "AU9AdRyMdOR4/lRvVAYDmw==", + "subType": "03" + } + }, + "teamName": "Bayern München", + "teamMembers": {} + }, + "d17e5a9f-3a8c-48de-9dc0-a32038984df9": { + "teamId": { + "$binary": { + "base64": "3kiMOp9aftH5TZg4IKPAnQ==", + "subType": "03" + } + }, + "teamName": "Atletico Madrid", + "teamMembers": {} + }, + "53a6460d-2823-4ce4-97d5-cdc21ea7fd8a": { + "teamId": { + "$binary": { + "base64": "5EwjKA1GplOK/acews3Vlw==", + "subType": "03" + } + }, + "teamName": "Benfica Lissabon", + "teamMembers": {} + }, + "bfd51e67-b24f-457a-9e56-bda05a34ad13": { + "teamId": { + "$binary": { + "base64": "ekVPsmce1b8TrTRaoL1Wng==", + "subType": "03" + } + }, + "teamName": "Juventus Turin", + "teamMembers": {} + }, + "6abd21be-0a9b-46e4-8f75-79a3f143a7fe": { + "teamId": { + "$binary": { + "base64": "5EabCr4hvWr+p0Pxo3l1jw==", + "subType": "03" + } + }, + "teamName": "Bayer Leverkusen", + "teamMembers": {} + }, + "0a98cbdd-32d4-4ac8-9910-1c1e92b5081b": { + "teamId": { + "$binary": { + "base64": "yErUMt3LmAobCLWSHhwQmQ==", + "subType": "03" + } + }, + "teamName": "Inter Mailand", + "teamMembers": {} + }, + "3a3c9183-a991-46bf-bcda-e79b521c05f0": { + "teamId": { + "$binary": { + "base64": "v0aRqYORPDrwBRxSm+favA==", + "subType": "03" + } + }, + "teamName": "Chelsea FC", + "teamMembers": {} + }, + "303fcad9-ef19-4e33-bc7d-37ca62b96730": { + "teamId": { + "$binary": { + "base64": "M04Z79nKPzAwZ7liyjd9vA==", + "subType": "03" + } + }, + "teamName": "Ajax Amsterdam", + "teamMembers": {} + } + }, + "_class": "hdm.mi.sthbackend.model.Tournament" + }, + { + "_id": { + "$binary": { + "base64": "rU/LgQBn7Tih7AbirN7UmQ==", + "subType": "03" + } + }, + "tournamentName": "Test 4", + "state": "CREATED", + "bracket": [], + "teams": {}, + "_class": "hdm.mi.sthbackend.model.Tournament" + }] \ No newline at end of file