My idea was to create a singleplayer version of Colors Clash (naming in progress), a multiplayer game using socket.io which I developed this summer.
For that, outside the scope of the test, I updated the game's api to include authentification with JWT tokens and store the credentials in a MongoDB database, along with adding the logic for the singleplayer version of the game. The endpoints I wanted to use for the test are:
- POST /auth (public)
- POST /users/create (public)
- GET /challenges (protected)
- GET /challegnes/:id (protected)
Afterwards, using a top-down approach of how I wanted the game to look and work, I sketched a design.
This enabled me to get a better overall picture of what I'm planning to build and prepare accordingly. Following a bottom-up approach, I created a small Scrum board for the poject to better visualize, prioritize and manage the tasks.
This is how the Scrum board looked when I started working on the test and the below picture resembles what I was able to do in 3 hours.
username: raffle
password: raffletest
It is also possible to register new users (minimum password length is 6). The passwords are hashed before stored in the database, so you can rest assured I'm not planning any hacking.
- create-react-app - React boilerplate
- tailwindcss - Styling
- @reach/router - Routing
- react-redux - State management
- axios - HTTP client
As I had some free time and I couldn't just leave the game in that state without making it at least palyable, I created the extra branch which contains the code for the playable version.
There's also a live version hosted on Netlify available at this link.