Get Started

Quickstart

Back4App is an open source (based on Parse Platform), low code platform that helps you to develop modern apps. On Back4App, you will find the following features:

  • Data Storage (Relational)
  • Cloud Code Functions
  • APIs (GraphQL and REST)
  • File Storage
  • Authentication
  • Push Notifications

5-minute quick start

After creating your Back4App account and your first App, go to your App Dashboard and get your App Keys under App Settings-> Security & Keys(check the image below). Note that you will always need two keys to connect with Back4App, the Application ID, and another key according to the SDK you will use.

Parse JavaScript SDK can be used in a large amount of platforms and frameworks.

1. Install Parse SDK

$ npm install parse @react-native-async-storage/async-storage --save

Use CocoaPods to add the native RNAsyncStorage to your project:

cd ios & pod-install

2. Initialize the SDK using your Application ID and JavaScript Key

App.js

1
2
3
4
5
6
7
8
9
10
//On your App.js file
import AsyncStorage from '@react-native-async-storage/async-storage';
import Parse from 'parse/react-native';

//Before using the SDK...
Parse.setAsyncStorage(AsyncStorage);
//Paste below the Back4App Application ID AND the JavaScript KEY
Parse.initialize('YOUR_APPLICATION_ID_HERE', 'YOUR_JAVASCRIPT_KEY_HERE');
//Point to Back4App Parse API address 
Parse.serverURL = 'https://parseapi.back4app.com/'

1. Install the dependency of Parse JavaScript SDK

$ yarn add parse

2. Install the SDK

1
2
//Import Parse minified version
import Parse from 'parse/dist/parse.min.js';

1. Install the NPM module

$ npm install parse --save

2. Install the SDK

1
2
3
4
var Parse = require('parse/node');

Parse.initialize("APP_ID","JS_KEY"); //PASTE HERE YOUR Back4App APPLICATION ID AND YOUR JavaScript KEY
Parse.serverURL = 'https://parseapi.back4app.com/'

1. Install the NPM module

$ npm install parse --save

2. Install the SDK

1
2
3
4
5
6
7
8
9
10
11
12
13
import * as Parse from 'parse';

@Component({ ... })

export class AppComponent {
  ...

  constructor() {
    // Initialize your Parse App Keys
    Parse.initialize("APP_ID","JS_KEY"); //PASTE HERE YOUR Back4App APPLICATION ID AND YOUR JavaScript KEY
    Parse.serverURL = 'https://parseapi.back4app.com/'
  }
}

1. Load external file in HTML document

After creating your index.html, install Parse SDK direct on it, inside the <head> tag, using the code below.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!DOCTYPE html>
<html>
<head>
  <title>My First Application</title>
  <script type="text/javascript" src="https://npmcdn.com/parse/dist/parse.min.js"></script>
  <script type="text/javascript" type="text/javascript">
    Parse.initialize("APP_ID","JS_KEY"); //PASTE HERE YOUR Back4App APPLICATION ID AND YOUR JavaScript KEY
    Parse.serverURL = 'https://parseapi.back4app.com/'
  </script>
</head>
<body>
  <!--
    Your code
  -->
</body>
</html>

3. Save your first data on Back4App

Call the function saveNewPlayer to save your first data on Back4App. After calling the function go to your App Dashboard and check the data you’ve just saved.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
async function saveNewPlayer() {
  //Create your Parse Object
  const soccerPlayer = new Parse.Object('SoccerPlayer');
  //Define its attributes
  soccerPlayer.set('playerName', 'A. Wed');
  soccerPlayer.set('yearOfBirth', 1997);
  soccerPlayer.set('emailContact', '[email protected]');
  soccerPlayer.set('attributes', ['fast', 'good conditioning']);
  try {
    //Save the Object
    const result = await soccerPlayer.save();
    alert('New object created with objectId: ' + result.id);
  } catch (error) {
    alert('Failed to create new object: ' + error.message);
  }
}

Install the Parse Flutter SDK

Install the latest Parse Flutter SDK in your application. Then, create a Flutter Project:

Create a Flutter Project

flutter create flutter_parse

Check if everything is OK running the application:

cd flutter_parse
flutter run

Installing Flutter plugin for Parse Server

Add Parse to the project dependencies to pubspec.yaml file:

dependencies:
  parse_server_sdk_flutter: ^latest_version

1. Setting up Parse SDK

In your Dart Code, clean all main.dart code and start a new one importing the Parse SDK.

main.dart

1
2
import 'package:flutter/material.dart';
import 'package:parse_server_sdk_flutter/parse_server_sdk.dart';

2. Initialize the SDK using your Application ID and Client Key

main.dart

1
2
3
4
5
6
7
8
void main() async {
  final keyApplicationId = 'YOUR_APPLICATION_ID_HERE';
  final keyClientKey = 'YOUR_CLIENT_KEY_HERE';
  final keyParseServerUrl = 'https://parseapi.back4app.com';

  await Parse().initialize(keyApplicationId, keyParseServerUrl,
      clientKey: keyClientKey, debug: true);
  }

3. Save your first data on Back4App

1
2
3
4
5
6
7
8
9
10
void main() async {
  Future<String> saveNewPlayer() async {
    final soccerPlayer = ParseObject('SoccerPlayer')
	..set('playerName', 'A. Wed')
	..set('yearOfBirth', 1997)
	..set('emailContact', '[email protected]')
	..set('attributes', ['fast', 'good conditioning'])
	await soccerPlayer.save();
	return soccerPlayer.objectId;
  }

Facing any trouble? Feel free to check the complete Install Parse SDK guide to Flutter projects. Also, feel free to check the official Parse Documentation regarding Parse SDK for Flutter.

1. Parse Android SDK Installation

To install the latest Parse Android SDK in your application, go to the build.gradle (Module:app) file and insert the code snippet inside the dependencies{} tag.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
// ... code
android {...}

dependencies {
  // code...
  // Don't forget to change the line below with the latest version of Parse SDK for Android
  implementation "com.github.parse-community.Parse-SDK-Android:parse:latest.version.here"
}

repositories {
  mavenCentral()
  jcenter()
  maven { url 'https://jitpack.io' }
}

You can find out which is the latest version of Parse SDK for Android at Jitpack Website.

Facing any trouble? Feel free to check the complete Install Parse SDK guide to Android projects. Also, feel free to check the official Parse Documentation regarding Parse SDK for Android.

2. Initialize the SDK using your Application ID and Client Key

Inside the strings.xml file, insert the following lines, with your application keys.

./app/src/main/res/values/strings.xml

1
2
3
4
5
6
<resources>
  <string name="back4app_server_url">https://parseapi.back4app.com/</string>
  <!-- Change the following strings as required -->
  <string name="back4app_app_id">APP_ID</string>
  <string name="back4app_client_key">CLIENT_KEY</string>
</resources>

3. Give Permissions and set up your App

You need to grant permission for your Android app to access the internet network. Add the following code snippet to your AndroidManifest.xml file right after the application tag.

./app/src/main/AndroidManifest.xml

1
2
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />

Also, inside the application tag, add the following:

./app/src/main/AndroidManifest.xml

1
2
3
4
5
6
7
8
9
<meta-data
  android:name="com.parse.SERVER_URL"
  android:value="@string/back4app_server_url" />
<meta-data
  android:name="com.parse.APPLICATION_ID"
  android:value="@string/back4app_app_id" />
<meta-data
  android:name="com.parse.CLIENT_KEY"
  android:value="@string/back4app_client_key" />

4. Initialize Parse SDK

Create a Java file called App that extends Application. Inside App.java onCreate method, right after super.onCreate() call the following code:

1
2
3
4
5
6
7
8
9
import com.parse.Parse;

Parse.initialize(new Parse.Configuration.Builder(this)
  .applicationId(getString(R.string.back4app_app_id))
  // if defined
  .clientKey(getString(R.string.back4app_client_key))
  .server(getString(R.string.back4app_server_url))
  .build()
);

Don’t forget to define this file in the AndroidManifest.xml. To do so, go to the AndroidManifest.xml file and add the following line of code inside the application tag:

1
android:name=".App"

If the name of the java file that extends Application that you created on the previous step isn’t “App”, don’t forget that the code above should have the correct name of the file (android:name=".name_of_the_file").

Facing any trouble? Feel free to check the complete Install Parse SDK guide to Android projects. Also, feel free to check the official Parse Documentation regarding Parse SDK for Android.

5. Save your first data on Back4App

Call the function saveNewPlayer. Then, go to your App Dashboard and check the data you’ve just saved.

1
2
3
4
5
6
7
8
private void saveNewPlayer() {
  ParseObject soccerPlayer = new ParseObject("SoccerPlayer");
  soccerPlayer.put("playerName", "A. Wed");
  soccerPlayer.put("yearOfBirth", 1997);
  soccerPlayer.put("emailContact", "[email protected]");
  soccerPlayer.put("attributes", ["fast", "good conditioning"]);
  soccerPlayer.saveInBackground();
  }

Install CocoaPods and Import Parse

Xcode can use CocoaPods as dependency manager for Swift Cocoa projects. To install CocoaPods, copy the following code snippet and paste it into your terminal and hit return.

$ sudo gem install cocoapods

You can refer to CocoaPods Getting Started Guide for additional details.

Connect your Parse App

Open your project’s AppDelegate file to set up app’s credentials. Parse SDK for iOS uses these settings to connect to the Back4App servers. At the top of the file you should see a function called didFinishLaunchingWithOptions. Paste the following code snippet inside this function, and make sure it is above the line that says return true.

At the top of your AppDelegate.swift file make sure to include Parse as a module by using the following code snippet right below import UIKit.

AppDelegate.swift

1
    import Parse

Facing any trouble? Feel free to check the complete Install Parse SDK guide to iOS Swift projects. Also, feel free to check the official Parse Documentation regarding Parse SDK for iOS.

2. Initialize the SDK using your Application ID and Client Key

AppDelegate.swift

1
2
3
4
5
6
let configuration = ParseClientConfiguration {
  $0.applicationId = "PASTE_YOUR_APPLICATION_ID_HERE"
  $0.clientKey = "PASTE_YOUR_CLIENT_ID_HERE"
  $0.server = "https://parseapi.back4app.com"
}
Parse.initialize(with: configuration)

3. Save your first data on Back4App

1
2
3
4
5
6
7
8
9
10
11
12
13
var soccerPlayer = PFObject(className:"SoccerPlayer")
person["playerName"] = "A. Wed"
person["yearOfBirth"] = 1997
person["emailContact"] = "[email protected]"
person["attributes"] = ["fast", "good conditioning"]
person.saveInBackground {
  (success: Bool, error: Error?) in
  if (success) {
    // The object has been saved.
  } else {
    // There was a problem, check error.description
  }
}

1. Parse PHP SDK Installation

1.1 With composer

Create a composer.json file in your projects root folder, containing the following.

{
    "require": {
        "parse/php-sdk" : "1.6.*"
    }
}

Run the “composer install” to download and set up the autoloader. After that, you can require it from your PHP script, using the code below.

1
require 'vendor/autoload.php';

1.2 With Git

Go to Parse SDK for PHP page on GitHub and clone it.

$ git clone https://github.com/parse-community/parse-php-sdk.git

Inside your PHP file, include the autoload.php to automatically load the Parse SDK classes.

2. Initialize the SDK using your Application ID, Rest Key and Master Key.

1
2
ParseClient::initialize( $app_id, $rest_key, $master_key);
ParseClient::setServerURL('https://parseapi.back4app.com','/');

3. Save your first data on Back4App

1
2
3
4
5
6
7
8
9
10
11
12
$soccerPlayer = new ParseObject("SoccerPlayer");
$soccerPlayer->set("name", "A. Wed");
$soccerPlayer->set("yearOfBirth", 1997);
$soccerPlayer->set('emailContact', '[email protected]');
$soccerPlayer->setArray('attributes', ['fast', 'good conditioning']);

try {
	$soccerPlayer->save();
	echo 'New object created with objectId: ' . $soccerPlayer->getObjectId();
} catch (ParseException $ex) {  
	echo 'Failed to create new object, with error message: ' . $ex->getMessage();
}

Facing any trouble? Feel free to check the official Parse Documentation regarding Parse SDK for PHP.

We need to add some libraries to set up Parse SDK for .NET. We will get them through Nuget Packages. To do so, go to Microsoft Visual Studio and at the Solution Explorer, click on your app’s name and go to Manage NuGet Packages....

Then, click on Browse to search and install the packages parse by Parse and Xamarin.Android.Support.v7.AppCompat by Xamarin Inc.

Save your first data on Back4App

1
2
3
4
5
6
ParseObject soccerPlayer = new ParseObject("SoccerPlayer");
soccerPlayer["name"] = "A. Wed";
soccerPlayer["yearOfBirth"] = 1997;
soccerPlayer["emailContact"] = "[email protected]";
soccerPlayer["attributes"] = new List<object>{"fast", "good conditioning"};
await soccerPlayer.SaveAsync();

Facing any trouble? Feel free to check the official Parse Documentation regarding Parse SDK for .NET.

1. Save your first data on Back4App

Open your terminal, and run the following command:

1
2
3
4
5
6
curl -X POST \
-H "X-Parse-Application-Id: APPLICATION_ID" \
-H "X-Parse-REST-API-Key: REST_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"A. Wed","yearOfBirth":1997, "emailContact":"[email protected]", "attributes":["fast", "good conditioning"]}' \
https://parseapi.back4app.com/classes/SoccerPlayer

What can you build with Back4App?

There are many example apps and starter projects to get going

ReaclJS Slack Clone - A React template using real-time, relational queries and authentication.

Flutter User Login/SignUp - A user sign-up/login flutter template using Parse.User class.

React Native Associations - A template on React Native digging deeper into associations and relational queries using Pointers and Relations.

Flutter File Storage - Saving files from a Flutter app.

GeoPointers on Kotlin-Android - Exploring GeoPointers in Android.

ToDo List example is Swift-iOS - A ToDo List example in Swift.

What to do Next?

After a quick start, we recommend keeping exploring the Back4App main features by checking out the guides below. You will find how to store and query relational data, use cloud functions to add business logic to your backend, use real-time subscriptions to keep your users up-to-date, store files, send push notifications, use the authentication mechanisms available on Back4App, and more. Choose the technology that suits you and enjoy the journey.