SlideShare a Scribd company logo
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 (20)

PDF
Beginning MEAN Stack
Rob Davarnia
 
PPTX
Working with LoopBack Models
Raymond Feng
 
PPTX
Making Single Page Applications (SPA) faster
Boris Livshutz
 
PDF
LoopBack: a productivity booster for MEAN
Miroslav Bajtoš
 
PDF
Building Mobile Apps With Ionic & Loopback
Chibuzor Obiora
 
PDF
Building a Single-Page App: Backbone, Node.js, and Beyond
Spike Brehm
 
PDF
Introduction To Single Page Application
KMS Technology
 
PPTX
Building Modern Web Apps with MEAN Stack
Suresh Patidar
 
PPTX
Mvvm knockout vs angular
Basarat Syed
 
PPT
Introduction to JavaScript Full Stack
Mindfire Solutions
 
PDF
Moving from PHP to a nodejs full stack CMS
Make & Build
 
PDF
Server rendering-talk
Daiwei Lu
 
PDF
Deep dive into Vue.js
선협 이
 
PPT
Full stack JavaScript - the folly of choice
FDConf
 
PPTX
Single Page WebApp Architecture
Morgan Cheng
 
PDF
introduction to Vue.js 3
ArezooKmn
 
PPTX
Introduction to Vue.js DevStaff Meetup 13.02
Paul Bele
 
PDF
The MEAN stack - SoCalCodeCamp - june 29th 2014
Simona Clapan
 
PPTX
FULL stack -> MEAN stack
Ashok Raj
 
PDF
Kickstarting Node.js Projects with Yeoman
Patrick Buergin
 
Beginning MEAN Stack
Rob Davarnia
 
Working with LoopBack Models
Raymond Feng
 
Making Single Page Applications (SPA) faster
Boris Livshutz
 
LoopBack: a productivity booster for MEAN
Miroslav Bajtoš
 
Building Mobile Apps With Ionic & Loopback
Chibuzor Obiora
 
Building a Single-Page App: Backbone, Node.js, and Beyond
Spike Brehm
 
Introduction To Single Page Application
KMS Technology
 
Building Modern Web Apps with MEAN Stack
Suresh Patidar
 
Mvvm knockout vs angular
Basarat Syed
 
Introduction to JavaScript Full Stack
Mindfire Solutions
 
Moving from PHP to a nodejs full stack CMS
Make & Build
 
Server rendering-talk
Daiwei Lu
 
Deep dive into Vue.js
선협 이
 
Full stack JavaScript - the folly of choice
FDConf
 
Single Page WebApp Architecture
Morgan Cheng
 
introduction to Vue.js 3
ArezooKmn
 
Introduction to Vue.js DevStaff Meetup 13.02
Paul Bele
 
The MEAN stack - SoCalCodeCamp - june 29th 2014
Simona Clapan
 
FULL stack -> MEAN stack
Ashok Raj
 
Kickstarting Node.js Projects with Yeoman
Patrick Buergin
 

Viewers also liked (12)

PPT
Node.js (RichClient)
Serge Shirokov
 
PDF
AllcountJS VTB24 loan сonveyor POC
Pavel Tiunov
 
PPTX
Web В РЕАЛЬНОМ ВРЕМЕНИ С Node.js - AgileBaseCamp - 2012
Dmytro Mindra
 
PDF
Moscow js node.js enterprise development
Pavel Tiunov
 
PDF
Use Node.js to create a REST API
Fabien Vauchelles
 
PPT
ВВЕДЕНИЕ В NODE.JS
Pavel Tsukanov
 
PDF
Introduction to REST API with Node.js
Yoann Gotthilf
 
ODP
Архитектура программных систем на Node.js
Timur Shemsedinov
 
PDF
Асинхронность и параллелизм в Node.js
GeeksLab Odessa
 
PDF
Developing and Testing a MongoDB and Node.js REST API
All Things Open
 
PDF
Anatomy of a Modern Node.js Application Architecture
AppDynamics
 
PDF
Инфраструктура распределенных приложений на Node.js
Stanislav Gumeniuk
 
Node.js (RichClient)
Serge Shirokov
 
AllcountJS VTB24 loan сonveyor POC
Pavel Tiunov
 
Web В РЕАЛЬНОМ ВРЕМЕНИ С Node.js - AgileBaseCamp - 2012
Dmytro Mindra
 
Moscow js node.js enterprise development
Pavel Tiunov
 
Use Node.js to create a REST API
Fabien Vauchelles
 
ВВЕДЕНИЕ В NODE.JS
Pavel Tsukanov
 
Introduction to REST API with Node.js
Yoann Gotthilf
 
Архитектура программных систем на Node.js
Timur Shemsedinov
 
Асинхронность и параллелизм в Node.js
GeeksLab Odessa
 
Developing and Testing a MongoDB and Node.js REST API
All Things Open
 
Anatomy of a Modern Node.js Application Architecture
AppDynamics
 
Инфраструктура распределенных приложений на Node.js
Stanislav Gumeniuk
 
Ad

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

PDF
Lessons from Highly Scalable Architectures at Social Networking Sites
Patrick Senti
 
PDF
NoSQL Now 2013 Presentation
Arjen Schoneveld
 
PDF
Front End Development for Back End Developers - vJUG24 2017
Matt Raible
 
PPT
inernship ppt.ppt
HarshitRao24
 
PDF
Rails Gems realize RESTful modeling patterns
Toru Kawamura
 
PDF
mDevCamp - The Best from Google IO
ondraz
 
PDF
01 nosql and multi model database
Mahdi Atawneh
 
PDF
Back to Basics 2017: Mí primera aplicación MongoDB
MongoDB
 
PPTX
SQL to NoSQL: Top 6 Questions
Mike Broberg
 
KEY
Introducing the Seneca MVP framework for Node.js
Richard Rodger
 
KEY
20120816 nodejsdublin
Richard Rodger
 
PDF
Engage 2023: Taking Domino Apps to the next level by providing a Rest API
Serdar Basegmez
 
PPTX
Construindo APIs Usando Rails
Fernando Kakimoto
 
PDF
Project report | Major Project | Engineering | Devansh Koolwal
Devansh Koolwal
 
PPTX
The future of web development write once, run everywhere with angular.js and ...
Mark Roden
 
PDF
The future of web development write once, run everywhere with angular js an...
Mark Leusink
 
PPTX
Android intermediatte Full
Ahmad Arif Faizin
 
PPTX
Android Intermediatte IAK full
Ahmad Arif Faizin
 
PDF
Tek 2013 - Building Web Apps from a New Angle with AngularJS
Pablo Godel
 
PDF
Denver emberjs-sept-2015
Ron White
 
Lessons from Highly Scalable Architectures at Social Networking Sites
Patrick Senti
 
NoSQL Now 2013 Presentation
Arjen Schoneveld
 
Front End Development for Back End Developers - vJUG24 2017
Matt Raible
 
inernship ppt.ppt
HarshitRao24
 
Rails Gems realize RESTful modeling patterns
Toru Kawamura
 
mDevCamp - The Best from Google IO
ondraz
 
01 nosql and multi model database
Mahdi Atawneh
 
Back to Basics 2017: Mí primera aplicación MongoDB
MongoDB
 
SQL to NoSQL: Top 6 Questions
Mike Broberg
 
Introducing the Seneca MVP framework for Node.js
Richard Rodger
 
20120816 nodejsdublin
Richard Rodger
 
Engage 2023: Taking Domino Apps to the next level by providing a Rest API
Serdar Basegmez
 
Construindo APIs Usando Rails
Fernando Kakimoto
 
Project report | Major Project | Engineering | Devansh Koolwal
Devansh Koolwal
 
The future of web development write once, run everywhere with angular.js and ...
Mark Roden
 
The future of web development write once, run everywhere with angular js an...
Mark Leusink
 
Android intermediatte Full
Ahmad Arif Faizin
 
Android Intermediatte IAK full
Ahmad Arif Faizin
 
Tek 2013 - Building Web Apps from a New Angle with AngularJS
Pablo Godel
 
Denver emberjs-sept-2015
Ron White
 
Ad

Recently uploaded (20)

PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 

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”: “[email protected]”, “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 (?) [email protected]
  • 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

  • #7: REST is an architectural style define to help create and organize distributed system
  • #8: 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
  • #16: 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
  • #25: 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
  • #26: Demo : about 10-15 minutes
  • #27: Demo : about 5 minutes