Node js and socket io - appointment system [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I'm building pretty simple appointment system with node js, js and sql.
im getting the data: name, hour, day -> store it in sql (sending sms to the client) and edit the day and hour in the sql so it will not show it on the website.
everything is working well.
now i want that when some user made appointment it will show to other users that this hour in this day is not available (right now it is happening but the other users should refresh the page to see the update).
i think socket io can help me here.
i read all the documentation and its all about chat rooms.. before i get my hands dirty with socket io and trying to modify it, i want to ask for help . do you think it is possible to do it? and if yes what is the best way for your opinion.
thanks in advance

Yes. You definitely can use WebSocket API (or any library built on top of it, e.g. Socket.io) to update a client's webpage without it having to refresh the page.
You could simply emit an event from your NodeJS application on receiving an an appointment request and handle the event's payload at the client's end to update the webpage.

Related

How to connect html page to Marklogic Database using javascript? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am newbie to web designing. Here I am trying to develop a web page where it prompts for username and password and when I click on button, this html has to make connection with these username and password values entered by user to Marklogic database . Could anyone please help how to do this? Is it through Javascript or PHP? If so please advise where can I find step by step explanation of this process ? Also it is okay if I get procedure for any NOSQL database.
OK. Your statement is a bit big and broad.. I decided to extract the most relevant concepts:
Sample Application including authentication
MarkLogic
Javascript or PHP
Therefore, I suggest looking at a reference framework using all javascript:
http://www.marklogic.com/what-is-marklogic/whats-new/samplestack/
This can have a node.js middle tier in node.js and does not require java.
It is a big step forward and (sort of) complex, but it is a complete example.
If it is too much for what you are looking for, then I suggest you research more specifically what you need in these two specific items in MarkLogic documents:
HTTP Server (where you can run your HTML/CSS/Javascript from)
REST API (for which you can use against your js code)
This is a 2-tier approach where your application(HTTP) server is serving both your HTTP site as well s the default REST enpoints.

What can I do to create an always-live HTML page? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have been searching across the Web to find a solution to this:
Basically what I want to setup is a way to have an HTML page on a live production site to kept updated. This is because I have setup a SilverStripe Application as part of a graphics system (green chroma key) that runs through normal HTML.
AJAX load doesn't seem to be an option here since the load would be every 1 second or half a second to make sure the page is live.
I looked into web socket quite vaguely but the whole concept of integrating it with my project confused me entirely.
Anyone got any ideas of what could be done?
To do this you'll need a combination of:
AJAX, you'll need to never do a full page load after the initial Web 1.0 request.
Session history management, you'll need this in order to not break the browser navigation (e.g. back/forward buttons).
Web Sockets, you'll need this so when new content arrives on the server it is received by the client without first having to poll the server.
Web sockets will be the greatest challenge. I listed them in the order in which you should approach the project, in three phases.

Real time notification in PHP [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am creating a PHP application, where I want one user make a database entry. It should be reflected to all the users whoever have this app open on their browser will get instant notification that some data has been updated on the database or with whatever data has been inserted.
Is there any way I can get real time notification of data inserted or updated? On all the opened browser without any delay.
We use AJAX for now. But it seems like our application is now working slow due to continues request. Any other way? Which is free.
Thank you!
Take a look at Pusher (https://pusher.com/). It does what you want to achieve and it works like a charm.
I don't know what do you use on your server side but even if it isn't Laravel, take a look at Jeffrey's Laracast about implementing real time notifications in Laravel (PHP). https://laracasts.com/lessons/pusher-awesomeness
Have a fun! When I did it, my app became extremely sexy. Real time notifications, DOM manipulations etc.
You can use web sockets. One existing library example for PHP is Ratchet.

Live update message system using php js msyql [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Okay guys, I'm trying to integrate a facebook-like messaging system into my web application. I can't post the link unfortunately because it requires login.
I have the database with a conversation table, a messages table, and the html page which calls all the messages based on the given conversation id. I also have a text area and submit button for sending a new message and adding it to the database.
Now I've heard two different methods..
That I should have javascript check for updates every second or so to see new messages, and update with ajax. Would this put too much strain on a server?
or.
To use a frame work like node.js. This method makes very little sense to me as I really don't understand requests very well.
So stack overflow, which method (or neither) would be the best way to implement this?
Polling is resource-heavy. You should consider something like WebSockets.
With WebSockets, you basically will have the client chat user apps subscribe the to the WebSocket, and then the back end server application would notify them when they should check for updates, or just push the new message updates out to them right over the WebSocket connection.
Here is a demo chat application you can look at. Here's the WebSocket website.

Passing data from one element to another on the same html page [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Hi I am trying to develop a mobile app. The problem I am having is this, when the user fills in a form on the html page I want the data to get written to an unordered list on the same page. I want when the next user fills data for that dat to get written to the second list item in the list and so on
.
Thanks in advance for any help you may be able to give with this problem
If I understood correctly, you're trying to make an app that stores the data of each submitting of the forum and returns them to all users that come across the page?
For such tasks you'll need, at least:
A web server that runs PHP, Python or other language to your liking*;
A database to connect the server-side with (MySQL or PostgreSQL usually);
What you need to do:
Learn about HTTP POST and basic SQL input/output if you haven't;
Learn AJAX if you haven't;
Store the user input in the database and have a server script retrieve it on call;
Update the dynamic page bit (the unordered list) with AJAX (loading a XML file with the PHP script that writes the database info into it should do) every minute or so using a timeout function.
I'll post links to all I've mentioned in a minute.
*NodeJS is getting popular for being asynchronous (making it easier for dynamic pages to interact with the server) and allowing programmers to use the same language client- and server-side, but I have never tried it to tell you how it fares. Edit: says John NaN: NodeJS is not recommended. Again, I don't know it myself; that is why it's on a note and not upper in the post. Good luck!
*Bonus note: don't trust W3Schools most of the time. The AJAX tutorial I linked to, however, isn't that bad and it's easy to follow.

Categories

Resources