项目作者: hasanmansur

项目描述 :
Horizontally scalable Real-time Chat using Node.js + Express.js + SocketIO + Redis
高级语言: JavaScript
项目地址: git://github.com/hasanmansur/BuddyTalk.git
创建时间: 2016-06-13T20:52:09Z
项目社区:https://github.com/hasanmansur/BuddyTalk

开源协议:MIT License

下载


BuddyTalk

Real-time Chat example using Node.js + Express.js + SocketIO + Redis

What?

This example demonstrates a real time horizontally scalable chat application capable of serving concurrent clients.
We are using the following components to build our chat app:

  • Node.js
  • Express.js
  • Socket.io
  • Redis

Features

  • Messaging: Private, Group/Room, Broadcast
  • Room: Create/Join/Leave
  • Dashboard:
    1. - Loggedin Nick
    2. - Message Board
    3. - Log of join/leave (both global & room)
    4. - List of loggedin users
    5. - List of Rooms
  • Horizontal Scalability: Can be scaled out (add more node.js/socket.io servers when you need to serve more clients)

* To make the example simple, features like unique nick validation, unique room name validation & others have been kept out of the
project scope. UI is also a minimalistic one for which I owe thanks to [Ahmad Sharif] (https://github.com/theahmadsharif) for giving some of his valuable minutes!

Install & Run

  • Prerequisites:
    1. - Node.js
    2. - Redis
  • Clone the Repository
    1. - git clone https://github.com/hasanmansur/BuddyTalk.git
  • Run the Redis server with the following commands:
    1. - cd /path/to/redis/directory
    2. - ./src/redis-server
  • Run socketIO server with the following commands:
    1. - cd /path/to/BuddyTalk/directory
    2. - node index.js
  • Open client by entering http://localhost:3000

Oops!!! thts all..by now you should get a form to give your nick :-)

* For running multiple socketIO servers you might give the following command:

  • PORT=3000 node index.js
  • PORT=3001 node index.js
  • PORT=3002 node index.js & so on…