Node.js chat application using Express, Socket.io, Redis and Mithril.
- Real-time communication via socket or long-polling
- Using flarum API
- Responsive design
- Private messages
- List of connected users
- Auto-complete usernames, commands and smileys
- Kick/ban
- markdown syntax (with GitHub Flavored Markdown + syntax Highlighting)
- Emoji
- Desktop notifications
- AFK mode
- Poke @user with notification
- Roll dices (+ one special roll)
- User typing hint
- Messages deletion
- Managing network issues
- Work with Chrome, Firefox, IE11/Edge, Opera, Safari
- Smart chatbot (IQ 157)
This chat is hosted on Heroku using free dyno with following add-ons :
- Heroku Redis - Free plan
- Logentries - Free plan
- Deploy Hooks
Redis database is hosted on Amazon EC2.
URL : http://chat.mondedie.fr/
The application sends a HTTP POST request to the API endpoint specified in AUTH_API_ENDPOINT environment variable.
- login (String) : Account username
- password (String) : Account password
AUTH_API_ENDPOINT=http://domain.tld/api/auth
POST /api/auth HTTP/1.1
Host: domain.tld
Content-type: application/x-www-form-urlencoded
login=username&password=password
Your auth API endpoint MUST return this type of json structure :
{
"data": {
"id": "4",
"attributes": {
"username": "Hardware",
"avatarUrl": "http://......."
}
},
"included": {
"attributes": {
"nameSingular": "Administrator",
"namePlural": "Administrators",
"color": "#7cc359"
}
}
}
With HTTP status code of 200 when user is successfully authenticated or 403 otherwise.
data.id
: User IDdata.attributes.username
: User namedata.attributes.avatarUrl
: User avatar URLdata.included.attributes.namePlural
: Group namedata.included.attributes.color
: Group color
vagrant plugin install vagrant-berkshelf
vagrant plugin install vagrant-hostmanager
vagrant up # for installation
vagrant halt # stop vagrant
vagrant up --provision # restart vagrant
Open app : http://mondedie-chat.dev
- Node.js
- NPM
- Redis
Clone the project and install dependencies :
git clone https://github.com/mondediefr/mondedie-chat.git
cd mondedie-chat
npm install -g bower gulp pm2
npm install
gulp
Create .env file in project root with this content :
ENV=development
COOKIES_SECRET=xxxxxxxxxxx
SESSION_SECRET=yyyyyyyyyyy
AUTH_API_ENDPOINT=http://domain.tld/api/auth
Start application :
pm2 start --node-args="--harmony" --name mondedie-chat app.js
Open app : http://127.0.0.1:5000/
- heroku toolbelt : https://toolbelt.heroku.com/
- Node.js
- NPM
- Redis
Clone the project and install dependencies :
git clone https://github.com/mondediefr/mondedie-chat.git
cd mondedie-chat
npm install -g bower gulp nodemon
npm install
gulp
Create .env file in project root with this content :
ENV=development
COOKIES_SECRET=xxxxxxxxxxx
SESSION_SECRET=yyyyyyyyyyy
AUTH_API_ENDPOINT=http://domain.tld/api/auth
Create Procfile_dev file in project root with this content :
web: nodemon --delay 1 --exec "node --harmony" app.js
worker: gulp watch
Start application :
foreman start -f Procfile_dev
Open app : http://127.0.0.1:5000/
- Redis
- http instance for api server
docker build -t mondedie/chat github.com/mondediefr/mondedie-chat.git
- 5000
- ENV=production
- COOKIES_SECRET=xxxxxxxxxxx
- SESSION_SECRET=yyyyyyyyyyy
- AUTH_API_ENDPOINT=http://domain.tld/api/auth
- REDIS_URL=redis://localhost:6379
docker run -d -p 5000:5000 -e COOKIES_SECRET=xxxxxxxxxxx -e SESSION_SECRET=yyyyyyyyyyyy -e AUTH_API_ENDPOINT=http://domain.tld/api/auth.php -e ENV=production -e REDIS_URL=redis://localhost:6379 mondedie/chat
We have created a docker-compose.yml for example with 3 containers :
- chat
- nginx : host your API
- redis
docker-compose up -d
- Ignore a user
- Private rooms
- Unit tests + coverage
- Build an API
- Increase chatbot IQ
- First read CONTRIBUTION.md
- Fork this repository
- Create a new feature branch for a new functionality or bugfix
- Commit your changes
- Push your code and open a new pull request
- Use issues for any questions
https://github.com/mondediefr/mondedie-chat/issues
Apache License Version 2.0