Making a backend for a corona application

I wanted to know how to go about making a backend that hosted scripts in a way that I could feed data and files from my corona application to the backend, have it process these with scripts I’ve written on the backend and then either store it on a cloud somewhere or return something back to the corona application. 

For example, a part of my app receives locations in the form of text, and i can store these in a json file on app42 but I want to have something host a script and every saturday, this script would take these locations, plot a route of them on a map and then send this map to an email, then empty the json file, and the whole thing would begin again the next week.

Is this possible? If so, how would I do it?

Are you looking for a backend like parse,
then you have below that can be used as a backend to store data & get back easily via api.

https://www.sashido.io/
https://backendless.com/

-Assif
 

Or if you want total control and DIY:

https://marketplace.coronalabs.com/plugin/coronium-core

https://marketplace.coronalabs.com/plugin/coronium-skytable

Or if this is just to read/write data:

https://marketplace.coronalabs.com/plugin/s3-lite

Hi,

Coronium Core will give you the most flexibility as far as creating highly customized functionality beyond just data storage and retrieval. The scripting is also all done using Lua.

But, the second part of your request is where the most work would be. What type of map are you wanting to make? Would you be embedding a Google map in an email? I think more details about what you expect from the output is needed to pinpoint the best service to use.

-dev

I was hoping to use an external api, maybe email a link to google maps with the route plotted out

With coronium core, can I use different api’s to send and retrieve data using the scripts?

will these enable me to host custom made scripts that can process the data sent and these scripts continuously run without being called to?

First of all, you have some great suggestions above. A lot depends on your skill level on the server side.

However, all that said, Corona works best with servers that can process HTTP requests, i.e. web server calls.  Typically this might be a script written in a scripting language like PHP. That script would then work with your datastore, such as a MySQL database, complete it’s task, return some result to Corona and then disconnect from the server.  You would use network.request() for this.

These type of web-based online scripts do not run continuously. Instead, they do their work, return results and quit.  Many people with inexpensive web-hosting services can make this work. Many of these services do not allow you to run “server” or “daemons” that run continuously, that do work at arbitrary times. They usually let you schedule scripts that can run periodically like once an hour.

Several of the suggestions above will provide you APIs that may protect you from having to use network.request(). Most of them can protect you from the online scripts to basically doing data storage and retrieval. 

I don’t know what you’re trying to do exactly, so it’s hard for me to recommend a solution.  Consider my description above as a generic process. Your mileage will vary based on your server experience.

Rob

Just to add to the conversation: GameSpark will let your run scripts every minute (I just checked). You can store the data in the MongoDB and then run the script every minute until a certain data value is present. Then from there if you can reach an e-mail server or map service from javascript you should be able to do it.

I have scripts that fire every week to clean up data, send e-mail, and fire off notifications (to onesignall).

Adrian

Are you looking for a backend like parse,
then you have below that can be used as a backend to store data & get back easily via api.

https://www.sashido.io/
https://backendless.com/

-Assif
 

Or if you want total control and DIY:

https://marketplace.coronalabs.com/plugin/coronium-core

https://marketplace.coronalabs.com/plugin/coronium-skytable

Or if this is just to read/write data:

https://marketplace.coronalabs.com/plugin/s3-lite

Hi,

Coronium Core will give you the most flexibility as far as creating highly customized functionality beyond just data storage and retrieval. The scripting is also all done using Lua.

But, the second part of your request is where the most work would be. What type of map are you wanting to make? Would you be embedding a Google map in an email? I think more details about what you expect from the output is needed to pinpoint the best service to use.

-dev

I was hoping to use an external api, maybe email a link to google maps with the route plotted out

With coronium core, can I use different api’s to send and retrieve data using the scripts?

will these enable me to host custom made scripts that can process the data sent and these scripts continuously run without being called to?

First of all, you have some great suggestions above. A lot depends on your skill level on the server side.

However, all that said, Corona works best with servers that can process HTTP requests, i.e. web server calls.  Typically this might be a script written in a scripting language like PHP. That script would then work with your datastore, such as a MySQL database, complete it’s task, return some result to Corona and then disconnect from the server.  You would use network.request() for this.

These type of web-based online scripts do not run continuously. Instead, they do their work, return results and quit.  Many people with inexpensive web-hosting services can make this work. Many of these services do not allow you to run “server” or “daemons” that run continuously, that do work at arbitrary times. They usually let you schedule scripts that can run periodically like once an hour.

Several of the suggestions above will provide you APIs that may protect you from having to use network.request(). Most of them can protect you from the online scripts to basically doing data storage and retrieval. 

I don’t know what you’re trying to do exactly, so it’s hard for me to recommend a solution.  Consider my description above as a generic process. Your mileage will vary based on your server experience.

Rob

Just to add to the conversation: GameSpark will let your run scripts every minute (I just checked). You can store the data in the MongoDB and then run the script every minute until a certain data value is present. Then from there if you can reach an e-mail server or map service from javascript you should be able to do it.

I have scripts that fire every week to clean up data, send e-mail, and fire off notifications (to onesignall).

Adrian