SlideShare ist ein Scribd-Unternehmen logo
1 von 56
Downloaden Sie, um offline zu lesen
Parse and Cloud Code
Node.pgh - 0.16 meetup
Nicholas McClay
UX Developer

@nickmcclay
What is

?
“Parse's vision is to let developers
build any mobile app without
dealing with servers.”
a suite of tools to replace or support	

your app’s backend

Parse Data

Parse Push

Parse Social Parse Analytics Parse Hosting

Cloud Code

Backend-as-a-Service (BaaS)
Getting Started with Parse
Acquire Keys
1.

Sign Up

2.

3.

Pick Your
Platform
1.

Sign Up with Parse
https://www.parse.com/#signup

Sign Up

App + Optional Info

Intro Documentation
2.

Parse Account Page

Acquire Keys

Application Keys
‘Key’ Details
•

Main ID (always needed)	


•

iOS & Android Key	


•

Windows 8 & Phone Key	


•

Node + Client Side JS Key	


•

REST API Key	


•

‘Sudo’ Key

Adheres to Object Level Permissions (ACL)
https://parse.com/docs/data#security-objects
3.

Pick Your Platform
I choose you

Parse API Platforms

!
+
Generate an Express App
yo express

Install Parse module
npm install parse

Run Server
grunt
Alternative Node-Parse Modules
“IMPORTANT NOTE: This api is not currently maintained. If
I were starting a parse project today using node.js, I would
probably start out with https://github.com/shiki/kaiseki”
npm install node-parse-api

A Parse.com REST API client for Node.js
npm install kaiseki

https://parse.com/docs/rest
Quick-Start
https://parse.com/apps/quickstart#js/native/blank

Import and Initialize Parse Module


var Parse = require('parse').Parse;

Parse.initialize(“Application ID", “JavaScript Key");


Save a “TestObject”
var TestObject = Parse.Object.extend("TestObject");

var testObject = new TestObject();

testObject.save({foo: "bar"}, {

success: function(object) {

alert("yay! it worked");

}

});
Parse Suite Overview
Pick your problem
Parse Data

Store your app’s data in the cloud. No servers necessary.
https://parse.com/products/data
Parse Data Objects
Data is schema-less
Automatic objectId, createAt and modifiedAt fields
Objects can be extended from other objects (classes)
Objects can be relational
{

objectId : "xWMyZ4YEGZ",

score: 1337,

playerName : "Sean Plott",

cheatMode : false,

createdAt : "2011-06-10T18:33:42Z",

updatedAt : "2011-06-10T18:33:42Z"

}
Object API
https://www.parse.com/docs/js_guide#objects
var Class = Parse.Object.extend("ClassName");

var item = new Class();

item.method({params},{callbacks})

item.save({"field" : "value"}, {

success : function(obj) {

// Execute any logic that should take place after the object is saved.

},

error : function(obj,error) {

// Execute any logic that should take place if the save fails.

// error is a Parse.Error with an error code and description.

}

})
Object Methods
•

save(params,callback) - save params to your object	


•

fetch(callbacks) - refresh an object	


•

set(field,value)/get(field) - stage params for saving to object	


•

increment/decrement(field,value) - ++ and - - 	


•

destroy(callbacks) - delete an object	


•

unset(field) - delete a field	


•

add, addUnique, remove - array specific methods

http://www.parse.com/docs/js/symbols/Parse.Object.html
Query API
Retrieve many objects at once, put conditions on the objects
you wish to retrieve, and more

var GameScore = Parse.Object.extend("GameScore");

var query = new Parse.Query(GameScore);

query.equalTo("playerEmail", “blazor777@blah.com");

query.find({

success: function(object) {

// Successfully retrieved the object.

},

error: function(error) {

// Handle error

}

});

https://www.parse.com/docs/js_guide#queries
Query Methods
•

get(objectId,callbacks) - get one object by ID	


•

find(callbacks) - runs query and returns results	


•

equalTo, notEqualTo, etc - stage filters for query results	


•

limit(num)/skip(num) - stage range for query results	


•

ascending/descending - stage order for query results	


•

first(callbacks) - like find, but just the first match	


•

count(callbacks) - if you just want to know total of results
http://www.parse.com/docs/js/symbols/Parse.Query.html
Object Pointers
One-to-one and one-to-many relationships are modeled by
saving a Parse.Object as a value in the other object (pointer).




var
var
var
var

Portfolio = Parse.Object.extend("Portfolio");

item = new Portfolio();

Comment = Parse.Object.extend("Comment");

post = new Comment();

post.save({'message' : "this is great!"},{

success : function() {

item.set("comments",[post]);

item.save();

}

});


Saving an Object pointer

{


],


}

"comments": [

{

"__type": "Pointer",

"className": "Comment",

"objectId": "YrLhRXbnfc"

}

"objectId": "Z8CarHlfu2",

"createdAt": "2013-11-05T20:06:59.130Z",

"updatedAt": "2013-11-05T20:06:59.130Z"


Pointer Data without being fetched

By default, when fetching an object, related Parse.Objects are not fetched. These
objects' values cannot be retrieved until they have been fetched
Object Relations
Many-to-many relationships are modeled using Parse.Relation.




var
var
var
var

Portfolio = Parse.Object.extend("Portfolio");

item = new Portfolio();

Comment = Parse.Object.extend("Comment");

post = new Comment();

post.save({'message' : "this is great!"},{

success : function() {

var relation = item.relation("comments");

relation.add(post);

item.save();

}

});

Saving an Object relation

var relation = item.relation(“comments");
var query = relation.query();
query.equalTo("author", “Sam");
query.limit(10);

"
"

query().find({

success: function(list) {

// list of all relation results

}

});

Retrieve relation data using Query API

By default, the list of objects in this relation are not downloaded. You can get a list
of the posts that a user likes by using the Parse.Query returned by query.
Parse Data Browser
Lots of other Data goodness
Every asynchronous method in the Parse JavaScript SDK
returns a Promise
Object instance and class methods
A Parse.Collection is an ordered set of Parse.Objects. It is
compatible with Backbone.Collection, and has all the same
functionality.
Parse.File lets you store application files in the cloud
Parse Push

Creating, scheduling, and segmenting push notifications
https://www.parse.com/products/push
Enabling Push Notifications
To send notifications from the JavaScript SDK outside of Cloud
Code or any of the other client SDKs, you will need to set Client
Push Enabled in the Push Notifications settings of your Parse app.

Flip this to get started
Parse Channels
Allows you to use a publisher-subscriber model for sending pushes.
Parse.Push.send({

channels: [ "Giants", "Mets" ],

data: {

alert: "The Giants won against the Mets 2-3."

}

}, {

success: function() {

// Push was successful

},

error: function(error) {

// Handle error

}

});

The channels subscribed to by a given Installation are stored in the
channels field of the Installation object.
Installation Object modification not available in
JavaScript SDK
Push Options
•

alert- your notification’s message	


•

badge (iOS) - # of pending notifications on your app	


•

sound (iOS) - play a sound file in your application
bundle	


•

content-available (iOS) - for Newsstand apps	


•

action (android) - Intent to be executed when received	


•

title (android)- displayed in notification tray
Advanced Targeting
While channels are great for many applications, sometimes you need
more precision when targeting the recipients of your pushes.
var query = new Parse.Query(Parse.Installation);

query.equalTo('channels', 'Pirates'); // Set our channel

query.equalTo('scores', true);




Parse.Push.send({

where: query,

data: {

alert: "Pirates scored against the Cardinals! It's now 3-2."

}

}, {

success: function() {

// Push was successful

},

error: function(error) {

// Handle error

}

});

Data stored in Installation Object can be used with Query API
Receiving Pushes…
The JavaScript SDK does not currently support
subscribing iOS and Android devices for pushes

The JavaScript SDK does not currently support
receiving pushes.
Push forward
Scheduling Pushes and expiration dates
Targeting by Platform and Relationships
App Notification Dashboard
Parse Social

Make your app social. Instantly
https://parse.com/products/data
Parse User
Parse.User is a subclass of Parse.Object, and has all the same features
var user = new Parse.User();

user.set("username", "Nick");

user.set("password", "voltan123");

user.set("email", "nick@hotmail.com");




// other fields can be set just like with Parse.Object

user.set("phone", "XXX-XX-XXXX");




user.signUp(null, {

success: function(user) {

// Hooray! Let them use the app now.

},

error: function(user, error) {

// Show the error message somewhere and let the user try again.

}

});

•

username - required, makes sure username is unique	


•

password - required, stores as hidden hash	


•

email - optional, makes sure email is unique
User API
•

signUp(params,callback) - create new User	


•

logIn(user,pass,callbacks) - authenticate User	


•

logOut() - sign out User	


•

save(params,callbacks) - update User fields	


•

User.current()- get current User from localStorage	


•

User.requestPasswordReset(email, options)
http://parse.com/docs/js/symbols/Parse.User.html
Setup for Facebook Integration
1.

Setup a Facebook App

2.

Add Facebook JS SDK to your app

3.

Add FB App ID to Parse App Settings Page

4.

Replace FB.init() with Parse.FacebookUtils.init()

https://developers.facebook.com/apps

https://developers.facebook.com/docs/reference/javascript/

https://www.parse.com/apps/<your app name>/edit#authentication
Facebook Social Sign On
allow your Parse.Users to log in or sign up through Facebook.
Parse.FacebookUtils.logIn("user_likes,email", {

success: function(user) {

if (!user.existed()) {

// User registered through Facebook!

} else {

// User signed in through Facebook!

}

},

error: function(user, error) {

// User didn’t authorize for some reason…

}

});

You may optionally provide a comma-delimited string that specifies
what permissions your app requires from the Facebook user

https://www.parse.com/docs/js_guide#fbusers-signup
Facebook SDK + Node…
https://parse.com/questions/facebook-login-with-the-node-sdk-for-parse

The Facebook JavaScript SDK does not work in Node

Sign in with the Facebook Javascript SDK client side and then
transfer the credentials to the server and use REST API
Getting more Social
Security - roles and ACLs
Email verification and password reset
Twitter, 3rd Party Integration and Account Linking
Users in Data Browser
Parse Analytics

Track any data point in your app in real-time
https://www.parse.com/products/analytics
Complimentary Analytics
Developers using Parse Data are automatically instrumented
Custom Analytics
Track free-form events, with a handful of string keys and values
var dimensions = {

priceRange: '1000-1500',

customerType: 'renter',

age: '22-25'

};




// Send the dimensions to Parse along with the 'search' event

Parse.Analytics.track('search', dimensions);

Dimensions must
be string values
Check your Parse module version!
https://parse.com/questions/updates-to-the-parse-package-innpm-appear-infrequent
npm currently thinks this is the latest version
root.Parse.VERSION = "js1.2.8";

Download the actual latest version manually to get
Parse.Analytics Object
root.Parse.VERSION = "js1.2.12";

https://www.parse.com/docs/downloads
Parse Hosting

A powerful web presence without all the hassle.
https://www.parse.com/products/hosting
Parse Cloud Code

Add rich, custom logic to your app’s backend without servers.
https://www.parse.com/products/cloud_code
Install Cloud Code
https://parse.com/docs/cloud_code_guide

curl -s https://www.parse.com/downloads/cloud_code/installer.sh | sudo /bin/bash

parse new MyCloudCode

Email: <enter Parse.com email>

Password: <enter Parse.com password>

1:MyApp
Select an App: <enter Parse App Number>
Cloud Code Project
cloud - where you cloud code snippets live
config - where your Parse app config lives
public - where static files that will be hosted live

Hosting a website with Parse is easy. Everything in the public
directory will be hosted at your-custom-subdomain.parseapp.com.
Parse Deploy

cd MyCloudCode
parse deploy
Uploading source files
Finished uploading files
New release is named v1
Cloud Functions

Cloud functions can be called from any of the client SDKs, as well as
through the REST API
Parse.Cloud.define("averageStars", function(request, response) {

var query = new Parse.Query("Review");

query.equalTo("movie", request.params.movie);

query.find({

success: function(results) {

var sum = 0;

for (var i = 0; i < results.length; ++i) {

sum += results[i].get("stars");

}

response.success(sum / results.length);

},

error: function() {

response.error("movie lookup failed");

}

});

});
Parse.Cloud.run('averageStars', {"movie":"The Matrix"}, {

success: function(result) {

// returns cloud function results

},

error: function(error) {

// returns error from cloud code

}

});
Cloud Functions API
•

run(key,params,callbacks) - All	


•

before/afterSave(class,callbacks) - All	


•

before/afterDelete(class,callbacks) - All

•

useMasterKey() - Cloud Code and Node.js only

•

define(key,callback) - Cloud Code only

•

httpRequest(options) - Cloud Code only
http://parse.com/docs/js/symbols/Parse.Cloud.html
Parse Express Server

After you get Parse Hosting set up, you can add dynamic backend
logic to your website by generating an Express application.
parse generate express
Creating directory /Users/nick/MyCloudCode/cloud/views
Writing out sample file /Users/nick/MyCloudCode/cloud/app.js
Writing out sample file /Users/nick/MyCloudCode/cloud/views/hello.ejs
Almost done! Please add this line to the top of your main.js:
require('cloud/app.js');
// These two lines are required to initialize Express in Cloud Code.

var express = require('express');

var app = express();




// Global app configuration section

app.set('views', 'cloud/views'); // Specify the folder to find templates

app.set('view engine', 'ejs');
// Set the template engine

app.use(express.bodyParser());
// Middleware for reading request body




// This is an example of hooking up a request handler with a specific request

// path and HTTP verb using the Express routing API.

app.get('/hello', function(req, res) {

res.render('hello', { message: 'Congrats, you just set up your app!' });

});




// Attach the Express app to Cloud Code.

app.listen();
Cloud Modules
Cloud Code supports breaking up JavaScript code into modules.
cloud/name.js
var coolNames = ['Ralph', 'Skippy', 'Chip', 'Ned', 'Scooter'];

exports.isACoolName = function(name) {

return coolNames.indexOf(name) !== -1;

}

cloud/main.js
var name = require('cloud/name.js');

name.isACoolName('Fred'); // returns false

name.isACoolName('Skippy'); // returns true;

name.coolNames; // undefined.

Pre-installed Cloud Modules
var Crowdflower = require('crowdflower');

Crowdflower.initialize('myAPIKey');
Cloud Code limitations…

Doesn’t support npm
Can’t test locally
Can’t debug…
Parse Pricing
Pricing that scales with your needs.
Getting More Help
Official Parse Tutorials
https://www.parse.com/tutorials

JavaScript Guide Documentation
https://parse.com/docs/js_guide#javascript_guide

JavaScript SDK Documentation
http://parse.com/docs/js/
Thanks!

@nickmcclay

Weitere ähnliche Inhalte

Was ist angesagt?

FIWARE の ID 管理、アクセス制御、API 管理
FIWARE の ID 管理、アクセス制御、API 管理FIWARE の ID 管理、アクセス制御、API 管理
FIWARE の ID 管理、アクセス制御、API 管理fisuda
 
NGSIv1 を知っている開発者向けの NGSIv2 の概要 (Orion 1.13.0対応)
NGSIv1 を知っている開発者向けの NGSIv2 の概要 (Orion 1.13.0対応)NGSIv1 を知っている開発者向けの NGSIv2 の概要 (Orion 1.13.0対応)
NGSIv1 を知っている開発者向けの NGSIv2 の概要 (Orion 1.13.0対応)fisuda
 
FortiGate – устройство комплексной сетевой безопасности
FortiGate – устройство комплексной сетевой безопасностиFortiGate – устройство комплексной сетевой безопасности
FortiGate – устройство комплексной сетевой безопасностиSergey Malchikov
 
Orion Context Broker 20220526
Orion Context Broker 20220526Orion Context Broker 20220526
Orion Context Broker 20220526Fermin Galan
 
NOSQLEU - Graph Databases and Neo4j
NOSQLEU - Graph Databases and Neo4jNOSQLEU - Graph Databases and Neo4j
NOSQLEU - Graph Databases and Neo4jTobias Lindaaker
 
Kafka Streams vs. KSQL for Stream Processing on top of Apache Kafka
Kafka Streams vs. KSQL for Stream Processing on top of Apache KafkaKafka Streams vs. KSQL for Stream Processing on top of Apache Kafka
Kafka Streams vs. KSQL for Stream Processing on top of Apache KafkaKai Wähner
 
FIWARE: Managing Context Information at large scale
FIWARE: Managing Context Information at large scaleFIWARE: Managing Context Information at large scale
FIWARE: Managing Context Information at large scaleFermin Galan
 
Integrating Apache Kafka and Elastic Using the Connect Framework
Integrating Apache Kafka and Elastic Using the Connect FrameworkIntegrating Apache Kafka and Elastic Using the Connect Framework
Integrating Apache Kafka and Elastic Using the Connect Frameworkconfluent
 
[AWS Dev Day] 앱 현대화 | 코드 기반 인프라(IaC)를 활용한 현대 애플리케이션 개발 가속화, 우리도 할 수 있어요 - 김필중...
[AWS Dev Day] 앱 현대화 | 코드 기반 인프라(IaC)를 활용한 현대 애플리케이션 개발 가속화, 우리도 할 수 있어요 - 김필중...[AWS Dev Day] 앱 현대화 | 코드 기반 인프라(IaC)를 활용한 현대 애플리케이션 개발 가속화, 우리도 할 수 있어요 - 김필중...
[AWS Dev Day] 앱 현대화 | 코드 기반 인프라(IaC)를 활용한 현대 애플리케이션 개발 가속화, 우리도 할 수 있어요 - 김필중...Amazon Web Services Korea
 
FIWARE Big Data Ecosystem : Cygnus and STH Comet
FIWARE Big Data Ecosystem : Cygnus and STH CometFIWARE Big Data Ecosystem : Cygnus and STH Comet
FIWARE Big Data Ecosystem : Cygnus and STH Cometfisuda
 
Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드
Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드
Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드confluent
 
Simplified Machine Learning Architecture with an Event Streaming Platform (Ap...
Simplified Machine Learning Architecture with an Event Streaming Platform (Ap...Simplified Machine Learning Architecture with an Event Streaming Platform (Ap...
Simplified Machine Learning Architecture with an Event Streaming Platform (Ap...Kai Wähner
 
Building a healthy data ecosystem around Kafka and Hadoop: Lessons learned at...
Building a healthy data ecosystem around Kafka and Hadoop: Lessons learned at...Building a healthy data ecosystem around Kafka and Hadoop: Lessons learned at...
Building a healthy data ecosystem around Kafka and Hadoop: Lessons learned at...Yael Garten
 
MySQL Enterprise Data Masking
MySQL Enterprise Data MaskingMySQL Enterprise Data Masking
MySQL Enterprise Data MaskingGeorgi Kodinov
 
Building Data Intensive Analytic Application on Top of Delta Lakes
Building Data Intensive Analytic Application on Top of Delta LakesBuilding Data Intensive Analytic Application on Top of Delta Lakes
Building Data Intensive Analytic Application on Top of Delta LakesDatabricks
 
FIWARE Context Information Management
FIWARE Context Information ManagementFIWARE Context Information Management
FIWARE Context Information Managementfisuda
 
Spark MLlib - Training Material
Spark MLlib - Training Material Spark MLlib - Training Material
Spark MLlib - Training Material Bryan Yang
 
Taking Splunk to the Next Level - Architecture Breakout Session
Taking Splunk to the Next Level - Architecture Breakout SessionTaking Splunk to the Next Level - Architecture Breakout Session
Taking Splunk to the Next Level - Architecture Breakout SessionSplunk
 
Troubleshooting Cassandra (J.B. Langston, DataStax) | C* Summit 2016
Troubleshooting Cassandra (J.B. Langston, DataStax) | C* Summit 2016Troubleshooting Cassandra (J.B. Langston, DataStax) | C* Summit 2016
Troubleshooting Cassandra (J.B. Langston, DataStax) | C* Summit 2016DataStax
 

Was ist angesagt? (20)

FIWARE の ID 管理、アクセス制御、API 管理
FIWARE の ID 管理、アクセス制御、API 管理FIWARE の ID 管理、アクセス制御、API 管理
FIWARE の ID 管理、アクセス制御、API 管理
 
NGSIv1 を知っている開発者向けの NGSIv2 の概要 (Orion 1.13.0対応)
NGSIv1 を知っている開発者向けの NGSIv2 の概要 (Orion 1.13.0対応)NGSIv1 を知っている開発者向けの NGSIv2 の概要 (Orion 1.13.0対応)
NGSIv1 を知っている開発者向けの NGSIv2 の概要 (Orion 1.13.0対応)
 
FortiGate – устройство комплексной сетевой безопасности
FortiGate – устройство комплексной сетевой безопасностиFortiGate – устройство комплексной сетевой безопасности
FortiGate – устройство комплексной сетевой безопасности
 
Orion Context Broker 20220526
Orion Context Broker 20220526Orion Context Broker 20220526
Orion Context Broker 20220526
 
NOSQLEU - Graph Databases and Neo4j
NOSQLEU - Graph Databases and Neo4jNOSQLEU - Graph Databases and Neo4j
NOSQLEU - Graph Databases and Neo4j
 
Kafka Streams vs. KSQL for Stream Processing on top of Apache Kafka
Kafka Streams vs. KSQL for Stream Processing on top of Apache KafkaKafka Streams vs. KSQL for Stream Processing on top of Apache Kafka
Kafka Streams vs. KSQL for Stream Processing on top of Apache Kafka
 
FIWARE: Managing Context Information at large scale
FIWARE: Managing Context Information at large scaleFIWARE: Managing Context Information at large scale
FIWARE: Managing Context Information at large scale
 
Integrating Apache Kafka and Elastic Using the Connect Framework
Integrating Apache Kafka and Elastic Using the Connect FrameworkIntegrating Apache Kafka and Elastic Using the Connect Framework
Integrating Apache Kafka and Elastic Using the Connect Framework
 
[AWS Dev Day] 앱 현대화 | 코드 기반 인프라(IaC)를 활용한 현대 애플리케이션 개발 가속화, 우리도 할 수 있어요 - 김필중...
[AWS Dev Day] 앱 현대화 | 코드 기반 인프라(IaC)를 활용한 현대 애플리케이션 개발 가속화, 우리도 할 수 있어요 - 김필중...[AWS Dev Day] 앱 현대화 | 코드 기반 인프라(IaC)를 활용한 현대 애플리케이션 개발 가속화, 우리도 할 수 있어요 - 김필중...
[AWS Dev Day] 앱 현대화 | 코드 기반 인프라(IaC)를 활용한 현대 애플리케이션 개발 가속화, 우리도 할 수 있어요 - 김필중...
 
FIWARE Big Data Ecosystem : Cygnus and STH Comet
FIWARE Big Data Ecosystem : Cygnus and STH CometFIWARE Big Data Ecosystem : Cygnus and STH Comet
FIWARE Big Data Ecosystem : Cygnus and STH Comet
 
Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드
Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드
Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드
 
Simplified Machine Learning Architecture with an Event Streaming Platform (Ap...
Simplified Machine Learning Architecture with an Event Streaming Platform (Ap...Simplified Machine Learning Architecture with an Event Streaming Platform (Ap...
Simplified Machine Learning Architecture with an Event Streaming Platform (Ap...
 
Building a healthy data ecosystem around Kafka and Hadoop: Lessons learned at...
Building a healthy data ecosystem around Kafka and Hadoop: Lessons learned at...Building a healthy data ecosystem around Kafka and Hadoop: Lessons learned at...
Building a healthy data ecosystem around Kafka and Hadoop: Lessons learned at...
 
MySQL Enterprise Data Masking
MySQL Enterprise Data MaskingMySQL Enterprise Data Masking
MySQL Enterprise Data Masking
 
Building Data Intensive Analytic Application on Top of Delta Lakes
Building Data Intensive Analytic Application on Top of Delta LakesBuilding Data Intensive Analytic Application on Top of Delta Lakes
Building Data Intensive Analytic Application on Top of Delta Lakes
 
FIWARE Context Information Management
FIWARE Context Information ManagementFIWARE Context Information Management
FIWARE Context Information Management
 
Spark MLlib - Training Material
Spark MLlib - Training Material Spark MLlib - Training Material
Spark MLlib - Training Material
 
Taking Splunk to the Next Level - Architecture Breakout Session
Taking Splunk to the Next Level - Architecture Breakout SessionTaking Splunk to the Next Level - Architecture Breakout Session
Taking Splunk to the Next Level - Architecture Breakout Session
 
Data Stores @ Netflix
Data Stores @ NetflixData Stores @ Netflix
Data Stores @ Netflix
 
Troubleshooting Cassandra (J.B. Langston, DataStax) | C* Summit 2016
Troubleshooting Cassandra (J.B. Langston, DataStax) | C* Summit 2016Troubleshooting Cassandra (J.B. Langston, DataStax) | C* Summit 2016
Troubleshooting Cassandra (J.B. Langston, DataStax) | C* Summit 2016
 

Ähnlich wie Node.js and Parse

Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha
 
第一次用Parse就深入淺出
第一次用Parse就深入淺出第一次用Parse就深入淺出
第一次用Parse就深入淺出Ymow Wu
 
Automatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos TabularesAutomatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos TabularesGaston Cruz
 
Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)Luc Bors
 
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineJava Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineIMC Institute
 
SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015Pushkar Chivate
 
MongoDB Days UK: Building Apps with the MEAN Stack
MongoDB Days UK: Building Apps with the MEAN StackMongoDB Days UK: Building Apps with the MEAN Stack
MongoDB Days UK: Building Apps with the MEAN StackMongoDB
 
Introduction to the SharePoint Client Object Model and REST API
Introduction to the SharePoint Client Object Model and REST APIIntroduction to the SharePoint Client Object Model and REST API
Introduction to the SharePoint Client Object Model and REST APIRob Windsor
 
Get started with building native mobile apps interacting with SharePoint
Get started with building native mobile apps interacting with SharePointGet started with building native mobile apps interacting with SharePoint
Get started with building native mobile apps interacting with SharePointYaroslav Pentsarskyy [MVP]
 
PredictionIO – A Machine Learning Server in Scala – SF Scala
PredictionIO – A Machine Learning Server in Scala – SF ScalaPredictionIO – A Machine Learning Server in Scala – SF Scala
PredictionIO – A Machine Learning Server in Scala – SF Scalapredictionio
 
How To Manage API Request with AXIOS on a React Native App
How To Manage API Request with AXIOS on a React Native AppHow To Manage API Request with AXIOS on a React Native App
How To Manage API Request with AXIOS on a React Native AppAndolasoft Inc
 
Building Web Apps with Express
Building Web Apps with ExpressBuilding Web Apps with Express
Building Web Apps with ExpressAaron Stannard
 
Sherlock Homepage - A detective story about running large web services - WebN...
Sherlock Homepage - A detective story about running large web services - WebN...Sherlock Homepage - A detective story about running large web services - WebN...
Sherlock Homepage - A detective story about running large web services - WebN...Maarten Balliauw
 
Building APIs in an easy way using API Platform
Building APIs in an easy way using API PlatformBuilding APIs in an easy way using API Platform
Building APIs in an easy way using API PlatformAntonio Peric-Mazar
 
Sherlock Homepage (Maarten Balliauw)
Sherlock Homepage (Maarten Balliauw)Sherlock Homepage (Maarten Balliauw)
Sherlock Homepage (Maarten Balliauw)Visug
 
Sherlock Homepage - A detective story about running large web services (VISUG...
Sherlock Homepage - A detective story about running large web services (VISUG...Sherlock Homepage - A detective story about running large web services (VISUG...
Sherlock Homepage - A detective story about running large web services (VISUG...Maarten Balliauw
 
The Big Picture and How to Get Started
The Big Picture and How to Get StartedThe Big Picture and How to Get Started
The Big Picture and How to Get Startedguest1af57e
 
Parse cloud code
Parse cloud codeParse cloud code
Parse cloud code維佋 唐
 

Ähnlich wie Node.js and Parse (20)

Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
 
第一次用Parse就深入淺出
第一次用Parse就深入淺出第一次用Parse就深入淺出
第一次用Parse就深入淺出
 
Intro to Parse
Intro to ParseIntro to Parse
Intro to Parse
 
Automatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos TabularesAutomatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos Tabulares
 
Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)
 
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineJava Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
 
SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015
 
MongoDB Days UK: Building Apps with the MEAN Stack
MongoDB Days UK: Building Apps with the MEAN StackMongoDB Days UK: Building Apps with the MEAN Stack
MongoDB Days UK: Building Apps with the MEAN Stack
 
Introduction to the SharePoint Client Object Model and REST API
Introduction to the SharePoint Client Object Model and REST APIIntroduction to the SharePoint Client Object Model and REST API
Introduction to the SharePoint Client Object Model and REST API
 
Get started with building native mobile apps interacting with SharePoint
Get started with building native mobile apps interacting with SharePointGet started with building native mobile apps interacting with SharePoint
Get started with building native mobile apps interacting with SharePoint
 
PredictionIO – A Machine Learning Server in Scala – SF Scala
PredictionIO – A Machine Learning Server in Scala – SF ScalaPredictionIO – A Machine Learning Server in Scala – SF Scala
PredictionIO – A Machine Learning Server in Scala – SF Scala
 
How To Manage API Request with AXIOS on a React Native App
How To Manage API Request with AXIOS on a React Native AppHow To Manage API Request with AXIOS on a React Native App
How To Manage API Request with AXIOS on a React Native App
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
 
Building Web Apps with Express
Building Web Apps with ExpressBuilding Web Apps with Express
Building Web Apps with Express
 
Sherlock Homepage - A detective story about running large web services - WebN...
Sherlock Homepage - A detective story about running large web services - WebN...Sherlock Homepage - A detective story about running large web services - WebN...
Sherlock Homepage - A detective story about running large web services - WebN...
 
Building APIs in an easy way using API Platform
Building APIs in an easy way using API PlatformBuilding APIs in an easy way using API Platform
Building APIs in an easy way using API Platform
 
Sherlock Homepage (Maarten Balliauw)
Sherlock Homepage (Maarten Balliauw)Sherlock Homepage (Maarten Balliauw)
Sherlock Homepage (Maarten Balliauw)
 
Sherlock Homepage - A detective story about running large web services (VISUG...
Sherlock Homepage - A detective story about running large web services (VISUG...Sherlock Homepage - A detective story about running large web services (VISUG...
Sherlock Homepage - A detective story about running large web services (VISUG...
 
The Big Picture and How to Get Started
The Big Picture and How to Get StartedThe Big Picture and How to Get Started
The Big Picture and How to Get Started
 
Parse cloud code
Parse cloud codeParse cloud code
Parse cloud code
 

Mehr von Nicholas McClay

Mehr von Nicholas McClay (7)

Intro to Sail.js
Intro to Sail.jsIntro to Sail.js
Intro to Sail.js
 
Get MEAN! Node.js and the MEAN stack
Get MEAN!  Node.js and the MEAN stackGet MEAN!  Node.js and the MEAN stack
Get MEAN! Node.js and the MEAN stack
 
Node.js Cloud deployment
Node.js Cloud deploymentNode.js Cloud deployment
Node.js Cloud deployment
 
Coffee script throwdown
Coffee script throwdownCoffee script throwdown
Coffee script throwdown
 
Node.js 0.8 features
Node.js 0.8 featuresNode.js 0.8 features
Node.js 0.8 features
 
Node.js and NoSQL
Node.js and NoSQLNode.js and NoSQL
Node.js and NoSQL
 
Node.js debugging
Node.js debuggingNode.js debugging
Node.js debugging
 

Kürzlich hochgeladen

Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 

Kürzlich hochgeladen (20)

Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

Node.js and Parse

  • 1. Parse and Cloud Code Node.pgh - 0.16 meetup
  • 4. “Parse's vision is to let developers build any mobile app without dealing with servers.”
  • 5.
  • 6. a suite of tools to replace or support your app’s backend Parse Data Parse Push Parse Social Parse Analytics Parse Hosting Cloud Code Backend-as-a-Service (BaaS)
  • 7. Getting Started with Parse Acquire Keys 1. Sign Up 2. 3. Pick Your Platform
  • 8. 1. Sign Up with Parse https://www.parse.com/#signup Sign Up App + Optional Info Intro Documentation
  • 9. 2. Parse Account Page Acquire Keys Application Keys
  • 10. ‘Key’ Details • Main ID (always needed) • iOS & Android Key • Windows 8 & Phone Key • Node + Client Side JS Key • REST API Key • ‘Sudo’ Key Adheres to Object Level Permissions (ACL) https://parse.com/docs/data#security-objects
  • 11. 3. Pick Your Platform I choose you Parse API Platforms !
  • 12. + Generate an Express App yo express Install Parse module npm install parse Run Server grunt
  • 13. Alternative Node-Parse Modules “IMPORTANT NOTE: This api is not currently maintained. If I were starting a parse project today using node.js, I would probably start out with https://github.com/shiki/kaiseki” npm install node-parse-api A Parse.com REST API client for Node.js npm install kaiseki https://parse.com/docs/rest
  • 14. Quick-Start https://parse.com/apps/quickstart#js/native/blank Import and Initialize Parse Module 
 var Parse = require('parse').Parse;
 Parse.initialize(“Application ID", “JavaScript Key");
 Save a “TestObject” var TestObject = Parse.Object.extend("TestObject");
 var testObject = new TestObject();
 testObject.save({foo: "bar"}, {
 success: function(object) {
 alert("yay! it worked");
 }
 });
  • 16. Parse Data Store your app’s data in the cloud. No servers necessary. https://parse.com/products/data
  • 17. Parse Data Objects Data is schema-less Automatic objectId, createAt and modifiedAt fields Objects can be extended from other objects (classes) Objects can be relational {
 objectId : "xWMyZ4YEGZ",
 score: 1337,
 playerName : "Sean Plott",
 cheatMode : false,
 createdAt : "2011-06-10T18:33:42Z",
 updatedAt : "2011-06-10T18:33:42Z"
 }
  • 18. Object API https://www.parse.com/docs/js_guide#objects var Class = Parse.Object.extend("ClassName");
 var item = new Class(); item.method({params},{callbacks}) item.save({"field" : "value"}, {
 success : function(obj) {
 // Execute any logic that should take place after the object is saved.
 },
 error : function(obj,error) {
 // Execute any logic that should take place if the save fails.
 // error is a Parse.Error with an error code and description.
 }
 })
  • 19. Object Methods • save(params,callback) - save params to your object • fetch(callbacks) - refresh an object • set(field,value)/get(field) - stage params for saving to object • increment/decrement(field,value) - ++ and - - • destroy(callbacks) - delete an object • unset(field) - delete a field • add, addUnique, remove - array specific methods http://www.parse.com/docs/js/symbols/Parse.Object.html
  • 20. Query API Retrieve many objects at once, put conditions on the objects you wish to retrieve, and more var GameScore = Parse.Object.extend("GameScore");
 var query = new Parse.Query(GameScore);
 query.equalTo("playerEmail", “blazor777@blah.com");
 query.find({
 success: function(object) {
 // Successfully retrieved the object.
 },
 error: function(error) {
 // Handle error
 }
 }); https://www.parse.com/docs/js_guide#queries
  • 21. Query Methods • get(objectId,callbacks) - get one object by ID • find(callbacks) - runs query and returns results • equalTo, notEqualTo, etc - stage filters for query results • limit(num)/skip(num) - stage range for query results • ascending/descending - stage order for query results • first(callbacks) - like find, but just the first match • count(callbacks) - if you just want to know total of results http://www.parse.com/docs/js/symbols/Parse.Query.html
  • 22. Object Pointers One-to-one and one-to-many relationships are modeled by saving a Parse.Object as a value in the other object (pointer). 
 var var var var Portfolio = Parse.Object.extend("Portfolio");
 item = new Portfolio();
 Comment = Parse.Object.extend("Comment");
 post = new Comment(); post.save({'message' : "this is great!"},{
 success : function() {
 item.set("comments",[post]);
 item.save();
 }
 });
 Saving an Object pointer {
 ],
 } "comments": [
 {
 "__type": "Pointer",
 "className": "Comment",
 "objectId": "YrLhRXbnfc"
 }
 "objectId": "Z8CarHlfu2",
 "createdAt": "2013-11-05T20:06:59.130Z",
 "updatedAt": "2013-11-05T20:06:59.130Z"
 Pointer Data without being fetched By default, when fetching an object, related Parse.Objects are not fetched. These objects' values cannot be retrieved until they have been fetched
  • 23. Object Relations Many-to-many relationships are modeled using Parse.Relation. 
 var var var var Portfolio = Parse.Object.extend("Portfolio");
 item = new Portfolio();
 Comment = Parse.Object.extend("Comment");
 post = new Comment(); post.save({'message' : "this is great!"},{
 success : function() {
 var relation = item.relation("comments");
 relation.add(post);
 item.save();
 }
 }); Saving an Object relation var relation = item.relation(“comments"); var query = relation.query(); query.equalTo("author", “Sam"); query.limit(10); " " query().find({
 success: function(list) {
 // list of all relation results
 }
 }); Retrieve relation data using Query API By default, the list of objects in this relation are not downloaded. You can get a list of the posts that a user likes by using the Parse.Query returned by query.
  • 25. Lots of other Data goodness Every asynchronous method in the Parse JavaScript SDK returns a Promise Object instance and class methods A Parse.Collection is an ordered set of Parse.Objects. It is compatible with Backbone.Collection, and has all the same functionality. Parse.File lets you store application files in the cloud
  • 26. Parse Push Creating, scheduling, and segmenting push notifications https://www.parse.com/products/push
  • 27. Enabling Push Notifications To send notifications from the JavaScript SDK outside of Cloud Code or any of the other client SDKs, you will need to set Client Push Enabled in the Push Notifications settings of your Parse app. Flip this to get started
  • 28. Parse Channels Allows you to use a publisher-subscriber model for sending pushes. Parse.Push.send({
 channels: [ "Giants", "Mets" ],
 data: {
 alert: "The Giants won against the Mets 2-3."
 }
 }, {
 success: function() {
 // Push was successful
 },
 error: function(error) {
 // Handle error
 }
 }); The channels subscribed to by a given Installation are stored in the channels field of the Installation object. Installation Object modification not available in JavaScript SDK
  • 29. Push Options • alert- your notification’s message • badge (iOS) - # of pending notifications on your app • sound (iOS) - play a sound file in your application bundle • content-available (iOS) - for Newsstand apps • action (android) - Intent to be executed when received • title (android)- displayed in notification tray
  • 30. Advanced Targeting While channels are great for many applications, sometimes you need more precision when targeting the recipients of your pushes. var query = new Parse.Query(Parse.Installation);
 query.equalTo('channels', 'Pirates'); // Set our channel
 query.equalTo('scores', true);
 
 Parse.Push.send({
 where: query,
 data: {
 alert: "Pirates scored against the Cardinals! It's now 3-2."
 }
 }, {
 success: function() {
 // Push was successful
 },
 error: function(error) {
 // Handle error
 }
 }); Data stored in Installation Object can be used with Query API
  • 31. Receiving Pushes… The JavaScript SDK does not currently support subscribing iOS and Android devices for pushes The JavaScript SDK does not currently support receiving pushes.
  • 32. Push forward Scheduling Pushes and expiration dates Targeting by Platform and Relationships App Notification Dashboard
  • 33. Parse Social Make your app social. Instantly https://parse.com/products/data
  • 34. Parse User Parse.User is a subclass of Parse.Object, and has all the same features var user = new Parse.User();
 user.set("username", "Nick");
 user.set("password", "voltan123");
 user.set("email", "nick@hotmail.com");
 
 // other fields can be set just like with Parse.Object
 user.set("phone", "XXX-XX-XXXX");
 
 user.signUp(null, {
 success: function(user) {
 // Hooray! Let them use the app now.
 },
 error: function(user, error) {
 // Show the error message somewhere and let the user try again.
 }
 }); • username - required, makes sure username is unique • password - required, stores as hidden hash • email - optional, makes sure email is unique
  • 35. User API • signUp(params,callback) - create new User • logIn(user,pass,callbacks) - authenticate User • logOut() - sign out User • save(params,callbacks) - update User fields • User.current()- get current User from localStorage • User.requestPasswordReset(email, options) http://parse.com/docs/js/symbols/Parse.User.html
  • 36. Setup for Facebook Integration 1. Setup a Facebook App 2. Add Facebook JS SDK to your app 3. Add FB App ID to Parse App Settings Page 4. Replace FB.init() with Parse.FacebookUtils.init() https://developers.facebook.com/apps https://developers.facebook.com/docs/reference/javascript/ https://www.parse.com/apps/<your app name>/edit#authentication
  • 37. Facebook Social Sign On allow your Parse.Users to log in or sign up through Facebook. Parse.FacebookUtils.logIn("user_likes,email", {
 success: function(user) {
 if (!user.existed()) {
 // User registered through Facebook!
 } else {
 // User signed in through Facebook!
 }
 },
 error: function(user, error) {
 // User didn’t authorize for some reason…
 }
 }); You may optionally provide a comma-delimited string that specifies what permissions your app requires from the Facebook user https://www.parse.com/docs/js_guide#fbusers-signup
  • 38. Facebook SDK + Node… https://parse.com/questions/facebook-login-with-the-node-sdk-for-parse The Facebook JavaScript SDK does not work in Node Sign in with the Facebook Javascript SDK client side and then transfer the credentials to the server and use REST API
  • 39. Getting more Social Security - roles and ACLs Email verification and password reset Twitter, 3rd Party Integration and Account Linking Users in Data Browser
  • 40. Parse Analytics Track any data point in your app in real-time https://www.parse.com/products/analytics
  • 41. Complimentary Analytics Developers using Parse Data are automatically instrumented
  • 42. Custom Analytics Track free-form events, with a handful of string keys and values var dimensions = {
 priceRange: '1000-1500',
 customerType: 'renter',
 age: '22-25'
 };
 
 // Send the dimensions to Parse along with the 'search' event
 Parse.Analytics.track('search', dimensions); Dimensions must be string values
  • 43. Check your Parse module version! https://parse.com/questions/updates-to-the-parse-package-innpm-appear-infrequent npm currently thinks this is the latest version root.Parse.VERSION = "js1.2.8"; Download the actual latest version manually to get Parse.Analytics Object root.Parse.VERSION = "js1.2.12"; https://www.parse.com/docs/downloads
  • 44. Parse Hosting A powerful web presence without all the hassle. https://www.parse.com/products/hosting
  • 45. Parse Cloud Code Add rich, custom logic to your app’s backend without servers. https://www.parse.com/products/cloud_code
  • 46. Install Cloud Code https://parse.com/docs/cloud_code_guide curl -s https://www.parse.com/downloads/cloud_code/installer.sh | sudo /bin/bash parse new MyCloudCode Email: <enter Parse.com email> Password: <enter Parse.com password> 1:MyApp Select an App: <enter Parse App Number>
  • 47. Cloud Code Project cloud - where you cloud code snippets live config - where your Parse app config lives public - where static files that will be hosted live Hosting a website with Parse is easy. Everything in the public directory will be hosted at your-custom-subdomain.parseapp.com.
  • 48. Parse Deploy cd MyCloudCode parse deploy Uploading source files Finished uploading files New release is named v1
  • 49. Cloud Functions Cloud functions can be called from any of the client SDKs, as well as through the REST API Parse.Cloud.define("averageStars", function(request, response) {
 var query = new Parse.Query("Review");
 query.equalTo("movie", request.params.movie);
 query.find({
 success: function(results) {
 var sum = 0;
 for (var i = 0; i < results.length; ++i) {
 sum += results[i].get("stars");
 }
 response.success(sum / results.length);
 },
 error: function() {
 response.error("movie lookup failed");
 }
 });
 }); Parse.Cloud.run('averageStars', {"movie":"The Matrix"}, {
 success: function(result) {
 // returns cloud function results
 },
 error: function(error) {
 // returns error from cloud code
 }
 });
  • 50. Cloud Functions API • run(key,params,callbacks) - All • before/afterSave(class,callbacks) - All • before/afterDelete(class,callbacks) - All • useMasterKey() - Cloud Code and Node.js only • define(key,callback) - Cloud Code only • httpRequest(options) - Cloud Code only http://parse.com/docs/js/symbols/Parse.Cloud.html
  • 51. Parse Express Server After you get Parse Hosting set up, you can add dynamic backend logic to your website by generating an Express application. parse generate express Creating directory /Users/nick/MyCloudCode/cloud/views Writing out sample file /Users/nick/MyCloudCode/cloud/app.js Writing out sample file /Users/nick/MyCloudCode/cloud/views/hello.ejs Almost done! Please add this line to the top of your main.js: require('cloud/app.js'); // These two lines are required to initialize Express in Cloud Code.
 var express = require('express');
 var app = express();
 
 // Global app configuration section
 app.set('views', 'cloud/views'); // Specify the folder to find templates
 app.set('view engine', 'ejs'); // Set the template engine
 app.use(express.bodyParser()); // Middleware for reading request body
 
 // This is an example of hooking up a request handler with a specific request
 // path and HTTP verb using the Express routing API.
 app.get('/hello', function(req, res) {
 res.render('hello', { message: 'Congrats, you just set up your app!' });
 });
 
 // Attach the Express app to Cloud Code.
 app.listen();
  • 52. Cloud Modules Cloud Code supports breaking up JavaScript code into modules. cloud/name.js var coolNames = ['Ralph', 'Skippy', 'Chip', 'Ned', 'Scooter'];
 exports.isACoolName = function(name) {
 return coolNames.indexOf(name) !== -1;
 } cloud/main.js var name = require('cloud/name.js');
 name.isACoolName('Fred'); // returns false
 name.isACoolName('Skippy'); // returns true;
 name.coolNames; // undefined. Pre-installed Cloud Modules var Crowdflower = require('crowdflower');
 Crowdflower.initialize('myAPIKey');
  • 53. Cloud Code limitations… Doesn’t support npm Can’t test locally Can’t debug…
  • 54. Parse Pricing Pricing that scales with your needs.
  • 55. Getting More Help Official Parse Tutorials https://www.parse.com/tutorials JavaScript Guide Documentation https://parse.com/docs/js_guide#javascript_guide JavaScript SDK Documentation http://parse.com/docs/js/