Question
Node.js/Javascript Collaborative App With this assignment we introduce some new web app elements. 1) We break away from the strict HTTP request-response model and allow
Node.js/Javascript Collaborative AppWith this assignment we introduce some new web app elements.
1) We break away from the strict HTTP request-response model and allow asynchronous communication betweenclient and server using web sockets. This means that the server can send data to a client that is not in directresponse to a request from that client. This makes real-time collaboration (like chat rooms) possible.
2) We introduce the use of external NPM modules to provide web socket capabilities. These allow asynchronouscommunication between client and servers using the world wide web's HTTP protocol.
3) We introduce the design problem of "who is in charge of the data and decision making". It could be the server, aclient, serveral clients. There is no right answer so you will have to make design choices. This is an ongoing designdilemma that you will always face when building web apps.
In this assignment you will build a real-time collaborative app based on web sockets and specifically npm'ssocket.io module (illustrated with demo code in the course notes and in tutorial 05). Since this is meant to be a anapp that allows people working in different browsers to collaborate you might take advantage of the fact that we canhost servers on the OpenStack virtual machines that can be reached by several different machines.
In this assignment you are going build a single page client-server app based primarily on native capabilties ofNode.js, however this time you will use the npm module socket.ioto implement asynchronous real-time dataexchange between client and server. You are also free to import (or more correctly "require") other simple npmmodules from the npm (node package manager) registry. However, the use of Express.js and similar "high level"frameworks is still not allowed for this assignment. This is still primarily a javascript programming exercise and westill want you to build an app based primarily on node.js built in capabilities with a few helper modules.
The components are:
Server build with just Node.js and its build in modules (e.g. http, path, fs, url), and that makes use of the npmsocket.io module. You MAY NOTuse express.js. If you have any doubts about whether you can require a certain npm module please check with me ahead of time.
Client: browser that is provided with a web page from the server consisting of html, css, javascript and jquery. (You can use which ever of these your want.) After what you discovered in tutorial 04 you can strip out all jQuery if you want -the choice is yours.
Assignment Restrictions:
Technology Restrictions: You need to use the npm socket.io modules, other simple modules you might want (but no others are actually needed). You may not use the express.js framework or other higher level frameworks in thisassignment. If in doubt ask about any modules you intend to include.
Step by Step Solution
3.50 Rating (173 Votes )
There are 3 Steps involved in it
Step: 1
First you need to install the socketio module via npm by running the following command in your proje...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started