Inspired by The Big Bang Theoryโs twist on Rock-Paper-Scissors ๐
- Frontend: React with TypeScript
- Backend: Node.js with Express
- Play Rock-Paper-Scissors-Lizard-Spock against a computer opponent
- See the results of the 10 recent games on the scoreboard
- Reset the scoreboard if desired
- Get motivational messages when losing or on a win streak
- The app supports desktop, tablet & mobile resolutions
- ๐ชจ Rock crushes Lizard & Scissors
- ๐ Paper covers Rock & disproves Spock
- โ๏ธ Scissors cuts Paper & decapitates Lizard
- ๐ฆ Lizard poisons Spock & eats Paper
- ๐ Spock smashes Scissors & vaporizes Rock
| Tablet | Mobile |
|---|---|
![]() |
![]() |
- Overall approach: tried to use a minimum of additional libraries
- A 4-pixel grid was used for the UI design
- Scoreboard data is stored in local storage
- To calculate the random choice of the computer was used
https://codechallenge.boohma.com/randomendpoint - There is the
/choiceendpoint, but it's not used on frontend
- Docker & Docker Compose
- Make sure nothing is running on ports
3000and5173
docker-compose up --build
The frontend runs by default on http://localhost:5173. The backend runs by default on http://localhost:3000.
- Node.js (>= 24.x)
- npm
cd backend
npm install
npm run dev
The backend runs by default on http://localhost:3000.
cd frontend
npm install
npm run dev
The frontend runs by default on http://localhost:5173.
| Method | Endpoint | Description |
|---|---|---|
| GET | /choices |
Get a list of player's options |
| GET | /choice |
Get a randomly generated choice |
| POST | /play |
Submit a move and get result |
Example Messages
/choices example Response:
[
{
"id": 1,
"name": "rock"
},
{
"id": 2,
"name": "paper"
},
{
"id": 3,
"name": "scissors"
},
{
"id": 4,
"name": "lizard"
},
{
"id": 5,
"name": "spock"
}
]
/choice example Response:
{
"id": 5,
"name": "spock"
}
/play example Payload:
{
"player": 1
}
/play example Response
{
"player": "1",
"computer": "2",
"results": "lose"
}


