What Technologies and Framework isused( developed on Ubuntu machine )
- nodeJS 4.4 as backend server. [install]
- rabbitMQ for queuing server. [install]
- Mongodb as data store. [install]
- Materializecss as front-end CSS framework.
- AngularJS as frontend javascript framework.
- SailsJS applications framework.
- Git (for pulling from repo).
Install nodeJS(4.4)
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs
Install RabbitMQ
Using rabbitmq.com APT Repository. see here
-
Execute the following command to add the APT repository to your /etc/apt/sources.list.d:
-
echo 'deb http://www.rabbitmq.com/debian/ testing main' | sudo tee /etc/apt/sources.list.d/rabbitmq.list
-
(Please note that the word testing in this line refers to the state of our release of RabbitMQ, not any particular Debian distribution. You can use it with Debian stable, testing or unstable, as well as with Ubuntu. We describe the release as "testing" to emphasise that we release somewhat frequently.)
-
(optional) To avoid warnings about unsigned packages, add our public key to your trusted key list using apt-key(8):
-
wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | sudo apt-key add -
-
Our public signing key is also available from Bintray.
-
Run the following command to update the package list:
-
sudo apt-get update
-
Install rabbitmq-server package:
-
sudo apt-get install rabbitmq-server
Start rabbitMQ-server by this: sudo service rabbitmq-server start
Install MongoDB
After installing mongo do the following.
- sudo mkdir -p /data/db
- Start mongod in master mode
- sudo mongod --master --fork --logpath /var/log/mongodb.log
All applications which were required are installed.
In terminal fire the following comands
- git clone https://github.com/vkstack/notificationSystem.git
- cd notificationSystem
- mongorestore dump
- npm install
- **(**Make sure mongodb & rabbitMQ server is running.)
- node app.js
Now got to localhost:1337 in the browser.
You can create user by signing up.Or you can login with following users:
Usernames Password
vajahat admin (Only this is admin user.This will be notified for every single change. Rest are normal users they will subscribe for collection or documents)
jack normal
jim normal
bob normal
tim normal
Update notifications is enabled only on news collection.
insert /update/delete notifications in news channel is rendered in raw json format on the notification panel.
- https://www.compose.io/articles/node-js-and-mongo-oplog-elegant-oplog-consumption/
- https://www.compose.io/articles/the-mongodb-oplog-and-node-js/
- Notification technique from (This was very challenging and interesting task)
- http://stackoverflow.com/questions/1086380/how-does-facebook-gmail-send-the-real-time-notification
- RabbitMQ help http://stackoverflow.com/questions/37695995/remove-a-consumer-in-rabbitmq-with-nodejs