github activity:

Philipp Tkachev
Software Developer
about me
Avatar

RuLiQ is LiveRecord now

I'm glad to announce that project has been evolved in something bigger that just a chat. Learn more.

Web-chat, written on Node.js. Based on WebSockets. Used socket.io for message exchange, MongoDB to store chatlogs.

Features

  • Personal messages
  • Typing notification
  • Saving public messages into database
  • Rendering of chatlogs
  • Protection against explicit content
  • Basic Spam protection
  • Full support of Russian language
  • Awesome hacker style dark design

Live version is available at http://www.linuxquestions.ru/

Plans

  • Suppport of multiple languages
  • Room support

How to run the chat

To run chat locally, setup environment variable MONGODB_CHAT_AUTH to provide connection to MongoDB. For example:

export MONGODB_CHAT_AUTH='mongodb://login:password@localhost:27017/chat'

Run the node app

cd node
nodejs app.js

And open in browser url http://localhost:3000/.

If you want to setup chat on server I recommend you to install it with nginx as reverse proxy.

There is an example of nginx config for chat, which is runned on linuxquestions.ru domain.

This file is located in /etc/nginx/servers-available/www.linuxquestions.ru.conf and have symbolic link in the servers-active dir.

# defining upstream server for Node.js
upstream app_linuxquestions {
	server 127.0.0.1:3000;
}

# server config
server {

	# path to public part of your app
	root /var/www/linuxquestions.ru/ruliq/public;

	# this is not mandatory, tells what of found files should be served first
	index index.php index.htm;

	# domains
	server_name www.linuxquestions.ru linuxquestions.ru;

	# automatic redirect to www.linuxquestions.ru from linuxquestions.ru
	if ($host !~* ^www\.linuxquestions\.ru$ ) {
		rewrite ^(.*)$ http://www.linuxquestions.ru$1 permanent;
	}

	# serve client scripts using nginx
	location /dist/ {
		root /var/www/linuxquestions.ru/ruliq/node/node_modules/socket.io/node_modules/socket.io-client;
	}

	# setup root for static files
	location /static/ {
		root /var/www/linuxquestions.ru/ruliq/public;
	}

	# proxify requests to node.js app
	location / {
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header Host $http_host;
		proxy_set_header X-NginX-Proxy true;
		proxy_pass http://app_linuxquestions/;
		proxy_redirect off;
		proxy_http_version 1.1;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection "upgrade";
	}
}

To provide start/stop service I created an init.d script. You must setup MONGODB_CHAT_AUTH variable in that script.

GitHub

Comments:

You can left first comment.

For commenting you should proceed to enter or register on the site.

Poll

poll title

Social Sharing: