• Stars
    star
    1,883
  • Rank 24,628 (Top 0.5 %)
  • Language
    JavaScript
  • Created almost 9 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Example of Parse Server using the express framework.

parse-repository-header


Join The Conversation Backers on Open Collective Sponsors on Open Collective License Forum Twitter


This is an example project using the Parse Server module on Express.

The Parse Server guide is a good place to get started. An API reference and Cloud Code guide are also available. If you're interested in developing for Parse Server, the Development guide will help you get set up. All documentations for Parse Platform's server and its client SDKs are available at parseplatform.org.


Local Development

  1. Make sure you have a compatible Node.js version installed. Run node --version to see your local Node.js version. Open the package.json file too see which version of Node.js this example repository requires at { engines": { "node": "<NODE_VERSION>" } }. Note that there may be other Parse Server version available that support older or newer Node.js versions, see the Parse Server compatibility table.
  2. Clone this repository and change directory to it.
  3. Run npm install.
  4. Install a MongoDB database locally from https://docs.mongodb.org/master/tutorial/install-mongodb-on-os-x.
  5. Run mongo to connect to your database, just to make sure it's working. Once you see a mongo prompt, exit with Control-D.
  6. Launch Parse Server with npm start.
  7. By default the API route will use /parse as a base. You can change this by setting the environment variable PARSE_MOUNT, for example in the CLI run run export PARSE_MOUNT=/app to set the path to app.
  8. Your Parse Server is not running and is connected to your local database named dev in which the data is stored that you manage via Parse Server.

Helpful Scripts

These scripts can help you to develop your app for Parse Server:

  • npm run watch will start your Parse Server and restart if you make any changes.
  • npm run lint will check the linting of your cloud code, tests and index.js, as defined in .eslintrc.json.
  • npm run lint-fix will attempt fix the linting of your cloud code, tests and index.js.
  • npm run prettier will help improve the formatting and layout of your cloud code, tests and index.js, as defined in .prettierrc.
  • npm run test will run any tests that are written in /spec.
  • npm run coverage will run tests and check coverage. Output is available in the /coverage folder.

Remote Deployment

Heroku

Deploy

Alternatively, to deploy manually:

  • Clone the repo and change directory to it
  • Log in with the Heroku Toolbelt and create an app: heroku create
  • Use the mLab addon: heroku addons:create mongolab:sandbox --app YourAppName
  • By default it will use a path of /parse for the API routes. To change this, or use older client SDKs, run heroku config:set PARSE_MOUNT=/1
  • Deploy it with: git push heroku master

AWS Elastic Beanstalk

Alternatively, deploy your local changes manually:

  • Clone the repo and change directory to it
  • Log in with the AWS Elastic Beanstalk CLI, select a region, and create an app: eb init
  • Create an environment and pass in MongoDB URI, App ID, and Master Key: eb create --envvars DATABASE_URI=<replace with URI>,APP_ID=<replace with Parse app ID>,MASTER_KEY=<replace with Parse master key>

Microsoft Azure App Service

Deploy to Azure

Detailed information is available here:

Google App Engine

  1. Clone the repo and change directory to it
  2. Create a project in the Google Cloud Platform Console.
  3. Enable billing for your project.
  4. Install the Google Cloud SDK.
  5. Setup a MongoDB server. You have a few options:
  6. Create a Google Compute Engine virtual machine with MongoDB pre-installed.
  7. Use mLab to create a free MongoDB deployment on Google Cloud Platform (only US-central).
  8. Modify app.yaml to update your environment variables.
  9. Delete Dockerfile
  10. Deploy it with gcloud preview app deploy

A detailed tutorial is available here: Running Parse server on Google App Engine

Scalingo

Deploy to Scalingo

Alternatively, to deploy manually:

  • Clone the repo and change directory to it
  • Log in with the Scalingo CLI and create an app: scalingo create my-parse
  • Use the Scalingo MongoDB addon: scalingo addons-add scalingo-mongodb free
  • Setup MongoDB connection string: scalingo env-set DATABASE_URI='$SCALINGO_MONGO_URL'
  • By default it will use a path of /parse for the API routes. To change this, or use older client SDKs, run scalingo env-set PARSE_MOUNT=/1
  • Deploy it with: git push scalingo master

OpenShift Online (Next Gen)

  1. Register for a free OpenShift Online (Next Gen) account
  2. Create a project in the OpenShift Online Console.
  3. Install the OpenShift CLI.
  4. Add the Parse Server template to your project: oc create -f https://raw.githubusercontent.com/ParsePlatform/parse-server-example/master/openshift.json
  5. Deploy Parse Server from the web console
  6. Open your project in the OpenShift Online Console:
  7. Click Add to Project from the top navigation
  8. Scroll down and select NodeJS > Parse Server
  9. (Optionally) Update the Parse Server settings (parameters)
  10. Click Create

A detailed tutorial is available here: Running Parse Server on OpenShift Online (Next Gen)

Using Parse Server

Health Check

You can use the /health endpoint to verify that Parse Server is up and running. For example, for local deployment, enter this URL in your browser:

http://localhost:1337/parse/health

If you deployed Parse Server remotely, change the URL accordingly.

APIs and SDKs

Use the REST API, GraphQL API or any of the Parse SDKs to see Parse Server in action. Parse Server comes with a variety of SDKs to cover most common ecosystems and languages, such as JavaScript, Swift, ObjectiveC and Android just to name a few.

The following shows example requests when interacting with a local deployment of Parse Server. If you deployed Parse Server remotely, change the URL accordingly.

REST API

Save object:

curl -X POST \
  -H "X-Parse-Application-Id: YOUR_APP_ID" \
  -H "Content-Type: application/json" \
  -d '{"score":1337}' \
  http://localhost:1337/parse/classes/GameScore

Call Cloud Code function:

curl -X POST \
  -H "X-Parse-Application-Id: YOUR_APP_ID" \
  -H "Content-Type: application/json" \
  -d "{}" \
  http://localhost:1337/parse/functions/hello

JavaScript

// Initialize SDK
Parse.initialize("YOUR_APP_ID", "unused");
Parse.serverURL = 'http://localhost:1337/parse';

// Save object
const obj = new Parse.Object('GameScore');
obj.set('score',1337);
await obj.save();

// Query object
const query = new Parse.Query('GameScore');
const objAgain = await query.get(obj.id);

Android

// Initialize SDK in the application class
Parse.initialize(new Parse.Configuration.Builder(getApplicationContext())
  .applicationId("YOUR_APP_ID")
  .server("http://localhost:1337/parse/")   // '/' important after 'parse'
  .build());

// Save object
ParseObject obj = new ParseObject("TestObject");
obj.put("foo", "bar");
obj.saveInBackground();

iOS / tvOS / iPadOS / macOS (Swift)

// Initialize SDK in AppDelegate
Parse.initializeWithConfiguration(ParseClientConfiguration(block: {
  (configuration: ParseMutableClientConfiguration) -> Void in
    configuration.server = "http://localhost:1337/parse/" // '/' important after 'parse'
    configuration.applicationId = "YOUR_APP_ID"
}))

You can change the server URL in all of the open-source SDKs, but we're releasing new builds which provide initialization time configuration of this property.

More Repositories

1

parse-server

Parse Server for Node.js / Express
JavaScript
20,806
star
2

parse-dashboard

A dashboard for managing Parse Server
JavaScript
3,738
star
3

Parse-SDK-iOS-OSX

The Apple SDK for Parse Platform (iOS, macOS, watchOS, tvOS)
Objective-C
2,809
star
4

Parse-SDK-Android

The Android SDK for Parse Platform
Java
1,879
star
5

Parse-SDK-JS

The JavaScript SDK for Parse Platform
JavaScript
1,317
star
6

ParseReact

Seamlessly bring Parse data into your React applications.
JavaScript
1,296
star
7

ParseUI-iOS

A collection of a handy user interface components to be used with the Parse iOS SDK.
Objective-C
934
star
8

parse-php-sdk

The PHP SDK for Parse Platform
PHP
811
star
9

ParseUI-Android

ParseUI contains user interface libraries for building apps with the Parse Android SDK.
Java
592
star
10

Parse-SDK-Flutter

The Dart/Flutter SDK for Parse Platform
Dart
575
star
11

Parse-SDK-dotNET

Parse SDK for .NET, Xamarin, Unity.
C#
322
star
12

docs

Parse Platform docs
SCSS
313
star
13

Parse-Swift

The Swift SDK for Parse Platform (iOS, macOS, watchOS, tvOS, Linux, Android, Windows)
Swift
302
star
14

parse-embedded-sdks

The Embedded SDKs for the Parse Platform
C
246
star
15

ParseLiveQuery-iOS-OSX

Parse LiveQuery Client for iOS/OS X.
Swift
192
star
16

parse-cli

Go
118
star
17

ParseFacebookUtils-iOS

A set of utilities to integrate Facebook with the Parse iOS/tvOS SDK.
Objective-C
92
star
18

parse-server-push-adapter

A push notification adapter for Parse Server
JavaScript
87
star
19

ParseLiveQuery-Android

Parse LiveQuery client for Android.
Java
84
star
20

parse-server-simple-mailgun-adapter

Used to send Parse Server password reset and email verification emails though Mailgun
JavaScript
83
star
21

parse-server-s3-adapter

AWS S3 file storage adapter for Parse Server
JavaScript
80
star
22

parse-react

[EXPERIMENTAL] React, React Native, and React with SSR (e.g. Next.js) packages to interact with Parse Server backend
TypeScript
69
star
23

Parse-SDK-Arduino

The Arduino SDK for the Parse Platform
C++
68
star
24

ParseFacebookUtils-Android

A utility library to authenticate ParseUsers with the Facebook SDK
Java
53
star
25

ParseTwitterUtils-iOS

A set of utilities to integrate Twitter with the Parse iOS SDK.
Objective-C
46
star
26

parse-server-fs-adapter

parse-server file system storage adapter
JavaScript
42
star
27

ParseInterceptors-Android

Parse Network Interceptor Debugging
Java
37
star
28

parse-blockchain

Blockchain (Ethereum) dApps development made easy with Parse Server (alpha)
TypeScript
37
star
29

ParseTwitterUtils-Android

A utility library to authenticate ParseUsers with Twitter
Java
36
star
30

parse-facebook-user-session

A Cloud Code module to facilitate logging into an express website with Facebook.
JavaScript
36
star
31

parse-server-gcs-adapter

parse-server adapter for Google Cloud Storage
JavaScript
29
star
32

parse-server-api-mail-adapter

API Mail Adapter for Parse Server
JavaScript
27
star
33

benchmark

Parse Server Continuous Benchmark
JavaScript
24
star
34

xctoolchain-archive

Common configuration files and scripts that are used to build our SDKs with Xcode.
Ruby
22
star
35

blog

Parse Community Blog
SCSS
18
star
36

parse-server-sqs-mq-adapter

Spread work queue accross cluster of parse servers using SQS
JavaScript
17
star
37

parse-community.github.io

Parse Platform GitHub Pages
SCSS
10
star
38

relay-examples

Parse-Server GraphQL Relay Todo
JavaScript
10
star
39

Governance

Details about the leadership & decision making process for the Parse Community
10
star
40

parse-server-conformance-tests

Conformance tests for parse-server adapters
JavaScript
7
star
41

parse-community-peril

Peril for the parse-community
TypeScript
6
star
42

.github

Default community health files for the Parse Community
4
star
43

release-automation-playground

A playground repo to experiment with release automation.
2
star
44

docs-tutorial-todoapp

A tutorial for developing a ToDo app with Parse Platform
1
star