1. Add Database & Mailgun Settings

Navigate to the folder where you downloaded Gravity and open the /config/default.json and add your Mailgun credentials. If you're using MongoDB add your database credentials here too. If you're using a SQL database, please add the connection details to the /knexfile.js

It's important that you complete this step before proceeding.

2. Install the Expo Command-line Tool

The Expo CLI will enable you to perform a variety of Expo tasks, like running and building your app.

npm install --global expo-cli

3. Download the Expo Mobile Client

On your iOS or Android mobile device, visit the respective app store and download the Expo mobile client then register a free account.

4. Install Gravity Native

// standard
npm run setup
// mongo
npm run setup db:mongo

This will install all of the dependencies required. Once the installation process has finished, you can start your app:

npm run dev

If you open the Expo mobile app or iOS or Android simulator, you'll be able to see your app.

Inside /app/config.json is a baseURL setting that points to the Gravity server for making API calls. During setup, this will be automatically set to your local network address but you should update this to point to your development server.

Running Your App

Finally, to run your app any time, enter the following command.

npm run dev

This will start both Gravity Server and the Expo client.

Running in a Simulator

Once your Expo server is running, you can open your app in the Android similar by pressing a or i to open the iOS simulator.