Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mondediefr/mondedie-chat
Node.js chat application using Express, Socket.io, Redis and Mithril
https://github.com/mondediefr/mondedie-chat
chat flarum mondedie mondediefr
Last synced: about 1 month ago
JSON representation
Node.js chat application using Express, Socket.io, Redis and Mithril
- Host: GitHub
- URL: https://github.com/mondediefr/mondedie-chat
- Owner: mondediefr
- License: apache-2.0
- Archived: true
- Created: 2015-11-02T20:05:03.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-06-22T12:26:38.000Z (over 6 years ago)
- Last Synced: 2024-08-14T10:14:06.070Z (5 months ago)
- Topics: chat, flarum, mondedie, mondediefr
- Language: JavaScript
- Homepage: https://chat.mondedie.fr
- Size: 677 KB
- Stars: 40
- Watchers: 8
- Forks: 10
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Mondedie-chat
Node.js chat application using Express, Socket.io, Redis and Mithril.
## Features
- 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)## Screenshot
![screenshot](https://images.mondedie.fr/p1fy7flP/KlbD6rL5.png "screenshot")
![screenshot responsive](https://images.mondedie.fr/SMdzJAdJ/cJ3wt7lL.png "screenshot responsive")
---
## Authentication method
See Flarum documentation : http://flarum.org/docs/api/
---
## Environment variables
| Variable | Description | Type | Default value |
| -------- | ----------- | ---- | ------------- |
| **ENV** | Environment | *optional* | development
| **PORT** | Port app | *optional* | 5000
| **FLARUM_API_ENDPOINT** | API URL | **required** | none
| **COOKIES_SECRET** | Set random cookies secret | **required** | none
| **SESSION_SECRET** | Set random session secret | **required** | none
| **REDIS_URL** | Redis instance ip/hostname | **required** | none
| **PIWIK_ID** | Piwik id | *optional* | none
| **PIWIK_URL** | Piwik url | *optional* | none---
## Manual installation (Production)
### Requirements:
* Node.js
* Yarn
* RedisClone the project and install dependencies :
```bash
git clone https://github.com/mondediefr/mondedie-chat.git
cd mondedie-chatyarn global add bower gulp pm2
yarn installgulp
```Create .env file in project root with this content :
```
ENV=production
COOKIES_SECRET=xxxxxxxxxxx
SESSION_SECRET=yyyyyyyyyyy
FLARUM_API_ENDPOINT=http://domain.tld/api/
```Start application :
```bash
pm2 start --node-args="--harmony" --name mondedie-chat app.js
```Open app : http://127.0.0.1:5000/
---
## Manual installation (Developement)
### Requirements:
* Node.js
* Yarn
* RedisClone the project and install dependencies :
```bash
git clone https://github.com/mondediefr/mondedie-chat.git
cd mondedie-chatyarn global add -g bower gulp nodemon
yarn installgulp
```Create .env file in project root with this content :
```
ENV=development
COOKIES_SECRET=xxxxxxxxxxx
SESSION_SECRET=yyyyyyyyyyy
FLARUM_API_ENDPOINT=http://domain.tld/api/
```Create Procfile_dev file in project root with this content :
```
web: nodemon --delay 1 --exec "node --harmony" app.js
worker: gulp watch
```Start application :
```bash
foreman start -f Procfile_dev
```Open app : http://127.0.0.1:5000/
---
## Docker installation
### Pull image
```bash
docker pull mondedie/mondedie-chat
```### Image usage
#### Environment variables
Set environment variables in [docker-compose.yml](https://github.com/mondediefr/mondedie-chat/blob/master/docker-compose.yml)
* ENV=production
* FLARUM_API_ENDPOINT=http://your-domain.tld/api/
* COOKIES_SECRET=PLEASE_REPLACE_BY_RANDOM_VALUE
* SESSION_SECRET=PLEASE_REPLACE_BY_RANDOM_VALUE
* REDIS_URL=redis://redis:6379#### Requirements:
* Docker
#### Setup
We have created a [docker-compose.yml](https://github.com/mondediefr/mondedie-chat/blob/master/docker-compose.yml) including 3 containers :
* chat
* redis
* nginx : reverse-proxy modeCreate a new nginx vhost with this content :
```nginx
# /mnt/docker/nginx/sites-enabled/chat.confserver {
listen 8000;
server_name chat.domain.tld;location / {
proxy_pass http://chat:5000;
# For websockets handshake to establish the upgraded connection
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}}
```Run !
```bash
docker-compose up -d
```---
## Development Docker installation
#### Requirements:
* Docker
* Node.js
* Gulp
* npm#### Set environment variables
```bash
sudo echo '127.0.0.1 mondedie-chat.dev' >> /etc/hosts
echo 'export FLARUM_API_ENDPOINT="http://your-domain.tld/api/"' >> ~/.bash_profile
```#### Setup
```bash
cd /path/to/chat/mondedie-chat
npm install
docker-compose --file dev.yml up -d
gulp watch
```
Open app : http://mondedie-chat.dev:5000/---
## Roadmap
- Private rooms
- Unit tests + coverage
- Build an API
- Increase chatbot IQ## Contribute
- 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](https://github.com/mondediefr/mondedie-chat/issues) for any questions## Support
https://github.com/mondediefr/mondedie-chat/issues
## License
Apache License Version 2.0
## Contact
- [[email protected]](mailto:[email protected])
- [https://twitter.com/mondediefr](https://twitter.com/mondediefr)