Make sure you have node.js and NPM installed.
Set your terminal to this directory.
// use npm to install all the required modules
npm install
// run the server
node server.js
POST /api/pm
Pass in the originating user, the to users, and the messsage body
{
user: $.cookie('user_id'), // string
toUsers: users, // array of user_ids
body: $('textarea').val(), // string
}
GET /api/notification/:user_id
Pass in the user_id id
GET /api/notification/:user_id/unread
Pass in the user_id id
GET /api/notification/:user_id/read
Pass in the user_id id
POST /api/notification/read/:notificationID
Pass in the notification id
POST /api/notification/read/:notificationID
Pass in the notification id
POST /api/notification
Send an object with the users and the message in this format:
{
toUsers: ['user1', 'user2'], // array of user_ids
msg: {
type: "pm", // type of notification, would be useful for when you have need for multiple types of notifications in the future.
body: "Good Morning", // String, text of the message
title: "You got a personal message from " + content.user // String, text of the message
}
}
This end point is not used in this demo. It's for future integration.
Load the css and javascript that's in the layout.jade
file. For the script to work there needs to be some HTML endpoints. Check the HTML in the index.jade file and copy everything inside #loginMenu
If you're confused by the jade templating language and need help converting to HTML use this: http://html2jade.com/
-> Notification system administrator panel -> Publish system using node.js -> Rest api to publish messges (format -> message , user_id) via php -> Frontend UI ( where notification appear real time and also facebook like notification drop down ) -> Create sample of 10 users for demonstration purpose -> Real time notification should appear also as dialog (right end corner) -> Provision for read and unread notification -> Documentation of how to install -> User interface code snapshot which we will use to integrate to your user interface for real time notification