FastTyper is a multi-player speed typing game, where users type a paragraph or text, and are ranked according to their WPM (Word Per Minute).
Since we are using React for front-end, and Express, PostGreSQL, WebSockets in the back-end. One has to setup 2 servers locally. Follow these steps to set up:
- Get the files either from
git cloneor manually downloading files
-
For Front End, go to
/front-enddirectory, and runnpm install, to download all the local dependencies, on your local machine. -
Create a
.envfile in the same directory. It should look like this:REACT_APP_HOST="" <insert your value here> CLIENT_SIDE="" <insert your value here>where
REACT_APP_HOSTis the link where your back-end server is hosted. For local development it can something like"http://localhost:<express port number>"and
CLIENT_SIDEis the link for your client (front-end). For local development it can be something like"http://localhost:<react port number>" -
After setting up, run
npm startto start the client server.
-
Install PostgreSQL
-
Go to
/back-enddirectory, and runnpm installto download all the dependencies locally, on your machine. -
Create a
.envfile in the same directory, it should look something like this:PORT=<express port> CLIENT_ID=<google oauth client id> CLIENT_SECRET=<google oauth client secret> DB=<postgres db name> DB_USER=<postgres db username> DB_PASS=<postgres db password> SESSION_SECRET=<session secret> WEBSITE="<client-link>"where
WEBSITEis the link for client side, for locally development, it can be something like"http://localhost:<react port number>".For getting
CLIENT_IDandCLIENT_SECRET, go here -
After installation, run
npm run devto start a local server.
Now you are good to go.
If you face any issues while setting up, feel free to contact me :)
NOTE - Currently its not hosted anywhere, so one has to set it up locally on their machine.