Can a wordpress website be used as mobile app backend? - wordpress

I have a project where I need to make a mobile app for a wordpress website. It will have some features that are not in the web app yet. I've made some research and there seems to be ways to make api requests to some endpoints that are made available by wordpress. I am a rookie when it comes to planning a backend structure, building it from scratch, and deploying it, but I have developed new features for an existing node.js backend for a mobile app before. Considering all of this, can I use the wordpress api for my mobile app without any security, performance, or compatibility issues or should I start building a backend for it?
Thanks in advance.

Yes, we can use WordPress website for mobile application backend.
For this we need to make an API request according to WordPress structure and database structure.
A new development in WordPress is the WP-API, which allows you to output your site content into a standardized JSON API. Since mobile apps normally use an API to get remote data, using the WP-API is a great way to get your WordPress data into a mobile app.
We can use inbuilt plugins for the same purpose like AppPreser- Mobile App Framework.

Related

Should I use WordPress as backend for mobile app

I’m about to build an app that will look like a social network: people will be able to create accounts, like posts, save posts (But not create posts).
I’m searching the right platform to build my backend, I saw many options like Parse or Node.js but I did not see many people using WordPress as backend.
My question is why not use WordPress as my backend and develop custom plugins as I need? What is the pros and cons? Am I missing something that makes people not using WordPress?
Thanks
You can use the WordPress as the backend of your app as per your requirement, As WordPress allows wp-JSON API & WooCommerce API as well.
Also you can integrate the JWT Authentication for WP REST API plugin if you want to implement the JWT authentication
Also you can customize as per your requirement so i suggest to use the wordpress as backend of your app
There are a lot of people using Parse Server for building social networks and it is a great fit. Take a look at the following app template. It shows how to build an Instagram app.
https://www.back4app.com/database/back4app/instagram-clone-swiftui

Mixing Wordpress eCommerce site with external login based Vue Frontend Best Practices

I am new to web development and and would like advice about what is the usual best practices to achieve what I am trying to do.
I am in charge of writing a frontend app using Vue. This frontend will require a login to access the app. The app will be hosted on Amazon.
However we are also wanting to build an eCommerce site in Wordpress or equivalent that sits on the root of the website, (eg www.mywebsite.com) with the app accessible through a "sign in" button. If the user presses the sign in button we want the location bar location to not change from the website they are on (www.mywebsite.com), even though the Wordpress site and Vue frontend may be stored on different locations/domains.
If the site is made in Wordpress, we can get another developer to do that webpage for us, while I work on the frontend. However we want the experience to be relatively seamless between connecting to the wordpress root site, clicking on the sign in button and being taken to the Vue frontend.
Is this possible? Do both sites have to be hosted on the same server for it to work (eg an Amazon EC2 server which hosts two webpages, the wordpress one and the vue one)?
Or can the wordpress put a link to the Vue frontend which doesn't change the web location to the user?
Or (worst case scenario) do we need to make both webpages in Vue as one Vue application, some pages requiring login to access and others not?
Thanks kindly for any assistance.
So in order to use Vue and WordPress together, you can either write 2 separate applications. One for the Frontend and one for the Backend, which is perfectly fine or you can simply write a WordPress Application with a Vue Theme.
This is how this could look like:
WordPress Backend
You can use a normal WordPress backend, where you can build the architecture you want to. In addition, you need to set up the REST-API Wordpress provides. So this also means, just use plugins which support it. Otherwise, you would need to write custom endpoints. For example, Woocommerce would be a good e-commerce plugin, since it supports the API.
Learn more about it here: https://v2.wp-api.org/
Of course, you can host your WordPress installation on Amazon. Here is a good guide for that: https://aws.amazon.com/de/getting-started/tutorials/launch-a-wordpress-website/
Notice: The REST-API is available in core since 4.7. If you are using an older version you would need to install a plugin.
WordPress Frontend
In order to create your Frontend, I'd recommend you to make a custom theme. Since you are just serving static files this can be done pretty easy. But still, you don't need to reinvent the wheel.
There's a really good starter theme out there: https://github.com/EvanAgee/vuejs-wordpress-theme-starter
It comes with all the stuff you need to get started and since it is just a theme, you can simply set up a usual WordPress hosting without handling Domains of multiple applications.
In order to get the data from the Backend, you would simply make calls to the REST-API. Here's an example: https://github.com/EvanAgee/vuejs-wordpress-theme-starter/blob/master/src/api/index.js

WordPress Mobile App

Which is the best method to convert a website in WordPress to a mobile application? Is there a free plugin able to do this directly? Or another plugin that provides web service logic, or should implement everything on my own?

Wordpress app with Cordova

I have a Wordpress hosted application and I need to create a mobile version of it. As I read in one article, there is a way create a mobile application from hosted web application (not sure if that technique has any particular name). I was able to create the mobile application but I ran into a issue; when I am redirecting to any page, the mobile application is opening the browser to show the page. After some research I found that the solution will be to change all the href to window.open(url, '_system'). Is there any easier way to solve this issue?
The same article shows how to use the Camera plugin with the hosted ASP.Net application. Could anyone suggest an article that shows how to do the same thing but with Wordpress application.
You should have a look at WordPress hybrid project if you are looking for managed and performance enhanced app.
Otherwise, you can also use inAppBrowser for easy and fast development here is a Docs.

Wordpress on new Firebase hosting

I've found out about new Google Firebase Hosting recently and I was wondering if that would work for Wordpress website?
I got a bit confused them talking about static websites & web apps even though as far as I know Wordpress is dynamic...right? on their website it says:
https://firebase.google.com/docs/hosting/#key_functions
Whether you are deploying a simple app landing page or a complex Progressive Web App, Hosting gives you the infrastructure, features, and tooling tailored to deploying and managing static websites.
It looks like a nice Hosting platform for web, especially that they provide SSL certificates, but is it good for Wordpress?
Thanks!
I THINK it would be possible, you still need your SQL+PHP server and you should use it as WordPress backend, you need the WordPress REST API and a plugin with hooks in transition_post_status, comments... and whatever you want to show in your front end, use WordPress API endpoints to send the JSON to the firebase database... after your template should use a Javascript framework in order to make JSON requests to the firebase database and show the data in the browser... It would be difficult but I think it could be the cheaper and best solution ever for a high traffic website (plus all the benefits of firebase).
Nope. Firebase doesn't provide any of the requirements necessary for Wordpress, that being MySQL and PHP on the server side. Firebase provides a JSON store accessible via an API, and static hosting for apps that can access said API.

Resources