What’s a Mobile Backend?

It does not take an expert to determine that the computing power of a server is most likely greater than the computing power of a mobile device.

If an application has a heavy computational load than it becomes more efficient for the mobile device to send parameters to a backend server to do the heavy lifting and then returning the result. A common pattern in React, when communicating between a front-end client and a back end server, is to use JSON.

This can become a simple process: a mobile app outsourcing it’s functionality to APIs with API requests for increased performance.

A mobile backend is simply the server, database, service, etc. that is not local to the mobile device that handles aspects of the processes of the mobile app.

MBaaS

Many companies, or developers, want to increase the functionality of their apps and they want it done quickly. In recent years, companies have been created to help increase the speed that mobile apps are developed and decrease the amount of work that goes into maintaining their architecture.

These companies are known as selling Mobile Backend as a Service (MBaaS). Furthermore, as described on Wikipedia, mobile backend as a service provides developers a, “…way to link their applications to backend cloud storage and APIs exposed by back end applications while also providing features such as user management, push notifications, and integration with social networking services.”

We will not be setting up any accounts with MBaaS providers for our application, but it could be considered in the design of your future mobile applications. Below is a list of popular MBaaS providers:

Express

With a myriad of HTTP utility methods and middleware at your disposal, creating a robust API is quick and easy.

Expressjs.com

Express is a Node.js framework for creating web application servers or APIs. Express is easy to set up, as you will see later and can be extended to include many features. Also, Express integrates all the benefits of Node.js (i.e asynchronous code).

Although Express can be a web application server, we are going to use it as an API to proxy our interactions with a database API.

Security

Whether developing front-end static websites, or a mobile application, security becomes an issue quickly. Reading from the Expo documentation,

Never put any secret keys inside of your app, there is no secure way to do this! Instead, you should store your secret key(s) on a server and expose an endpoint that makes API calls for your client and passes the data back.

Setting up an Express API on a server to handle the sensitive actions of our app allows us to secure secret keys. Later, we are going to demonstrate this process when we hide the value of our RapidAPI secret key.

Express Alternatives

To reiterate, some of the main advantages of Express are;

Considering the advantages, it’s safe to say that we are making a good choice when using Express. However, below is a list of other popular Node.js libraries that share some of the same functionality of Express:

All are reputable and have their advantages! You can read more about each by following the links. Ok, time to get started with the application!

How to Create a Mobile App with NodeJS

The application is bootstrapped with Expo. Expo allows us to quickly set up a React Native project while providing a project structure so we can quickly get into coding out the components.

Furthermore, Expo is the nicest way to get started without being too picky about the type of operating system that you are using on your desktop or smartphone.

The application will use an Express server running locally to handle the database requests that are made using the FaiRESTdb API on RapidAPI as our database.

In addition to the individual use of React Native, Expo, and Express, this tutorial will show you how we can combine the three to create a secure mobile application that can store and retrieve data.

Prerequisites