Gravity
Search…
Installation

1. Add Database, Social & Mailgun Settings

Navigate to the folder where you downloaded Gravity and open the .env & /config/default.json files located in the /server folder and then populate your database and Mailgun credentials.
If you want to use social sign-ons you will need to add your Facebook and Twitter API keys to the .env file and also the callback URLs to /config.
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.
1
npm install --global expo-cli
Copied!

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

The installation process is the same as that described in the server installation instructions, except you must specify your desire database driver if not using MySQL.
1
// standard (mysql2)
2
npm run setup
3
4
// mongo
5
npm run setup db:mongo
6
7
// postgres
8
npm run setup db:pg
Copied!
This will install all of the dependencies required. Once the installation process has finished, you can start your app:
1
npm run dev
Copied!
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.

5. Install ngrok (optional)

If you want to use social sign-ons in your application, you will need to install ngrok to handle the redirects.
Once installed, please update the callback_url inside the /config folder files and also the baseURL value inside app/config.json

Running Your App

Finally, to run your app any time, enter the following command.
1
npm run dev
Copied!
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.
Last modified 27d ago