SlideShare a Scribd company logo
1 of 30
Welcome to Facebook Developer Circle Meetup
* Date: Sunday, 26 Mar 2017
* Place: Ngalup.co, Mojolangu, Malang
Last login: Sun Mar 26 09:00:00 2017 from 127.0.0.1
marudits@dev-circle-mlg:~$ _
Learn Developing REST API
in Node.js using LoopBack Framework
by Marudi Tri Subakti
Welcome to Facebook Developer Circle Meetup
* Date: Sunday, 26 Mar 2017
* Place: Ngalup.co, Mojolangu, Malang
Last login: Sun Mar 26 09:00:00 2017 from 127.0.0.1
marudits@dev-circle-mlg:~$ whoami _
PART
1
{
“name”: “Marudi Tri Subakti”,
“phone”: “(+62) 85646628435”,
“email”: “marudits@gmail.com”,
“works”:[
{
“company”: “PT Musica Studio’s”,
“role”: “Web Developer”,
}, {
“company”: “Tebengan ID”,
“role”: “Web Developer”
}
]
}
Welcome to Facebook Developer Circle Meetup
* Date: Sunday, 26 Mar 2017
* Place: Ngalup.co, Mojolangu, Malang
Last login: Sun Mar 26 09:00:00 2017 from 127.0.0.1
marudits@dev-circle-mlg:~$ whoami
marudits@dev-circle-mlg:~$ man –k ‘REST API’ _
What is?
• Put it simply, REST = REpresentational State Transfer , is an architectural style
define to help create and organize distributed system.
• It is not a guideline, not a standard, or anything that would imply that there are
set a hard of rule to follow
3
PART
21
• There is no Request for Comments (RFC), which can leads to a widespread
incomplete REST ideal
• But have set of contraints to define uniform interface: Client-Server, Stateless,
Cacheable, Uniform Interface, Layered System, Code-on-Demand
Why?
• Performance, communication style is meant to be efficient and simple
3
PART
21
• Scalability, simple interaction greatly allow to handle heavy interaction
• Modifiability, separation of concerns allow to minimize risk
• Portability, can be implemented and consumed by many type of technology
• Reliability, allows for the easier recovery of system after failure
How it works? (Resources)
• Representations
3
PART
21
• Identifier
• Metadata
• Control Data
How it works? (Resources)
• Representations, it can be any way of representing data (binary, JSON, XML, etc)
3
PART
21
• Identifier
• Metadata
• Control Data
How it works? (Resources)
• Representations
3
PART
21
• Identifier, a URL that retrieves only one specific resource at any given time
• Metadata
• Control Data
How it works? (Resources)
• Representations
3
PART
21
• Identifier
• Metadata, Content-type, last-modified time, and so forth
• Control Data, is-modifiable-since, cache-control
Welcome to Facebook Developer Circle Meetup
* Date: Sunday, 26 Mar 2017
* Place: Ngalup.co, Mojolangu, Malang
Last login: Sun Mar 26 09:00:00 2017 from 127.0.0.1
marudits@dev-circle-mlg:~$ whoami
marudits@dev-circle-mlg:~$ man –k ‘REST API’
marudits@dev-circle-mlg:~$ lb --help _
PART
3
42
What is?
• LoopBack framework is a set of Node.js modules that you can use
independently or together to quickly build REST APIs
• Interacts with data sources through the LoopBack model API, available locally
within Node.js, remotely over REST, and via native client APIs for iOS, Android,
and HTML5
• Apps can query databases, store data, upload files, send emails, create push
notifications, register users, and perform other actions provided by data
sources and services.
Introduction
PART
3
42
What is?
Architecture
• Create dynamic end-to-end REST APIs with little or no coding
PART
3
42
Why we use?
• Access data from various data source: major relational databases, MongoDB,
SOAP and REST APIs
• Incorporate model relationships and access controls for complex APIs
• Separable components for file storage, third-party login, and OAuth 2.0
• MIT open-source license
PART
3
42
Why we use?
Loopback Express Sails Meteor
Type API Framework HTTP server
library
Web MVC
framework
Full-stack JavaScript
app platform
Top
Features
Enterprise connectivity, API Explorer,
generators, client SDKs, websocket
microservices
HTTP
routing,
middleware
Rails familiarity,
MVC
Universal JavaScript,
reactive rendering,
websocket
microservices
Suitable
For
Web apps, APIs Simple web
apps
Web apps, APIs Web apps
Clint
SDKs
Angular, Browser, Node.js, iOS, Android,
Xamarin
N/A None JavaScript, Cordova
for iOS and Android,
React, AngularJS
Data
Source
In-memory/file, MongoDB, MySQL,
Oracle, PostgreSQL, SQL Server, ATG,
Email, REST, SOAP, many more.
None In-memory, File,
PostgreSQL, MySQL,
MongoDB
MongoDB, MySQL
and PostgreSQL via
3rd-party packages
ACLs Yes No No Basic allow/deny
Comparation
PART
3
42
Why we use?
“By using LoopBack, we can build REST API easily
with little or no coding, connect to various
datasources and define model relationship & its
control access.”
PART
3
42
How it works?
Core Concepts (Modules)
PART
3
42
How it works?
• Models : Dynamically mock-up models and expose them as APIs without worrying
about persisting
(some) Key Features
• Abstraction : Connect to multiple data sources or services and get back an
abstracted model with CRUD capabilities independent of backing data source.
• Data : Enable connections to RDBMS and noSQL data sources and get back an
abstracted model
• ACL : Controls if a principal can perform a certain operation against a model.
• Remote Method : exposed remote method over a custom REST endpoint to
perform operations not provided by LoopBack’s standard model REST API
• Remote Hook : executed before or after calling a remote method, either a
custom remote method or a standard CRUD inherited from PersistedModel
PART
3
42
Getting Started
• Install : Install the LoopBack CLI tool
$ npm install –g loopback-cli
• Create App : Create a “Hello World” LoopBack application
$ lb
• Create Models : Generate models through CLI
$ lb model
• Run : Run as you would any Node application
$ node .
• Explore : Enables you to exercise all generated API endpoints
http://127.0.0.1:3000/explorer
Welcome to Facebook Developer Circle Meetup
* Date: Sunday, 26 Mar 2017
* Place: Ngalup.co, Mojolangu, Malang
Last login: Sun Mar 26 09:00:00 2017 from 127.0.0.1
marudits@dev-circle-mlg:~$ whoami
marudits@dev-circle-mlg:~$ man –k ‘REST API’
marudits@dev-circle-mlg:~$ lb --help
marudits@dev-circle-mlg:~$ npm run start _
i
< />
{ }
i
< />
{ }
http://loopback.io/
i
< />
{ }
/* install loopback */
$ npm install –g loopback-cli
/* create app */
$ lb
/* create models */
$ lb model
/* attach to datasource */
$ lb datasource
/* define relations */
$ lb relation
/* run app */
$ node .
/*  develop your own */
/* set access control */
$ lb acl
i
< />
{ }
https://ant.design/
i
< />
{ }
/* install antd-init generator */
$ npm install –g antd-init
/* make and move to app directory */
$ mkdir helloworld && cd helloworld
/* create app */
$ antd-init
/* run app */
$ npm start
/*  develop your own */
Welcome to Facebook Developer Circle Meetup
* Date: Sunday, 26 Mar 2017
* Place: Ngalup.co, Mojolangu, Malang
Last login: Sun Mar 26 09:00:00 2017 from 127.0.0.1
marudits@dev-circle-mlg:~$ whoami
marudits@dev-circle-mlg:~$ man –k ‘REST API’
marudits@dev-circle-mlg:~$ lb --help
marudits@dev-circle-mlg:~$ npm run start
marudits@dev-circle-mlg:~$ ping tebengan.id _
Should our stories resonate with you, why not
share your stories and aspiration with us
and help build tebengan together (?)
build@tebengan.id
Welcome to Facebook Developer Circle Meetup
* Date: Sunday, 26 Mar 2017
* Place: Ngalup.co, Mojolangu, Malang
Last login: Sun Mar 26 09:00:00 2017 from 127.0.0.1
marudits@dev-circle-mlg:~$ whoami
marudits@dev-circle-mlg:~$ man –k ‘REST API’
marudits@dev-circle-mlg:~$ lb --help
marudits@dev-circle-mlg:~$ npm run start
marudits@dev-circle-mlg:~$ ping tebengan.id
marudits@dev-circle-mlg:~$ shutdown –h now _
Learn Developing REST API
in Node.js using LoopBack Framework
by Marudi Tri Subakti

More Related Content

What's hot

Beginning MEAN Stack
Beginning MEAN StackBeginning MEAN Stack
Beginning MEAN StackRob Davarnia
 
Working with LoopBack Models
Working with LoopBack ModelsWorking with LoopBack Models
Working with LoopBack ModelsRaymond Feng
 
Making Single Page Applications (SPA) faster
Making Single Page Applications (SPA) faster Making Single Page Applications (SPA) faster
Making Single Page Applications (SPA) faster Boris Livshutz
 
LoopBack: a productivity booster for MEAN
LoopBack: a productivity booster for MEANLoopBack: a productivity booster for MEAN
LoopBack: a productivity booster for MEANMiroslav Bajtoš
 
Building Mobile Apps With Ionic & Loopback
Building Mobile Apps With Ionic & LoopbackBuilding Mobile Apps With Ionic & Loopback
Building Mobile Apps With Ionic & LoopbackChibuzor Obiora
 
Building a Single-Page App: Backbone, Node.js, and Beyond
Building a Single-Page App: Backbone, Node.js, and BeyondBuilding a Single-Page App: Backbone, Node.js, and Beyond
Building a Single-Page App: Backbone, Node.js, and BeyondSpike Brehm
 
Introduction To Single Page Application
Introduction To Single Page ApplicationIntroduction To Single Page Application
Introduction To Single Page ApplicationKMS Technology
 
Building Modern Web Apps with MEAN Stack
Building Modern Web Apps with MEAN StackBuilding Modern Web Apps with MEAN Stack
Building Modern Web Apps with MEAN StackSuresh Patidar
 
Mvvm knockout vs angular
Mvvm knockout vs angularMvvm knockout vs angular
Mvvm knockout vs angularBasarat Syed
 
Introduction to JavaScript Full Stack
Introduction to JavaScript Full StackIntroduction to JavaScript Full Stack
Introduction to JavaScript Full StackMindfire Solutions
 
Moving from PHP to a nodejs full stack CMS
Moving from PHP to a nodejs full stack CMSMoving from PHP to a nodejs full stack CMS
Moving from PHP to a nodejs full stack CMSMake & Build
 
Server rendering-talk
Server rendering-talkServer rendering-talk
Server rendering-talkDaiwei Lu
 
Deep dive into Vue.js
Deep dive into Vue.jsDeep dive into Vue.js
Deep dive into Vue.js선협 이
 
Full stack JavaScript - the folly of choice
Full stack JavaScript - the folly of choiceFull stack JavaScript - the folly of choice
Full stack JavaScript - the folly of choiceFDConf
 
Single Page WebApp Architecture
Single Page WebApp ArchitectureSingle Page WebApp Architecture
Single Page WebApp ArchitectureMorgan Cheng
 
introduction to Vue.js 3
introduction to Vue.js 3 introduction to Vue.js 3
introduction to Vue.js 3 ArezooKmn
 
Introduction to Vue.js DevStaff Meetup 13.02
Introduction to Vue.js  DevStaff Meetup 13.02Introduction to Vue.js  DevStaff Meetup 13.02
Introduction to Vue.js DevStaff Meetup 13.02Paul Bele
 
The MEAN stack - SoCalCodeCamp - june 29th 2014
The MEAN stack - SoCalCodeCamp - june 29th 2014The MEAN stack - SoCalCodeCamp - june 29th 2014
The MEAN stack - SoCalCodeCamp - june 29th 2014Simona Clapan
 
FULL stack -> MEAN stack
FULL stack -> MEAN stackFULL stack -> MEAN stack
FULL stack -> MEAN stackAshok Raj
 
Kickstarting Node.js Projects with Yeoman
Kickstarting Node.js Projects with YeomanKickstarting Node.js Projects with Yeoman
Kickstarting Node.js Projects with YeomanPatrick Buergin
 

What's hot (20)

Beginning MEAN Stack
Beginning MEAN StackBeginning MEAN Stack
Beginning MEAN Stack
 
Working with LoopBack Models
Working with LoopBack ModelsWorking with LoopBack Models
Working with LoopBack Models
 
Making Single Page Applications (SPA) faster
Making Single Page Applications (SPA) faster Making Single Page Applications (SPA) faster
Making Single Page Applications (SPA) faster
 
LoopBack: a productivity booster for MEAN
LoopBack: a productivity booster for MEANLoopBack: a productivity booster for MEAN
LoopBack: a productivity booster for MEAN
 
Building Mobile Apps With Ionic & Loopback
Building Mobile Apps With Ionic & LoopbackBuilding Mobile Apps With Ionic & Loopback
Building Mobile Apps With Ionic & Loopback
 
Building a Single-Page App: Backbone, Node.js, and Beyond
Building a Single-Page App: Backbone, Node.js, and BeyondBuilding a Single-Page App: Backbone, Node.js, and Beyond
Building a Single-Page App: Backbone, Node.js, and Beyond
 
Introduction To Single Page Application
Introduction To Single Page ApplicationIntroduction To Single Page Application
Introduction To Single Page Application
 
Building Modern Web Apps with MEAN Stack
Building Modern Web Apps with MEAN StackBuilding Modern Web Apps with MEAN Stack
Building Modern Web Apps with MEAN Stack
 
Mvvm knockout vs angular
Mvvm knockout vs angularMvvm knockout vs angular
Mvvm knockout vs angular
 
Introduction to JavaScript Full Stack
Introduction to JavaScript Full StackIntroduction to JavaScript Full Stack
Introduction to JavaScript Full Stack
 
Moving from PHP to a nodejs full stack CMS
Moving from PHP to a nodejs full stack CMSMoving from PHP to a nodejs full stack CMS
Moving from PHP to a nodejs full stack CMS
 
Server rendering-talk
Server rendering-talkServer rendering-talk
Server rendering-talk
 
Deep dive into Vue.js
Deep dive into Vue.jsDeep dive into Vue.js
Deep dive into Vue.js
 
Full stack JavaScript - the folly of choice
Full stack JavaScript - the folly of choiceFull stack JavaScript - the folly of choice
Full stack JavaScript - the folly of choice
 
Single Page WebApp Architecture
Single Page WebApp ArchitectureSingle Page WebApp Architecture
Single Page WebApp Architecture
 
introduction to Vue.js 3
introduction to Vue.js 3 introduction to Vue.js 3
introduction to Vue.js 3
 
Introduction to Vue.js DevStaff Meetup 13.02
Introduction to Vue.js  DevStaff Meetup 13.02Introduction to Vue.js  DevStaff Meetup 13.02
Introduction to Vue.js DevStaff Meetup 13.02
 
The MEAN stack - SoCalCodeCamp - june 29th 2014
The MEAN stack - SoCalCodeCamp - june 29th 2014The MEAN stack - SoCalCodeCamp - june 29th 2014
The MEAN stack - SoCalCodeCamp - june 29th 2014
 
FULL stack -> MEAN stack
FULL stack -> MEAN stackFULL stack -> MEAN stack
FULL stack -> MEAN stack
 
Kickstarting Node.js Projects with Yeoman
Kickstarting Node.js Projects with YeomanKickstarting Node.js Projects with Yeoman
Kickstarting Node.js Projects with Yeoman
 

Viewers also liked

AllcountJS VTB24 loan сonveyor POC
AllcountJS VTB24 loan сonveyor POCAllcountJS VTB24 loan сonveyor POC
AllcountJS VTB24 loan сonveyor POCPavel Tiunov
 
Web В РЕАЛЬНОМ ВРЕМЕНИ С Node.js - AgileBaseCamp - 2012
Web В РЕАЛЬНОМ ВРЕМЕНИ С Node.js - AgileBaseCamp - 2012Web В РЕАЛЬНОМ ВРЕМЕНИ С Node.js - AgileBaseCamp - 2012
Web В РЕАЛЬНОМ ВРЕМЕНИ С Node.js - AgileBaseCamp - 2012Dmytro Mindra
 
Moscow js node.js enterprise development
Moscow js node.js enterprise developmentMoscow js node.js enterprise development
Moscow js node.js enterprise developmentPavel Tiunov
 
Use Node.js to create a REST API
Use Node.js to create a REST APIUse Node.js to create a REST API
Use Node.js to create a REST APIFabien Vauchelles
 
ВВЕДЕНИЕ В NODE.JS
ВВЕДЕНИЕ В NODE.JS ВВЕДЕНИЕ В NODE.JS
ВВЕДЕНИЕ В NODE.JS Pavel Tsukanov
 
Introduction to REST API with Node.js
Introduction to REST API with Node.jsIntroduction to REST API with Node.js
Introduction to REST API with Node.jsYoann Gotthilf
 
Архитектура программных систем на Node.js
Архитектура программных систем на Node.jsАрхитектура программных систем на Node.js
Архитектура программных систем на Node.jsTimur Shemsedinov
 
Асинхронность и параллелизм в Node.js
Асинхронность и параллелизм в Node.jsАсинхронность и параллелизм в Node.js
Асинхронность и параллелизм в Node.jsGeeksLab Odessa
 
Developing and Testing a MongoDB and Node.js REST API
Developing and Testing a MongoDB and Node.js REST APIDeveloping and Testing a MongoDB and Node.js REST API
Developing and Testing a MongoDB and Node.js REST APIAll Things Open
 
Anatomy of a Modern Node.js Application Architecture
Anatomy of a Modern Node.js Application Architecture Anatomy of a Modern Node.js Application Architecture
Anatomy of a Modern Node.js Application Architecture AppDynamics
 
Инфраструктура распределенных приложений на Node.js
Инфраструктура распределенных приложений на Node.jsИнфраструктура распределенных приложений на Node.js
Инфраструктура распределенных приложений на Node.jsStanislav Gumeniuk
 

Viewers also liked (12)

Node.js (RichClient)
 Node.js (RichClient) Node.js (RichClient)
Node.js (RichClient)
 
AllcountJS VTB24 loan сonveyor POC
AllcountJS VTB24 loan сonveyor POCAllcountJS VTB24 loan сonveyor POC
AllcountJS VTB24 loan сonveyor POC
 
Web В РЕАЛЬНОМ ВРЕМЕНИ С Node.js - AgileBaseCamp - 2012
Web В РЕАЛЬНОМ ВРЕМЕНИ С Node.js - AgileBaseCamp - 2012Web В РЕАЛЬНОМ ВРЕМЕНИ С Node.js - AgileBaseCamp - 2012
Web В РЕАЛЬНОМ ВРЕМЕНИ С Node.js - AgileBaseCamp - 2012
 
Moscow js node.js enterprise development
Moscow js node.js enterprise developmentMoscow js node.js enterprise development
Moscow js node.js enterprise development
 
Use Node.js to create a REST API
Use Node.js to create a REST APIUse Node.js to create a REST API
Use Node.js to create a REST API
 
ВВЕДЕНИЕ В NODE.JS
ВВЕДЕНИЕ В NODE.JS ВВЕДЕНИЕ В NODE.JS
ВВЕДЕНИЕ В NODE.JS
 
Introduction to REST API with Node.js
Introduction to REST API with Node.jsIntroduction to REST API with Node.js
Introduction to REST API with Node.js
 
Архитектура программных систем на Node.js
Архитектура программных систем на Node.jsАрхитектура программных систем на Node.js
Архитектура программных систем на Node.js
 
Асинхронность и параллелизм в Node.js
Асинхронность и параллелизм в Node.jsАсинхронность и параллелизм в Node.js
Асинхронность и параллелизм в Node.js
 
Developing and Testing a MongoDB and Node.js REST API
Developing and Testing a MongoDB and Node.js REST APIDeveloping and Testing a MongoDB and Node.js REST API
Developing and Testing a MongoDB and Node.js REST API
 
Anatomy of a Modern Node.js Application Architecture
Anatomy of a Modern Node.js Application Architecture Anatomy of a Modern Node.js Application Architecture
Anatomy of a Modern Node.js Application Architecture
 
Инфраструктура распределенных приложений на Node.js
Инфраструктура распределенных приложений на Node.jsИнфраструктура распределенных приложений на Node.js
Инфраструктура распределенных приложений на Node.js
 

Similar to Learn Developing REST API in Node.js using LoopBack Framework

Lessons from Highly Scalable Architectures at Social Networking Sites
Lessons from Highly Scalable Architectures at Social Networking SitesLessons from Highly Scalable Architectures at Social Networking Sites
Lessons from Highly Scalable Architectures at Social Networking SitesPatrick Senti
 
NoSQL Now 2013 Presentation
NoSQL Now 2013 PresentationNoSQL Now 2013 Presentation
NoSQL Now 2013 PresentationArjen Schoneveld
 
Front End Development for Back End Developers - vJUG24 2017
Front End Development for Back End Developers - vJUG24 2017Front End Development for Back End Developers - vJUG24 2017
Front End Development for Back End Developers - vJUG24 2017Matt Raible
 
Rails Gems realize RESTful modeling patterns
Rails Gems realize RESTful modeling patternsRails Gems realize RESTful modeling patterns
Rails Gems realize RESTful modeling patternsToru Kawamura
 
mDevCamp - The Best from Google IO
mDevCamp - The Best from Google IOmDevCamp - The Best from Google IO
mDevCamp - The Best from Google IOondraz
 
01 nosql and multi model database
01   nosql and multi model database01   nosql and multi model database
01 nosql and multi model databaseMahdi Atawneh
 
Back to Basics 2017: Mí primera aplicación MongoDB
Back to Basics 2017: Mí primera aplicación MongoDBBack to Basics 2017: Mí primera aplicación MongoDB
Back to Basics 2017: Mí primera aplicación MongoDBMongoDB
 
SQL to NoSQL: Top 6 Questions
SQL to NoSQL: Top 6 QuestionsSQL to NoSQL: Top 6 Questions
SQL to NoSQL: Top 6 QuestionsMike Broberg
 
Introducing the Seneca MVP framework for Node.js
Introducing the Seneca MVP framework for Node.jsIntroducing the Seneca MVP framework for Node.js
Introducing the Seneca MVP framework for Node.jsRichard Rodger
 
Engage 2023: Taking Domino Apps to the next level by providing a Rest API
Engage 2023: Taking Domino Apps to the next level by providing a Rest APIEngage 2023: Taking Domino Apps to the next level by providing a Rest API
Engage 2023: Taking Domino Apps to the next level by providing a Rest APISerdar Basegmez
 
Construindo APIs Usando Rails
Construindo APIs Usando RailsConstruindo APIs Usando Rails
Construindo APIs Usando RailsFernando Kakimoto
 
Project report | Major Project | Engineering | Devansh Koolwal
Project report | Major Project | Engineering | Devansh KoolwalProject report | Major Project | Engineering | Devansh Koolwal
Project report | Major Project | Engineering | Devansh KoolwalDevansh Koolwal
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...Mark Leusink
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...Mark Roden
 
Android Intermediatte IAK full
Android Intermediatte IAK fullAndroid Intermediatte IAK full
Android Intermediatte IAK fullAhmad Arif Faizin
 
Tek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJSTek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJSPablo Godel
 
Denver emberjs-sept-2015
Denver emberjs-sept-2015Denver emberjs-sept-2015
Denver emberjs-sept-2015Ron White
 

Similar to Learn Developing REST API in Node.js using LoopBack Framework (20)

Lessons from Highly Scalable Architectures at Social Networking Sites
Lessons from Highly Scalable Architectures at Social Networking SitesLessons from Highly Scalable Architectures at Social Networking Sites
Lessons from Highly Scalable Architectures at Social Networking Sites
 
NoSQL Now 2013 Presentation
NoSQL Now 2013 PresentationNoSQL Now 2013 Presentation
NoSQL Now 2013 Presentation
 
Front End Development for Back End Developers - vJUG24 2017
Front End Development for Back End Developers - vJUG24 2017Front End Development for Back End Developers - vJUG24 2017
Front End Development for Back End Developers - vJUG24 2017
 
inernship ppt.ppt
inernship ppt.pptinernship ppt.ppt
inernship ppt.ppt
 
Rails Gems realize RESTful modeling patterns
Rails Gems realize RESTful modeling patternsRails Gems realize RESTful modeling patterns
Rails Gems realize RESTful modeling patterns
 
mDevCamp - The Best from Google IO
mDevCamp - The Best from Google IOmDevCamp - The Best from Google IO
mDevCamp - The Best from Google IO
 
01 nosql and multi model database
01   nosql and multi model database01   nosql and multi model database
01 nosql and multi model database
 
Back to Basics 2017: Mí primera aplicación MongoDB
Back to Basics 2017: Mí primera aplicación MongoDBBack to Basics 2017: Mí primera aplicación MongoDB
Back to Basics 2017: Mí primera aplicación MongoDB
 
SQL to NoSQL: Top 6 Questions
SQL to NoSQL: Top 6 QuestionsSQL to NoSQL: Top 6 Questions
SQL to NoSQL: Top 6 Questions
 
Introducing the Seneca MVP framework for Node.js
Introducing the Seneca MVP framework for Node.jsIntroducing the Seneca MVP framework for Node.js
Introducing the Seneca MVP framework for Node.js
 
20120816 nodejsdublin
20120816 nodejsdublin20120816 nodejsdublin
20120816 nodejsdublin
 
Engage 2023: Taking Domino Apps to the next level by providing a Rest API
Engage 2023: Taking Domino Apps to the next level by providing a Rest APIEngage 2023: Taking Domino Apps to the next level by providing a Rest API
Engage 2023: Taking Domino Apps to the next level by providing a Rest API
 
Construindo APIs Usando Rails
Construindo APIs Usando RailsConstruindo APIs Usando Rails
Construindo APIs Usando Rails
 
Project report | Major Project | Engineering | Devansh Koolwal
Project report | Major Project | Engineering | Devansh KoolwalProject report | Major Project | Engineering | Devansh Koolwal
Project report | Major Project | Engineering | Devansh Koolwal
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...
 
Android Intermediatte IAK full
Android Intermediatte IAK fullAndroid Intermediatte IAK full
Android Intermediatte IAK full
 
Android intermediatte Full
Android intermediatte FullAndroid intermediatte Full
Android intermediatte Full
 
Tek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJSTek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJS
 
Denver emberjs-sept-2015
Denver emberjs-sept-2015Denver emberjs-sept-2015
Denver emberjs-sept-2015
 

Recently uploaded

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 

Recently uploaded (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 

Learn Developing REST API in Node.js using LoopBack Framework

  • 1. Welcome to Facebook Developer Circle Meetup * Date: Sunday, 26 Mar 2017 * Place: Ngalup.co, Mojolangu, Malang Last login: Sun Mar 26 09:00:00 2017 from 127.0.0.1 marudits@dev-circle-mlg:~$ _
  • 2. Learn Developing REST API in Node.js using LoopBack Framework by Marudi Tri Subakti
  • 3. Welcome to Facebook Developer Circle Meetup * Date: Sunday, 26 Mar 2017 * Place: Ngalup.co, Mojolangu, Malang Last login: Sun Mar 26 09:00:00 2017 from 127.0.0.1 marudits@dev-circle-mlg:~$ whoami _
  • 4. PART 1 { “name”: “Marudi Tri Subakti”, “phone”: “(+62) 85646628435”, “email”: “marudits@gmail.com”, “works”:[ { “company”: “PT Musica Studio’s”, “role”: “Web Developer”, }, { “company”: “Tebengan ID”, “role”: “Web Developer” } ] }
  • 5. Welcome to Facebook Developer Circle Meetup * Date: Sunday, 26 Mar 2017 * Place: Ngalup.co, Mojolangu, Malang Last login: Sun Mar 26 09:00:00 2017 from 127.0.0.1 marudits@dev-circle-mlg:~$ whoami marudits@dev-circle-mlg:~$ man –k ‘REST API’ _
  • 6. What is? • Put it simply, REST = REpresentational State Transfer , is an architectural style define to help create and organize distributed system. • It is not a guideline, not a standard, or anything that would imply that there are set a hard of rule to follow 3 PART 21 • There is no Request for Comments (RFC), which can leads to a widespread incomplete REST ideal • But have set of contraints to define uniform interface: Client-Server, Stateless, Cacheable, Uniform Interface, Layered System, Code-on-Demand
  • 7. Why? • Performance, communication style is meant to be efficient and simple 3 PART 21 • Scalability, simple interaction greatly allow to handle heavy interaction • Modifiability, separation of concerns allow to minimize risk • Portability, can be implemented and consumed by many type of technology • Reliability, allows for the easier recovery of system after failure
  • 8. How it works? (Resources) • Representations 3 PART 21 • Identifier • Metadata • Control Data
  • 9. How it works? (Resources) • Representations, it can be any way of representing data (binary, JSON, XML, etc) 3 PART 21 • Identifier • Metadata • Control Data
  • 10. How it works? (Resources) • Representations 3 PART 21 • Identifier, a URL that retrieves only one specific resource at any given time • Metadata • Control Data
  • 11. How it works? (Resources) • Representations 3 PART 21 • Identifier • Metadata, Content-type, last-modified time, and so forth • Control Data, is-modifiable-since, cache-control
  • 12. Welcome to Facebook Developer Circle Meetup * Date: Sunday, 26 Mar 2017 * Place: Ngalup.co, Mojolangu, Malang Last login: Sun Mar 26 09:00:00 2017 from 127.0.0.1 marudits@dev-circle-mlg:~$ whoami marudits@dev-circle-mlg:~$ man –k ‘REST API’ marudits@dev-circle-mlg:~$ lb --help _
  • 13. PART 3 42 What is? • LoopBack framework is a set of Node.js modules that you can use independently or together to quickly build REST APIs • Interacts with data sources through the LoopBack model API, available locally within Node.js, remotely over REST, and via native client APIs for iOS, Android, and HTML5 • Apps can query databases, store data, upload files, send emails, create push notifications, register users, and perform other actions provided by data sources and services. Introduction
  • 15. • Create dynamic end-to-end REST APIs with little or no coding PART 3 42 Why we use? • Access data from various data source: major relational databases, MongoDB, SOAP and REST APIs • Incorporate model relationships and access controls for complex APIs • Separable components for file storage, third-party login, and OAuth 2.0 • MIT open-source license
  • 16. PART 3 42 Why we use? Loopback Express Sails Meteor Type API Framework HTTP server library Web MVC framework Full-stack JavaScript app platform Top Features Enterprise connectivity, API Explorer, generators, client SDKs, websocket microservices HTTP routing, middleware Rails familiarity, MVC Universal JavaScript, reactive rendering, websocket microservices Suitable For Web apps, APIs Simple web apps Web apps, APIs Web apps Clint SDKs Angular, Browser, Node.js, iOS, Android, Xamarin N/A None JavaScript, Cordova for iOS and Android, React, AngularJS Data Source In-memory/file, MongoDB, MySQL, Oracle, PostgreSQL, SQL Server, ATG, Email, REST, SOAP, many more. None In-memory, File, PostgreSQL, MySQL, MongoDB MongoDB, MySQL and PostgreSQL via 3rd-party packages ACLs Yes No No Basic allow/deny Comparation
  • 17. PART 3 42 Why we use? “By using LoopBack, we can build REST API easily with little or no coding, connect to various datasources and define model relationship & its control access.”
  • 18. PART 3 42 How it works? Core Concepts (Modules)
  • 19. PART 3 42 How it works? • Models : Dynamically mock-up models and expose them as APIs without worrying about persisting (some) Key Features • Abstraction : Connect to multiple data sources or services and get back an abstracted model with CRUD capabilities independent of backing data source. • Data : Enable connections to RDBMS and noSQL data sources and get back an abstracted model • ACL : Controls if a principal can perform a certain operation against a model. • Remote Method : exposed remote method over a custom REST endpoint to perform operations not provided by LoopBack’s standard model REST API • Remote Hook : executed before or after calling a remote method, either a custom remote method or a standard CRUD inherited from PersistedModel
  • 20. PART 3 42 Getting Started • Install : Install the LoopBack CLI tool $ npm install –g loopback-cli • Create App : Create a “Hello World” LoopBack application $ lb • Create Models : Generate models through CLI $ lb model • Run : Run as you would any Node application $ node . • Explore : Enables you to exercise all generated API endpoints http://127.0.0.1:3000/explorer
  • 21. Welcome to Facebook Developer Circle Meetup * Date: Sunday, 26 Mar 2017 * Place: Ngalup.co, Mojolangu, Malang Last login: Sun Mar 26 09:00:00 2017 from 127.0.0.1 marudits@dev-circle-mlg:~$ whoami marudits@dev-circle-mlg:~$ man –k ‘REST API’ marudits@dev-circle-mlg:~$ lb --help marudits@dev-circle-mlg:~$ npm run start _
  • 24. i < /> { } /* install loopback */ $ npm install –g loopback-cli /* create app */ $ lb /* create models */ $ lb model /* attach to datasource */ $ lb datasource /* define relations */ $ lb relation /* run app */ $ node . /*  develop your own */ /* set access control */ $ lb acl
  • 26. i < /> { } /* install antd-init generator */ $ npm install –g antd-init /* make and move to app directory */ $ mkdir helloworld && cd helloworld /* create app */ $ antd-init /* run app */ $ npm start /*  develop your own */
  • 27. Welcome to Facebook Developer Circle Meetup * Date: Sunday, 26 Mar 2017 * Place: Ngalup.co, Mojolangu, Malang Last login: Sun Mar 26 09:00:00 2017 from 127.0.0.1 marudits@dev-circle-mlg:~$ whoami marudits@dev-circle-mlg:~$ man –k ‘REST API’ marudits@dev-circle-mlg:~$ lb --help marudits@dev-circle-mlg:~$ npm run start marudits@dev-circle-mlg:~$ ping tebengan.id _
  • 28. Should our stories resonate with you, why not share your stories and aspiration with us and help build tebengan together (?) build@tebengan.id
  • 29. Welcome to Facebook Developer Circle Meetup * Date: Sunday, 26 Mar 2017 * Place: Ngalup.co, Mojolangu, Malang Last login: Sun Mar 26 09:00:00 2017 from 127.0.0.1 marudits@dev-circle-mlg:~$ whoami marudits@dev-circle-mlg:~$ man –k ‘REST API’ marudits@dev-circle-mlg:~$ lb --help marudits@dev-circle-mlg:~$ npm run start marudits@dev-circle-mlg:~$ ping tebengan.id marudits@dev-circle-mlg:~$ shutdown –h now _
  • 30. Learn Developing REST API in Node.js using LoopBack Framework by Marudi Tri Subakti

Editor's Notes

  1. REST is an architectural style define to help create and organize distributed system
  2. Performance, communication style is meant to be efficient and simple Scalability, simple interaction greatly allow to handle heavy interaction Modifiability, separation of concerns allow to minimize risk Portability, can be implemented and consumed by many type of technology Reliability, allows for the easier recovery of system after failure
  3. Core Set up models and create REST APIs in minutes Easy-to-use CLI wizard Create models based on your schema if you have one Create dynamic models if you don't Built-in API Explorer Model relation support Define hasMany, belongsTo, hasAndBelongsToMany relationships Automatically generates corresponding relational REST endpoints Easy authentication and authorization setup Built-in role-based access controls oAuth user and registration models baked in Add custom policies using CLI or JSON Browser support (JSONP and CORS) MIT Open-Source license
  4. Demo : about 10-15 minutes departureName string arrivalName string departurePoint geopoint arrivalPoint geopoint departureSublocations string arrivalSublocations string departureDate date Price number Seats number isCar Boolean Description string
  5. Demo : about 10-15 minutes
  6. Demo : about 5 minutes