Want to develop real-time web project to boost your users' productivity? use realnode.io A Node.js wrapper to access your traditional MySql Database at real time, sync your data between multiple users at real time, no need of refresh, no need of AJAX.( good for web based real time projects).
A step by step guide to use realnode.io>>>
step 1: first you need to install all following node modules.
->express
->socket.io
->mySql
->http (if not installed)
step 2: include server-app.js file in your project root directory. It will handle all the server - side processes.
step 3:include client-app.js file in public folder in your project.It will handle all the functions used to fetch the data and easily bound with UI.
step 4:Configure your mysql database connection using initMysql() function, port numbers, and request handlers in server-app.js
client-app.js contains 4 functions.
1.fetchData(socket,data,callbackFunction):
Used to fetch latest data from your database.
- socket object used to emit the events.
- data is a JSON object with 2 required properties:
1.selectQuery-> Select query to fetch latest data.
2.isBroadcast-> Boolean value.
-> set true = to broadcast the fetched data.(sends data to all connected users.)
-> set false = to share the fetched data only with single user.(user who performed the action will receive the data, not others). - callbackFunction() specifies callBack Function called when fetchData() compeltes its job.
- data is a JSON object with 2 required properties.
1.sqlQuery-> Your insert query.
2.selectQuery-> Select query to fetch latest data.
- data is a JSON object with 2 required properties.
1.sqlQuery-> Your update query.
2.selectQuery-> Select query to fetch latest data.
- data is a JSON object with 2 required properties.
1.sqlQuery-> Your delete query.
2.selectQuery-> Select query to fetch latest data.
This is initial release of realnode.io, future updates will make it more efficient.