- Redis Instance (https://redis.io/download)
- Nodejs v14
- Typescript
- Redis (leaderboard using sorted set and gamestate using hashes)
- Express for api support:
- GET /gamestate - Getting game state for user, user is fetched using username header.
- PATCH /gamestate - Update a game state for a user, user is fetched using username header.
- GET /leaderboard - Getting latest leaderboard.
- React
- Redux Toolkit - For state management
- Axios for 3rd API Support
- Typescript
- Webpack
- Assuming you have already installed redis and it is using default port.
- Go to
server
dir. - Run
npm i
oryarn
. - Run
yarn start
. - If everything is working fine, you should see
server listening
on console. - Server will run on
9000
port. - If something goes wrong, let me know, I will have a look at it.
- Go to
client
dir. - Run
npm i
oryarn
. - Run
yarn start
. - UI will run on
3000
port.
- Game states are saved in redis instance on every move by making a
PATCH /gamestate
call. - Game states are retrieved everytime user enters username, if an uncompleted game is found, that game is loaded and user can continue play that. Game states are retrieved by making
GET /gamestate
call. - UI has a real time Leaderboard, which uses polling method to update leaderboard every 5 seconds. It is updated by making
GET /leaderboard
call. - Game Instructions can be found in INSTRUCTIONS section.
- Images used for cards are precached when the UI is loaded.
- 5 Cat Cards
- 1 Bomb Card
- 1 Bomb Diffuse Card
- 1 Shuffle Card
- Collect 5 Cat Cards to win the game :D
- If you get a bomb card, you lose :(
- If you get a bomb diffuse card, you can use it to diffuse the bomb card.
- If you get a shuffle card, all your progess is reset, and you have to start over.