#Next as a back-end, real-time data fetching

20 messages · Page 1 of 1 (latest)

shadow osprey
#

Hello, I've got a question... Can Next work as a back-end? I would want to process the data on server-side constantly let's say 5s revalidate and make request calls from front-end (client) to server for fresh data... Is it possible? I would want to make real-time data fetching from server... API Calls might work like that? I would want to make that API work all the time, process the data independently of users requests and then the user will make a call and get fresh data 😬

indigo sand
#

and yeah will be easy to manage

shadow osprey
#

Just by API?

indigo sand
#

what kinf of data do u want to fetch?

#

are you in need of a developer?

paper stirrup
#

you can't use real time stuff like ws or socketio in api routes

shadow osprey
#

Let's say I will have some type of widget to show real-time crypto prices... I don't won't to process it on client-side and to not reprocess it with every call, just process it all the time and let users grab the data from server any time

tawdry siren
tawdry siren
#

next.js api routes are not appropriate for that

indigo sand
#

possible using next but not recommended

indigo sand
indigo sand
tawdry siren
#

it is impossible to do with api routes if you host in somewhere like vercel

tawdry siren
#

however if the data isn't too realtime but still updates pretty often like 5 secs you can use http and api routes

shadow osprey
#

Or work with the database on the server-side... I would want to have some type of a login system, I would want to encrypt the data on client-side, send it to back-end, do some stuff on the back-end with the data, send it to DB to not make calls client - db, only server will have connection with DB, grab the data from db, encrypt, decrypt and send user only that what he needs without sensitive data

shadow osprey
#

How should I do that? Can I use some type of frameworks for encryption on API routes? How can I make server to fetch and process the data and then make calls from client-side for processed data