Do we use cron job to get real time data from firebase? - laravel

I am working in laravel. I have setup firebase in my admin panel. I want to display real time data in my admin panel. For example last login of user. Do I need to use cron for that? Is that any way in firebase to implement this?

use socket.io .
Socket.IO is a library that enables real-time, bidirectional and event-based communication between the browser and the server

Related

Laravel best practices listening to JSON data from external API

I have this use case of building an automation tool, that needs to get data from an external API and notify a specific user.
I'm thinking about using a cron job to fetch the API every 2 minutes and triggering an event to notify the user.
Is there any alternative approach, something to listen to an API?

Store serviceAccountKey.json file in third party server

I have an android app which gets its data from firebase realtime database. For updating the realtime database automatically, I've written a python script which crawls data from a website and processes it. Then it sends the data to my firebase realtime database using the admin sdk. I am willing to store and execute the script on my server, so that it is executed automatically twice a day. Is it safe to upload my serviceAccountKey.json along with it? If it is not, then how can I achieve my desired functionality?
Yes, it is fine to store the service account JSON file in your own server. That's the intended use case. Just make sure it's not exposed to users in anyway.

Is it posible to broadcast Laravel events to Socket.io without Redis?

Good evening, programmers!
I have an issue with my program. There are several restrictions to my environment, so I cannot use Redis in it as well as Pusher. But I have to build realtime application. So, my very last alternative is socket.io.
I want to use Laravel Broadcasting System to notify my socket.io on events and after that - notify frontend part of my application with this events.
How could I do that and may be are there some packages to do this job? I will appreciate for any help!
Sure you can. Memcached might be something for you to look into.

real time update with SQS in Flask

I have a python script with reads data from an external API, formats it and pushes to dynamoDB for storage and to SQS.
I have a Flask web application. I want this Flask application to read the messages from SQS and update the main page in real time without page refreshes.
Do I need to use another service like Celery to achieve this? People talk about web sockets or AJAX? Does anyone have a simple example?
There is also this service called Pusher which handles it for you apparently?
Update: I managed to get it to work with pusher but it's really slow
Thank you!
I was able to solve the problem with the service called pusher
It basically takes care of the websockets for you. Very easy to use.
Hope this helps anyone who experiences the same problem

notify client browser about changes on server

I am trying to make a simple chat-like application where each of the users share data. I need to somehow update all the clients with the new data in real-time when 1 of them is sending something.
Is there a way to do it, maybe a webserver or smt ? something that works on apache?
For the client page i am using ajax to send data to server and PostgreSQL database to store the datas, but idk how to 'tell' clients that they need to 'refresh' the client browser because 1 client sent new datas to server.
Thank you in advance, Daniel!
I don't know what technology you are using so I would just recommend have a look at this service http://pusher.com/. They are a paid service that gives you the functionality you need. If you give more information on your technology we could provide better help.

Resources