Question: Hello please answer the question correctly and please provide all the nesessary things required by the assignment epescially showing the code and that it works
Hello please answer the question correctly and please provide all the nesessary things required by the assignment epescially showing the code and that it works and runs. Also, this assignment is very serious and it requires an expert knowledge of JAVA SCRIPTand using node. If you dont know how to write in java script please dont answer the question and just let it time out.
Application Requirements
Background
For this assignment we want you to come up with a small app that allows collaboration between, or among, more than one browser client at the same time running on different machines. You can decide what is does but it needs to satisfy the stated requirements.
We will, for the sake of discussion, refer to an imaginary air hockey game to help explain certain requirements but your app does not have to resemble it, or even be a game. It will however need to have some motion in the window.
For this assignment we want you to build a client server single page app that will allow several browser clients to collaborate on some task. This could be playing a game, or working on a "white board" or whatever. By collaborative we mean that what one person does on their web browser others will see on theirs in real-time.
For example, imagine an air hockey game in which one person -with their browser and mouse or keyboard controls one paddle while the other person on their browser controls the opposing one. The air hockey puck would presumably bounce off the walls and the players would be trying to knock the puck with their paddle to score points.
As another example imagine a group of people collaborating, or brainstorming, on a white board moving images or words around. When one person moves things in their browser others should see the same thing happening in real-time on theirs. Users however should not be able to control the same item at once. This would cause confusion and your app will have to prevent this.
Finally another classic collaborative app would be a chat session but this assignment requires that there be some motion involved.
Demo Code: We will be posting an example of a polling-based collaborative app (Asynchronous Collaboration based on Polling) and an example based on web sockets (Basic Chat Collaboration with WebSockets) in the course notes. These might be helpful as a starting point.
1) Server-Side Requirements
R1.1) The server code should use only javascript and node.js and may use npm modules but not express.js or other high level framework. Intended npm modules include "connect" or "websocket" Note this assignment is doable without any additional modules beyond assignment #1, and the one you are required to write.
R1.2) Your server should make use of at a least one module of your own creation. That is, a module that you write in javascript and then "require" in the main app code. This module will be hosted locally and not via the npm registry.
R1.3) The server-side and client-side javascript should keep track of who has permission to move what items in the client view. For example the server should know what can be moved and who is assigned to control it. The server should enforce that items not get moved by users who have not been assigned control of the items. The idea here is to not allow a "free for all" with users tugging at the same item. (Note this app can be done entirely in the main memory of the server. This assignment does not require that your read and write any files or use a database.)
R1.4) Server should be hosted on port 3000 and reachable from a browser on the same machine or other machines. The initial launch of the web app should be the result of the client making a request to http://localhost:3000/assignment2.html.
R1.5) More than one web browser should be able to connect to the server at the same time. Access should be possible from multiple computers.
2) Client-Server Data Exchange
R2.1) The exchange data between client and server should be in the form of JSON object strings. (The initial launch of the client web page will just be the result of a GET request for a static file.)
3) Client Requirements
R3.1) When the app first launches the client should see the environment of the app. In the case of an air hockey game it would be the playing surface, the paddles, perhaps the puck. The player should not initially be able to move anything in the app environment.
R3.2) To be allowed to control items a user must register, or sign in, or request control of a certain item. This could be done by the user typing their name and some indication of what they want to control as appropriate for your app.
R3.3) The app should have certain things that a user can move either with the mouse or keyboard strokes. To move an item, however, the user must first be given control of that item or set of items. For example, two air hocket paddles may initially be unclaimed but if a user requests that they "be" one of the paddles the server should allow them to control that paddle, but not the paddle of the opposing player. This might be done as follows. A player might type "red" into a text field and then click "assign" which will assign them to control the red paddle. This could be as simple as the server letting the client javascript know what items that client can move.
R3.4) The app should make it clear visually what items are currently being controlled by users and what items are available for users to request. For example, once a user is assigned to control of an air hockey paddle the appearance of that paddle might change -maybe have their name on it or have a certain colour or look.
R3.5) The client should only be allowed to move the items that the server has assigned them control over. If the client requests other items to control the server might add them, or instead drop control permissions of the previous item. It depends on your situation.
R3.6) If a client, with control premissions, moves an item that motion should appear in real-time accross all browser windows connected to the app. Note we are expecting you will co-ordinate the different clients through the server. This can be based on the clients simply using a timer and polling the server for updated status and locations or it could be based on the server having websocket connections with various clients. The choice is yours. Polling is easier to build but has more message traffic.
R3.7) The app should involve and show motion. That is, items moving around under user control and perhaps some moving around by themselves. If you are building a collaborative "fridge poetry" app the only motion might come from users dragging words around. If it is an air hockey game then the puck is traveling by itself with the players each moving their paddle. Games face a challenge because collisions should appear the same in all browser windows and the motion might create a lot of message traffic. Don' t worry if you motion is more "choppy" than you might have hoped for. We are looking for proof of concept here. If real-time is very important to your app the a web socket solution would likely be better than a polling solution.
4) Documentation Requirements
R4.1) Your app should be accompanied by a short .pdf document containing the items specfied below. (Your document must be in .pdf format).
R4.2) Your document should explain what the app is intended to do or what service it provides the users.
R4.3) Your document should tell the evaluator how to launch and run it.
R4.4) Your document should have some screen captures so the evaluator will have an idea what to expect before they launch your app.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
