I'm developing a Cordova app and I've got the UI ready but I need data to my app from a database. For example I want my cordova app to include user authentication when the user opens the app which means, I have to access my database in some way to check the user input. I would also like to get data from the database and show in the app such as the members information, ranking and so on. How do I do this in a easy and proper way? Am I right when I say that there is not a good thing to access a database directly from the javascript in the cordova app, for security reasons?
Is the solution through a architecture that looks like this?
Cordova app(In Google play) --> Application Server --> Database