Skip to content

jquagliatini/angular-chat-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Angular chat socket.io server

This server uses the socket.io library to create a websocket server. Basically it sends messages with object to specific clients.

Installation process

Using yarn

$ yarn install

Using npm

$ npm install

Testing

A unique test is provided as example of possible workflow. Running npm test should launch the test suite.

Pros & Cons of the solution

Pros

  • Easily/quickly installed and coded
  • Good official documentation with examples
  • Lots of example on the internet

Cons

  • Quality of code and maintainability (callback hell)
  • Does not use Promises/A+ (possible woraround socket.io-as-promised)

Scalability

Using redis it is possible to easily scale the application. The socket.io-redis module is an adapter allowing to save every message into redis. In order to do this, only two lines are required to be added

...
const io = require('socket.io')(server);
const redis = require('socket.io-redis');

io.adapter(redis({ host: 'localhost', port: 6379 }));
...

Other projects exists like [socket.io-cluster][npm-socket.io-custer].

A complete scalable chat app using this workflow can be found on github

About

The angular-chat server repo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published