rest easy with deployd
DESCRIPTION
Deployd is an open source platform, built on NodeJS and MongoDB, that allows you to create custom JSON API's in minutes, not days. In this brief talk, Boydlee will explain what the Deployd platform is and show you how it really is the simplest way to design, build and manage a REST API. We'll create our collections and API interfaces in real time, extending them with custom JavaScript events and explain how you can further customise your Deployd installation using standard NodeJS modules.TRANSCRIPT
![Page 1: REST Easy with Deployd](https://reader035.vdocument.in/reader035/viewer/2022070302/54793178b4795990098b46fa/html5/thumbnails/1.jpg)
Deployd
REST Easy with Deployd
Boydlee Pollentine @boydleep
![Page 2: REST Easy with Deployd](https://reader035.vdocument.in/reader035/viewer/2022070302/54793178b4795990098b46fa/html5/thumbnails/2.jpg)
Who am I?
Author of Appcelerator Titanium CookbookAuthor of Titanium Best Practices
Run a Digital Agency in NorwichFormer .NET Developer (don’t hate me)
Run tiConf – a Titanium & JavaScript Mobile Conference in the EU, US and Australia
![Page 3: REST Easy with Deployd](https://reader035.vdocument.in/reader035/viewer/2022070302/54793178b4795990098b46fa/html5/thumbnails/3.jpg)
What is Deployd?In a nutshell…
Deployd allows you to design, build and scale API’s for web and mobile apps in
minutes.It’s free, and open source.
![Page 4: REST Easy with Deployd](https://reader035.vdocument.in/reader035/viewer/2022070302/54793178b4795990098b46fa/html5/thumbnails/4.jpg)
It even comes with a full dashboard system to allow you to create and manage your collection
API’s, create Events and insert/edit data records.
It’s built on top of Node.JS and MongoDB so you know it’s going to be fast, and
scalable.
![Page 5: REST Easy with Deployd](https://reader035.vdocument.in/reader035/viewer/2022070302/54793178b4795990098b46fa/html5/thumbnails/5.jpg)
Create RESTful API’s through design…
Deployd is built around a series of REST calls that let’s you create “CRUD” collections (GET, DEL, PUT, POST).
![Page 6: REST Easy with Deployd](https://reader035.vdocument.in/reader035/viewer/2022070302/54793178b4795990098b46fa/html5/thumbnails/6.jpg)
The Deployd Dashboard
![Page 7: REST Easy with Deployd](https://reader035.vdocument.in/reader035/viewer/2022070302/54793178b4795990098b46fa/html5/thumbnails/7.jpg)
Scripted Logic through Events…
It uses “Events” for each of the REST methods to allow you to intercept calls
and inject your own business logic code.
![Page 8: REST Easy with Deployd](https://reader035.vdocument.in/reader035/viewer/2022070302/54793178b4795990098b46fa/html5/thumbnails/8.jpg)
Events Logic Screen
![Page 9: REST Easy with Deployd](https://reader035.vdocument.in/reader035/viewer/2022070302/54793178b4795990098b46fa/html5/thumbnails/9.jpg)
Access Other Collections & Join
Results…
You can use the built-in DPD library to access other collections in your Deployd database and script business logic based
on those queries…
![Page 10: REST Easy with Deployd](https://reader035.vdocument.in/reader035/viewer/2022070302/54793178b4795990098b46fa/html5/thumbnails/10.jpg)
Accessing Collections via DPD
![Page 11: REST Easy with Deployd](https://reader035.vdocument.in/reader035/viewer/2022070302/54793178b4795990098b46fa/html5/thumbnails/11.jpg)
Full User login, logout and creation support
out of the box…
You can use the built-in “user” collection type to automatically manage your
system logins, logouts and user creations.
![Page 12: REST Easy with Deployd](https://reader035.vdocument.in/reader035/viewer/2022070302/54793178b4795990098b46fa/html5/thumbnails/12.jpg)
You can restrict access to certain
REST calls by throwing “cancel”…
![Page 13: REST Easy with Deployd](https://reader035.vdocument.in/reader035/viewer/2022070302/54793178b4795990098b46fa/html5/thumbnails/13.jpg)
As well as throwing errors, determining if a property has changed
& more…
protect() = don’t allow updates for this propertyprevious() = object containing previous item valueschanged() = informs if a property item was updated
hide() = hides a property in your REST responseerror() / errorif() = adds an error message to the
response
![Page 14: REST Easy with Deployd](https://reader035.vdocument.in/reader035/viewer/2022070302/54793178b4795990098b46fa/html5/thumbnails/14.jpg)
Use Modules to perform tasks that Deployd doesn’t already do…..
There’s a number of Deployd modules already available for sending e-mail and get files from
Amazon S3, amongst other things.
They’re based on Node Packages, so you can re-use any Node.JS package with NPM!
![Page 15: REST Easy with Deployd](https://reader035.vdocument.in/reader035/viewer/2022070302/54793178b4795990098b46fa/html5/thumbnails/15.jpg)
So, what is it good for?
A Case Study
Smarter Learn – Education Portal & Analytics Enginewww.smarterlearn.com
![Page 16: REST Easy with Deployd](https://reader035.vdocument.in/reader035/viewer/2022070302/54793178b4795990098b46fa/html5/thumbnails/16.jpg)
Smarter Learn
![Page 17: REST Easy with Deployd](https://reader035.vdocument.in/reader035/viewer/2022070302/54793178b4795990098b46fa/html5/thumbnails/17.jpg)
The BriefBuild a system that was:
Able to create API’s “on – the – fly”Highly scalable with high availability
Could easily be integrated into both web and mobile
And above all, cheap!
![Page 18: REST Easy with Deployd](https://reader035.vdocument.in/reader035/viewer/2022070302/54793178b4795990098b46fa/html5/thumbnails/18.jpg)
How we did it…Cloud servers are amazing.
Built on top of Linux Cloud servers via RackspaceExternal MongoDB connection
We can scale as required (e.g. on launch of a new game)
Allows us to easily install Load Balancing Analytics get stored long term into a MySQL Cloud
server
![Page 19: REST Easy with Deployd](https://reader035.vdocument.in/reader035/viewer/2022070302/54793178b4795990098b46fa/html5/thumbnails/19.jpg)
Overcoming obstacles
Nothing is perfect.
We built a custom token-based authentication system,We extended “Forever” scripts to ensure better up-time,
Long running API calls can use significant temporary memory – don’t run Deployd without at least 1GB+ RAM.
IE 8.
Node modules allow you to easily overcome any obstacles!
![Page 20: REST Easy with Deployd](https://reader035.vdocument.in/reader035/viewer/2022070302/54793178b4795990098b46fa/html5/thumbnails/20.jpg)
The end result…
Thousands of API calls per hour
Easily built into a Responsive Website and an app to come using Deployd’s
Appcelerator Titanium Module
![Page 21: REST Easy with Deployd](https://reader035.vdocument.in/reader035/viewer/2022070302/54793178b4795990098b46fa/html5/thumbnails/21.jpg)
The end result…
![Page 22: REST Easy with Deployd](https://reader035.vdocument.in/reader035/viewer/2022070302/54793178b4795990098b46fa/html5/thumbnails/22.jpg)
The end result…
![Page 23: REST Easy with Deployd](https://reader035.vdocument.in/reader035/viewer/2022070302/54793178b4795990098b46fa/html5/thumbnails/23.jpg)
Even if it’s not your first choice for production…
It is an amazing quick and easy way to build out API’s for websites, mobile apps
or just prototyping ideas.
![Page 24: REST Easy with Deployd](https://reader035.vdocument.in/reader035/viewer/2022070302/54793178b4795990098b46fa/html5/thumbnails/24.jpg)
There’s a tonne of examples at Deployd.com
There’s plenty of sample apps at Deployd.com that show what you can do with the system, including integration
with AngularJS and other Node.JS based systems.
GitHub Sourcehttp://github.com/deployd
![Page 25: REST Easy with Deployd](https://reader035.vdocument.in/reader035/viewer/2022070302/54793178b4795990098b46fa/html5/thumbnails/25.jpg)
Super Awesome Fast Prototype Time