Coder Social home page Coder Social logo

guesswhat's Introduction

guesswhat

Application can be accessed at: GuessWhat ###Prerequisites

###Installation

  1. git clone https://github.com/NeenuAVarghese/guesswhat.git
  2. cd guesswhat
  3. npm install

Note: these node modules will be installed via package.json by npm

###Playing

  1. cd guesswhat
  2. npm start OR foreman start OR nf start
  3. Open web browser to http://localhost:3000
  4. Repeat Step 3, for each client

Note: a Procfile is included for foreman or nf

Note: if redis-server and/or node are not in your PATH, then manually run

  • /path/to/redis-server
  • /path/to/node server/server.js

###Testing

  1. Install csslint (CSS validator)
  2. Install jshint (Javascript validator)
  3. Install tidy (HTML validator)
  4. npm test

Note: validate.sh is included with this project for testing

###Debugging Problem: Express will not start if port is already in use.

Option 1: Add a config.json file

{
    "httpPort": 8080
    "redisPort": 7777
}

Option 2: Temporarily change the port number

  1. redis-server
  2. node server/server.js --httpPort <number>

Problem: Redis will not start if port is already in use.

Option 1: Kill the process(es)

  1. lsof -i :6379
  2. kill $(lsof -t -i :6379)

Option 2: Temporarily change the port number

  1. redis-server --port <number>
  2. node server/server.js --redisPort <number>

Problem: Redis DB has junk data

Option 1: Set an environmental variable

export purgeDB=true

Option 2: Use CLI interface

  1. redis-server
  2. redis-cli flushdb

Problem: API for socket.io has changed

Option 1: Print all properties of object "guesswhat"

console.log("====> DEBUG", Object.getOwnPropertyNames(guesswhat));

Option 2: Enable verbose debugging in nodejs

DEBUG=socket.io-parser node server/server.js

Client-side libraries

###Licensing Copyright © 2016

GuessWhat is dual licensed under the MIT (aka X11) and GPLv2 licenses.

guesswhat's People

Contributors

ammaralee avatar mittman avatar neenuavarghese avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

guesswhat's Issues

To-Do List

Components

  • New name
  • Bootstrap layout
  • HTML5 canvas
  • socket.IO chat
  • countdown timer
  • chat log parsing
  • External dictionary API (onelook.com: npm)

Game logic

  • Pull word/phrase and definition with API
  • 1 player draws
  • Other players guess word/phrase
  • Sanitize input
  • Search chat for correct word/phrase
  • Timer ends each rounds
  • Assign teams (4+ players)

Optional features

  • Hangman score system
  • Save/export drawings
  • 1-player ghost mode (playback drawing)
  • Private rooms
  • So You Think You Can Draw reverse game mode (1 player guesses; other players draw)

Closing hint modal prevents starting a new game

Steps to reproduce:

  1. Login
  2. Click let's start the fun
  3. Close the modal before clicking start
  4. Unable to start a new game (until another player has started and ended a game in that room)

When closing the modal, it should .show() the button again

Sanitize user comments

Problem: in the chat type:
<script>alert("XSS")</script>;

Solution: remove tags from user input

Cannot login again

Clicking "logout" or closing the tab, the same username cannot be used again until server restarted. This is because it is still in the map.

Delayed active user list

user1 logs in, name shows up in active users
user2 logs in, only user1 name shows up
user3 logins, only user1 and user2 names show up

Auto-scroll wonky

It was working before but now it's scrolling "up" instead of "down"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.