A RethinkDB chat server with NodeJS Hapi framework.
The idea is to demonstrate how to to build a real time chat server with RethinkDB, HapiJS(NodeJS) and socket.io .
- Create a rethinkDB database named 'rethinkchat' (If you don't have RethinkDB installed, you can follow these instructions to get it up and running.)
- Clone the project from git.
- Go to 'rethink-node-chat-server' directory (
cd rethink-node-chat-server
). - Run
yarn
ornpm install
. - If you have different database configurations then you can change the index.js file under ./src/config directory and config.js file under ./rethinkdb-config directory.
- Run
npm run initapp
to populate database with dummy data (windows users should replace initapp script withSET NODE_ENV=development & node scripts/init-dev.js
in package.json file). - Run
npm start
to start the server.
API server will start at 'http://localhost:3030' and chat server(socket) will start at 'http://localhost:5000' but you will have to configure the chat client app at 'https://github.com/arman37/rethink-node-chat-client' to see how the API & Socket work.
If you like the project, shoot a 🌟 and feel free to fork & send PR anytime.