Creating an admin site for the mobile app

Creating an admin site for the mobile app

  

Hi,

If we want to create a mobile app and an admin panel to manage it.

1. Do we suppose to create a separate web application for the admin panel and another separate application for the mobile app? Or should we combine it and create one application?

2. If we create two apps, how do we pass data from one application to another?

(Do we need to setup rest apis from admin panel?)

3. Why do we have server functions (tables) available in the mobile environment? (Aren't the web server suppose to execute all crud on behalf the mobile app, via GET/POST requests?)

Does OutSystems automatically converts all the aggregate functions to Rest API's and consume them after we export it to Android/iOS?


Thanks for the help!

Solution

Hi Chamika,

Let me try to answer these questions:

  1. It depends on what you want to achieve. If the users of the admin panel want to be able to use the panel on a mobile device, but also want to use the app itself, you may think of combining them. However, in practice, it makes more sense to have a seperate administration app as a Web App.
  2. If you only have a mobile app, how do you store data? And what exactly do you want configured? The typical pattern is to synchronize the mobile data with a backend (the OutSystems server). See here for more information about that.
  3. You need to understand the difference between local data and server data, and between local actions and server actions. Server data and actions work like their equivalent for Web Apps: they are executed at the server, and use the Platform's database. If you call a Server Action from a Mobile App, the Platform actually performs a REST call to the server, and sends back any data. Local data and actions only live at the mobile device, and are executed on the mobile device, without any server intervention (and in fact, they can run off-line). So to answer your question "why do we have server [actions] available", this is because you could want to retrieve data from the server database, or perhaps start something on the server, etc. And "[Is]n't the web server suppose[d] to execute all crud [actions] on behalf of the mobile app via GET/POST requests", yes, but only for Actions pertaining to server-side Entities.
  4. It is not possible to directly query server data in a local mobile Action, you always need a Server Action. That Server Action will be called seamlessly via a REST method (like I described above). The Platform handles everything for you, so you don't need to bother with the details. Of course, since the server is called, you need to be online, and depending on network conditions it takes more time than calling a local Action.

I hope this helps, if you have any further questions, don't hesitate to ask them.

Solution

Chamika Sanoj wrote:

Hi,

If we want to create a mobile app and an admin panel to manage it.

1. Do we suppose to create a separate web application for the admin panel and another separate application for the mobile app? Or should we combine it and create one application?

2. If we create two apps, how do we pass data from one application to another?


For this yes it is a good solution to make a admin approach by a webpage. The communication is always by database. So you do not need any admin rights on your mobile app.


Kilian Hekhuis wrote:

Hi Chamika,

Let me try to answer these questions:

  1. It depends on what you want to achieve. If the users of the admin panel want to be able to use the panel on a mobile device, but also want to use the app itself, you may think of combining them. However, in practice, it makes more sense to have a seperate administration app as a Web App.
  2. If you only have a mobile app, how do you store data? And what exactly do you want configured? The typical pattern is to synchronize the mobile data with a backend (the OutSystems server). See here for more information about that....

Hi Kilian,

Thanks a lot for the quick reply. Your answer cleared most of my doubts.

In this particular requirement I want to have a separate admin website to handle all the administrative work and mobile app just for the users to fill a form and submit (system will be mainly handled by the admin panel). 

So will it be a good idea to create a separate module for the entire database(DB_Core) and add this database into the mobile and admin applications as a dependency?

And also, is it correct to say that I don't have to use any Logic > Integrations > Rest/SOAP to get data from the server as I can directly use the server actions with aggregates?

Thanks!

Hi Chamika,

You cannot query server-side databases directly from a mobile app, but you can create a server-side action (or consume one) and call that from mobile. So if your mobile app must be on-line in order to function, and the data connection is fast enough, you can have a DB_Core that contains all the Entities, and use that in both apps.

And yes, there's no need to use REST (I'd forget about SOAP unless you must connect to some external service that uses it) if you are only retrieving data from the core module. But REST may be a good abstraction if you are also getting data from other places, so you don't end up with a lot of references.