Let's create a simple postgres table + Prisma for ORM which stores all the game information
- Whenever a new game is started, create an entry in the
game table
- As the users make moves, store it in a
moves table which has a foreign key to the game table
- Add
ids to every created game and add a new event that let's users re-join a game with a given id if their wifi went down/ws conn reset
- If a user wants to join a game and there is no
in memory Game object for it, recover the game from the DB and put it back in memory
Let's create a simple postgres table + Prisma for ORM which stores all the game information
gametablemovestable which has a foreign key to thegametableidsto every created game and add a new event that let's users re-join a game with a given id if their wifi went down/ws conn resetin memoryGame object for it, recover the game from the DB and put it back in memory