Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database...

83
Parse Jamie Karraker ’12 MEng ’13

Transcript of Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database...

Page 1: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

ParseJamie Karraker ’12 MEng ’13

Page 2: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Database

Page 3: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Database REST API

ZZZ

+

Page 4: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Database REST API

ZZZ

Server

++

+ users+ security

Page 5: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Database REST API

ZZZ

Server

++

+ users+ security

Networking

Page 6: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Database REST API

ZZZ

Server

++

+ users+ security

CachingNetworking

+

Page 7: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Database REST API

ZZZ

Server

++

+ users+ security

CachingNetworking

+ +

The fun stuff!

Page 8: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Database REST API

ZZZ

Server

++

+ users+ security

CachingNetworking

+ +

The fun stuff!

no

no

no

no

no

yes!

Page 9: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Android OS X WP8 Win 8 .NET Unity RESTiOS

JavaScript SDK

Page 10: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

DOCSparse.com/docs

Page 11: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

USERSThe in your app

Page 12: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Sign up a userParse.User.signUp("TimBeaver", "ihtfp");

Page 13: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Sign up a userParse.User.signUp("TimBeaver", "ihtfp");

Log in a userParse.User.logIn("TimBeaver", "ihtfp");

Page 14: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Sign up a userParse.User.signUp("TimBeaver", "ihtfp", {  success: function(user) {    // Do stuff after successful signup.  },  error: function(user, error) {    // The login failed. Check error to see why.  }}); Log in a user

Parse.User.logIn("TimBeaver", "ihtfp", {  success: function(user) {    // Do stuff after successful login.  },  error: function(user, error) {    // The login failed. Check error to see why.  }});

Page 15: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Facebook LoginParse.FacebookUtils.logIn(null, {  success: function(user) {    if (!user.existed()) {      // User signed up and logged in through Facebook!    } else {      // User logged in through Facebook!    }  },  error: function(user, error) {    // User cancelled the Facebook login or did not fully authorize.  }});

Page 16: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Facebook Login

Link Existing User

Parse.FacebookUtils.logIn(null, {  success: function(user) {    if (!user.existed()) {      // User signed up and logged in through Facebook!    } else {      // User logged in through Facebook!    }  },  error: function(user, error) {    // User cancelled the Facebook login or did not fully authorize.  }});

if (!Parse.FacebookUtils.isLinked(user)) {  Parse.FacebookUtils.link(user, null, {    success: function(user) {      // Woohoo, user logged in with Facebook!    },    error: function(user, error) {      // User cancelled the Facebook login or did not fully authorize.    }  });}

Page 17: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

DATASaving stuff in the

Page 18: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!
Page 19: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

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

Page 20: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

 gameScore.set("score", 1337);gameScore.set("player", Parse.User.current());gameScore.set("cheatMode", false);

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

Page 21: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

 gameScore.set("score", 1337);gameScore.set("player", Parse.User.current());gameScore.set("cheatMode", false);

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

gameScore.save();

Page 22: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

 gameScore.set("score", 1337);gameScore.set("player", Parse.User.current());gameScore.set("cheatMode", false);

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

gameScore.save();

Page 23: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

FILESSaving your Pictures in the

Page 24: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!
Page 25: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

HTML

<input type="file" id="profilePhotoFileUpload">

Page 26: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Save a Filevar file = $("#profilePhotoFileUpload")[0].files[0];var name = "photo.jpg";var parseFile = new Parse.File(name, file);parseFile.save(null, {  success: function(parseFile) { profileObject.set("photoFile", parseFile); profileObject.save(); }});

HTML

<input type="file" id="profilePhotoFileUpload">

Page 27: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Save a Filevar file = $("#profilePhotoFileUpload")[0].files[0];var name = "photo.jpg";var parseFile = new Parse.File(name, file);parseFile.save(null, {  success: function(parseFile) { profileObject.set("photoFile", parseFile); profileObject.save(); }});

HTML

<input type="file" id="profilePhotoFileUpload">

Retrieve a File var profilePhoto = profileObject.get("photoFile");$("#profileImg")[0].src = profilePhoto.url();

Page 28: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

DATA BROWSERBecause sometimes you just want to see your data

Page 29: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!
Page 30: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

QUERIESGetting stuff from the

Page 31: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!
Page 32: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

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

Page 33: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

query.equalTo("player", Parse.User.current());

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

Page 34: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

query.equalTo("player", Parse.User.current());

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

query.find();

Page 35: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

var query = new Parse.Query(“GameScore");

query.equalTo("player", Parse.User.current());

query.find({  success: function(gameScores) {   // Do something with the returned Parse.Object array  },  error: function(error) {    alert("Error: " + error.code + " " + error.message);  }});

Page 36: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

RELATIONSIt’s better together

Page 37: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!
Page 38: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

var user = Parse.User.current();

Page 39: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

var user = Parse.User.current();var gameScore = new GameScore();

Page 40: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

var user = Parse.User.current();var gameScore = new GameScore();gameScore.set("player", user);

Page 41: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!
Page 42: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

var user = Parse.User.current();

Page 43: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

var user = Parse.User.current();var relation = user.relation("friends");

Page 44: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

var user = Parse.User.current();var relation = user.relation("friends");relation.add(newFriend);

Page 45: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

var user = Parse.User.current();var relation = user.relation("friends");relation.add(newFriend);relation.add(anotherFriend);

Page 46: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

var user = Parse.User.current();var relation = user.relation("friends");relation.add(newFriend);relation.add(anotherFriend);user.save();

Page 47: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

CLOUD CODEIt’s code in the

Page 48: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Before SaveParse.Cloud.beforeSave("Review", function(request, response) { var comment = request.object.get("comment"); if (comment.length > 140) { // Truncate and add a ... request.object.set("comment", comment.substring(0, 137) + "..."); } response.success(); });

Page 49: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Before SaveParse.Cloud.beforeSave("Review", function(request, response) { var comment = request.object.get("comment"); if (comment.length > 140) { // Truncate and add a ... request.object.set("comment", comment.substring(0, 137) + "..."); } response.success(); }); After Save

Parse.Cloud.afterSave("Review", function(request) { query = new Parse.Query("Movie"); query.get(request.object.get("movie").id, { success: function(movie) { movie.increment("reviews"); movie.save(); } });});

Page 50: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Cloud Modules

Page 51: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Cloud Modules

Page 52: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Cloud Modules

Stripevar Stripe = require('stripe');Stripe.initialize('mySecretKey');

Stripe.Charges.create({  amount: 100 * 10, // $10 expressed in cents  currency: "usd",  card: "tok_3TnIVhEv9P24T0" // stripe token id});

Page 53: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

PARSE HOSTINGOverviewStatic HostingDynamic HostingAny Meme Lite Example

Page 54: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

The Spectrum

Page 55: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

The Spectrum

Page 56: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

The Spectrum

PARSE HOSTING

Page 57: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Static Hosting

Page 58: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Static Hosting

• Choose a domain: myapp.parseapp.com (or custom)

Page 59: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Static Hosting

• Choose a domain: myapp.parseapp.com (or custom)

• Initialize your parse directory

Page 60: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Static Hosting

• Choose a domain: myapp.parseapp.com (or custom)

• Initialize your parse directory

• Create public/helloword.html

Page 61: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Static Hosting

• Choose a domain: myapp.parseapp.com (or custom)

• Initialize your parse directory

• Create public/helloword.html

• Type parse deploy

Page 62: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Static Hosting

• Choose a domain: myapp.parseapp.com (or custom)

• Initialize your parse directory

• Create public/helloword.html

• Type parse deploy

• Your web page is live

Page 63: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Live Demo: Todos

Page 64: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Dynamic Hosting

Page 65: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Dynamic Hosting

express.js

Page 66: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

express.js

Page 67: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

express.js

• Web framework built for node.js

Page 68: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

express.js

• Web framework built for node.js

• Node.js is server-side JavaScript

Page 69: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

express.js

• Web framework built for node.js

• Node.js is server-side JavaScript

• Now with Cloud Code + Parse JS SDK

Page 70: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

express.js

• Web framework built for node.js

• Node.js is server-side JavaScript

• Now with Cloud Code + Parse JS SDK

• Simple but expressive

Page 71: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Directory Structure

-cloud/  main.js            Cloud Code  app.js             Express code  -views/            View templates    hello.ejs-public/  example.html       Static HTML files  -stylesheets/      CSS stylesheets    style.css

Page 72: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Workflow

Page 73: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Workflow

• Install Command Line Tool athttps://www.parse.com/docs/hosting_guide

Page 74: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Workflow

• Install Command Line Tool athttps://www.parse.com/docs/hosting_guide

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

Page 75: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Workflow

• Install Command Line Tool athttps://www.parse.com/docs/hosting_guide

• One time set up. Create a local code directory

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

Page 76: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Workflow

• Install Command Line Tool athttps://www.parse.com/docs/hosting_guide

• One time set up. Create a local code directory$ parse new MyWebsite

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

Page 77: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Workflow

• Install Command Line Tool athttps://www.parse.com/docs/hosting_guide

• One time set up. Create a local code directory

• Make code changes$ parse new MyWebsite

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

Page 78: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Workflow

• Install Command Line Tool athttps://www.parse.com/docs/hosting_guide

• One time set up. Create a local code directory

• Make code changes$ parse new MyWebsite

$ vi MyWebsite/cloud/app.js

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

Page 79: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Workflow

• Install Command Line Tool athttps://www.parse.com/docs/hosting_guide

• One time set up. Create a local code directory

• Make code changes

• Deploy to the cloud

$ parse new MyWebsite

$ vi MyWebsite/cloud/app.js

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

Page 80: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Workflow

• Install Command Line Tool athttps://www.parse.com/docs/hosting_guide

• One time set up. Create a local code directory

• Make code changes

• Deploy to the cloud

$ parse new MyWebsite

$ vi MyWebsite/cloud/app.js

$ parse deploy

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

Page 81: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Live Demo: AnyMeme

Page 82: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

What Else?

• Full blown web apps

• Admin interfaces • Analytics

• Mobile SDKs

• Push Notifications

• Free! (until you get really big)

Page 83: Parse MIT IAP slides 20156.470.scripts.mit.edu/2015/pages/lectures/WEBday9-parse.pdf · Database REST API Z Z Z Server + + + users + security Networking Caching + + The fun stuff!

Further Reading

• JS SDK guide: parse.com/docs/js_guide

• Hosting guide: parse.com/docs/hosting_guide

• Express: expressjs.com

• Anymeme: www.anymeme.org

• Todo App: todolist.parseapp.com

• Tutorials: parse.com/tutorials

• Source code: github.com/ParsePlatform