RPS
React.js
Redux
Socket.io
Node.js
Typescript
Express

About The Project

RPS uses the socket.io library to implement websockets and provide a realtime multiplayer rock papers scissors experience. Users can create or enter a room using a generated room code and play against each other in private lobbies.

Tech Stack Considerations

The biggest concern coming into this project was how to support a multiplayer experience. I knew I would have to use websockets to accomplish this, and there were really 3 routes I could have taken.

  1. Socket.io
  2. Sock.js
  3. Firebase Real Time Database (RTD)
Sock.js: A purely websocket implementation and does not have fallbacks in case a client's browser does not support websockets.   Firebase RTD: A websocket wrapped cloud database. Means any data handling would have to be done client side. I personally had security and perfomance concerns about doing this. Mainly because all of the game logic and the database itself would be exposed to the public web. Additionally, since the game logic would be part of the client's package, this would cause a larger than needed package and slowed performance.   Socket.io: I chose to go with socket.io because it doesn't require client side processing like Firebase RTD and on top of that, socket.io supports http long polling in case a browser does not support websockets. This meant I had to set up my own express server and host it on Heroku, but the performance and security boons were worth the extra effort.