Whoochat is a chatroulette-like service that uses geolocation to connect users geographically close.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
static
test
.env
.gitignore
.gitmodules
Procfile
README.md
package.json
web.js

README.md

Whoochat

Whoochat is a chatroulette-like service that uses geolocation to connect users geographically close.

The server is built with Node.js and Socket.IO and it does not store anything.

The client is realized with Backbone.js and it has been kindly designed in 5 minutes by Enzo Li Volti.

Try it

A demo is available at whoochat.herokuapp.com :

screen

Installation & run

To Install :

git clone http://github.com/mariorossano/whoochat.git whoochat

cd whoochat

npm install

git submodule init
git submodule update

To Run :

node web.js

Then open http://127.0.0.1:3000 in a browser.

Custom client

If you want to create your own client, you may reuse the models and controllers supplied; you can find a simple example in the folder static/example :

//random nick
var usersName = ['Mario', 'John', 'Enzo', 'Robert', 'David', 'Frank', 'Daniel'];
var nick = usersName[Math.floor(Math.random() * usersName.length)];

//gps
app.coords = {'latitude' : 45, 'longitude' : 45};

//user 
var userController =  app.UserController;

//logged in
userController.on('loggedIn', function(){
    console.log('logged in');
    userController.requestPair();
});

//partner available
userController.on('paired', function(partner){
    console.log('paired');
    messages.create({'text' : 'Hello ' + partner.nick +', my name is ' + nick}); 
});

//partner lost 
userController.on('unpaired', function(){
    console.log('partner lost');
});

//messages
var messages = new app.MessagesCollection();

//new message
messages.on('add', function(message){
    if(!message.get('owner')){
        console.log('text received : ' , message.get('text'));
    }else{
        console.log('text sended : ' , message.get('text'));
    }
});

//login
userController.login({'nick':nick});

//logout
$('#logout').click(function(){
    userController.logout();
});

//request a new partner
$('#next-partner').click(function(){
    userController.requestPair();
});

Protocol

See the test in test/server.js:

test