This is a project example of the game "Rock Paper Scissors" built with React.js & Django.
The game includes the following options:
- Live-game play mode using websockets
- Play against the computer
Demo - Click to Play - https://emoji-rock-paper-scissors.herokuapp.com
Clone this repo and install it on your local machince
In the root folder, open your command line terminal. Follow the following command
Frontend
To get this project up and running start by having Node.Js installed on your computer and terminal opened at the projects root directory. Then go to the frontend folder with
cd frontend
Install the project node modules and frontend project dependencies with
npm install
Now you can run the project's frontend with the following command
npm start
Backend
Go back to the project root directory. Then go to the backed folder with the following command.
cd backend
Make sure you have Python installed on your computer. It's advised you create a virtual environment to store your projects dependencies separately. You can install virtualenv with
pip install virtualenv
Run the following command in the base directory of this project
virtualenv venv
That will create a new folder venv
in your project directory. Next activate it with this command on mac/linux:
source env/bin/active
Then install the project dependencies with
pip install -r requirements.txt
Now you can run the backend with this command
python manage.py runserver
After the backend and frontend have been set up. You can open the project at http://localhost:3000 and play the game as normal.
Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.
The page will reload when you make changes.
You may also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Issues
Please note that the live-game player mode still need to be further developed and has a few bugs which needs to resolved.