An open source web game where users play the 20 Questions game online.
1. Features
2. Technologies
3. Project Setup
- Signup
- Login
- Invite a User to Play
- Accept an Invite to Play
- Play the Game
1. Vue.js
2. Vue-CLI
3. Node.js/Express
4. Bootstrap CSS Library
5. Bootstrap-vue - Bootstrap styled components for Vuejs
6. Socket.io - For Real time Communication
7. Fontawesome icons
8. Babel
9. JWT - For Authentication
10. Axios - For HTTP requests
11. MongoDB with Mongoose for Data storage
12. Volleyball - For logging
- In project root, create a
.env
file and copy variables from.env.sample
file into it - Use a different
JWT_SECRET
value in your new.env
file - Create a
.env
file insideclient
folder and copy variables fromclient/.env.sample
file into it
- Run command:
docker-compose up
- Shut down:
docker-compose down
- Build project:
yarn heroku-preinstall && yarn build
- Start app:
yarn start
yarn dev
cd client && yarn serve
cd client && yarn lint
- Relies heavily on cookies, hence app might misbehave when running in incognito mode. This is because it tracks the users' online status. However incognito mode tries to shield you from being tracked online by other users. Best to play without incognito mode on your browser. (Sign out and Login again to fix)
- UI design was done in a rush due to limited time. Could be improved
- Does not persist anything about the game played. In future, game wins will be persisted for ranking users.
- Once a user reloads their browser while playing the game, the game terminates.
- I ensured that the online user list is real time and changes accordingly when a user logs out, login or closes their browser.
- I ensured that when a logged in user opens multiple browser tabs, the online user list remains the same since the new connections are from same user.
- To ensure a user can only play with one online user at a time. A user is required to logout from a previous browser, before they can sign-in to a new one.
- When a user opens multiple game tabs, and then closes those tabs one after the other, the online user list remains unchanged until the last tab is closed, only then it is seen as the user went offline. The user is then removed from online user list
- Once a user starts playing game, sending them invite becomes disabled
- When a user invites a player, all their open game tabs receive the invite.
- When a user logs out, all their open tabs automatically signs out.
- The system prevents the questioner from cheating by ensuring they submit their word before the questions commence!
- When a player starts to play, they are prevented from being able to send new invites to others