Draft
Conversation
BREAKING_CHANGES: add three table in game.db match, tournament, tournament_player add request for adding and udating database next: add route and controller to interact with database package-lock.json srcs/.env.game.example srcs/game/package.json srcs/game/src/controllers/game.controller.ts srcs/game/src/core/game.database.ts srcs/game/src/routes/game.routes.ts srcs/game/src/types/game.dto.ts
newTournament: create a Tournament and send his id to the frontend FastifyJWT: new interface for prehandler request update(front): fakeCreateTournament -> CreatingTournament Input: addc toggle button to sho/hide the password package-lock.json srcs/.env.game.example srcs/game/package.json srcs/game/src/controllers/game.controller.ts srcs/game/src/core/game.database.ts srcs/game/src/pulgins/auth.plugin.ts srcs/game/src/routes/game.routes.ts srcs/game/src/server.ts srcs/game/src/types/fastify.d.ts srcs/nginx/src/components/atoms/Input.tsx srcs/nginx/src/pages/TournamentCreatePage.tsx
feat(game-database): add new table player to have username add sql request for listing tournaments srcs/game/src/controllers/game.controller.ts srcs/game/src/core/game.database.ts srcs/users/src/app.ts srcs/users/src/config/env.ts srcs/users/src/plugins/ioredis.plugins.ts
add to type in user.schema.ts feat(game-redis): add ioredis plugins, consumer fastify hook onReady StartGameConsumer feat(game-db): add sql request for upsert user and deleted feat(user-redis): add data to stream user.events in controller feat(game): add envalid to config env package-lock.json srcs/docker-compose.yml srcs/game/package.json srcs/game/src/config/env.ts srcs/game/src/core/game.consumer.ts srcs/game/src/core/game.database.ts srcs/game/src/plugins/auth.plugin.ts srcs/game/src/plugins/ioredis.plugin.ts srcs/game/src/server.ts srcs/game/src/types/fastify.d.ts srcs/game/tsconfig.json srcs/shared/core/src/index.ts srcs/shared/core/src/schemas/user.schema.ts srcs/users/src/app.ts srcs/users/src/controllers/profiles.controller.ts srcs/users/src/types/fastify.d.ts srcs/users/tsconfig.json
feat(game-tournament): add Tournament List page add sql request for list tournament fix(game): root route :sessionId intercept all get routes change to ws/:sessionId package-lock.json srcs/game/src/controllers/game.controller.ts srcs/game/src/core/game.database.ts srcs/game/src/routes/game.routes.ts srcs/gateway/src/controllers/game.controller.ts srcs/nginx/src/pages/TournamentsListPage.tsx srcs/shared/core/src/index.ts srcs/shared/core/src/schemas/game.schema.ts
feat(user-events): add event bus insteaed of calling redis.xadd directly in controller fix(gane-data): add player(creator) when creating a tournament package-lock.json srcs/game/src/core/game.consumer.ts srcs/game/src/core/game.database.ts srcs/shared/core/src/index.ts srcs/shared/core/src/schemas/user.schema.ts srcs/users/src/app.ts srcs/users/src/controllers/profiles.controller.ts srcs/users/src/events/redis.subscriber.ts srcs/users/src/events/user.bus.ts
srcs/users/test/profiles.controller.test.ts
srcs/users/vite.config.mjs
srcs/users/src/plugins/ioredis.plugins.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Draft sur la gestion des
donneesdu GameImportant
Cette PR concerne :
Schema de la base dans game-service
erDiagram TOURNAMENT { INTEGER id PK INTEGER creator_id TEXT status INTEGER created_at } MATCH { INTEGER id PK INTEGER tournament_id INTEGER player1 INTEGER player2 INTEGER score_player1 INTEGER score_player2 INTEGER winner_id TEXT round INTEGER created_at } TOURNAMENT_PLAYER { INTEGER tournament_id PK INTEGER player_id PK INTEGER final_position } PLAYER { INTEGER id PK TEXT username INTEGER updated_at } TOURNAMENT ||--o{ MATCH : contains TOURNAMENT ||--o{ TOURNAMENT_PLAYER : has_players TOURNAMENT }o--|| PLAYER : is MATCH }o--|| PLAYER : is TOURNAMENT_PLAYER }o--|| PLAYER : isNavigation dans le Tournoi
flowchart TD %% Entry A[Home / TournamentMenuPage.tsx] A -->|Participate| B[TournamentsListPage.tsx] A -->|Create| C[TournamentCreatePage.tsx] C -->|POST /game/create-tournament| D[(Create tournament in DB)] D -->|return tournamentId| E[TournamentPage.tsx] B -->|Join| E %% Tournament structure E --> F{4 players ready?} F -->|Yes| SF1[Semi-Final 1] F -->|Yes| SF2[Semi-Final 2] %% Semi Final 1 SF1 --> G1{Both players Start?} G1 -->|Yes| M1[Play Match 1] M1 -->|Save score in game.db| R1[Determine Winner/Loser 1] %% Semi Final 2 SF2 --> G2{Both players Start?} G2 -->|Yes| M2[Play Match 2] M2 -->|Save score in game.db| R2[Determine Winner/Loser 2] %% Propagation R1 -->|Winner → Final P1| FP1[Final Slot P1] R1 -->|Loser → Small Final P1| SP1[Small Final Slot P1] R2 -->|Winner → Final P2| FP2[Final Slot P2] R2 -->|Loser → Small Final P2| SP2[Small Final Slot P2] %% Final FP1 --> FINAL{Both players Start?} FP2 --> FINAL FINAL -->|Yes| FM[Play Final] FM -->|Save score in game.db| FW[Determine Champion] %% Small Final SP1 --> SMALL{Both players Start?} SP2 --> SMALL SMALL -->|Yes| SM[Play Small Final] SM -->|Save score in game.db| SW[Determine 3rd place] %% Tournament completion FW --> UPDATE[Update Tournament_player positions] SW --> UPDATE UPDATE --> END[Tournament Completed]Services Game
Ajout du plugin custom Authplugin
userAjout du plugin ioredis
user-eventsdans le service user au moment de la création du profile.Onreadyde Fastify.Modifications de certains composants
Routes Front(React) - Back(Fastify) du tournoi
GETapi/game/tournamentsPOSTapi/game/create-tournamentCaution
Changement route dans Game