no more rest - university of torontomashiyat/csc309/lectures/meteorjs.pdf · whatismeteorjs? •...

15
No more REST

Upload: others

Post on 19-Mar-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: No more REST - University of Torontomashiyat/csc309/Lectures/MeteorJS.pdf · WhatisMeteorJS? • Open&source&JS&web&framework& & • Builtusing&Node.js& & • Rapid&Prototyping&Tool&

No more REST

Page 2: No more REST - University of Torontomashiyat/csc309/Lectures/MeteorJS.pdf · WhatisMeteorJS? • Open&source&JS&web&framework& & • Builtusing&Node.js& & • Rapid&Prototyping&Tool&

What  is  MeteorJS?

• Open  source  JS  web  framework    • Built  using  Node.js    • Rapid  Prototyping  Tool  

• Cross  PlaBorm  Development  

• Uses  web  sockets  (SockJS)  

Page 3: No more REST - University of Torontomashiyat/csc309/Lectures/MeteorJS.pdf · WhatisMeteorJS? • Open&source&JS&web&framework& & • Builtusing&Node.js& & • Rapid&Prototyping&Tool&

Other  Node.js  Frameworks

Page 4: No more REST - University of Torontomashiyat/csc309/Lectures/MeteorJS.pdf · WhatisMeteorJS? • Open&source&JS&web&framework& & • Builtusing&Node.js& & • Rapid&Prototyping&Tool&

Why  Meteor.js?

• RAPID  PROTOTYPING    

• DDP  connecLons  

• ReacLvity  out  of  the  box  

• Supports  React/Angular/Blaze  

• Massive  community  support  

• Security  baked  right  in  

• On  the  come  up,  $20M+  in  funding  

• Cordova  (Android/iOS  support)  

Page 5: No more REST - University of Torontomashiyat/csc309/Lectures/MeteorJS.pdf · WhatisMeteorJS? • Open&source&JS&web&framework& & • Builtusing&Node.js& & • Rapid&Prototyping&Tool&

What  can  I  make  in  an  hour?

Full  Fledge  Chat  System  • Unread/Read  • NoLficaLons  • Chat  box  updaLng  nicely  • Chat  message  logging  

Online  Blackboard  •  Two  person  drawing  in  real  Lme  

Mini  Facebook  • Online/Offile  users  • Posts,  walls  

Page 6: No more REST - University of Torontomashiyat/csc309/Lectures/MeteorJS.pdf · WhatisMeteorJS? • Open&source&JS&web&framework& & • Builtusing&Node.js& & • Rapid&Prototyping&Tool&

             Installa?on                              Example  App

Page 7: No more REST - University of Torontomashiyat/csc309/Lectures/MeteorJS.pdf · WhatisMeteorJS? • Open&source&JS&web&framework& & • Builtusing&Node.js& & • Rapid&Prototyping&Tool&

Important  Files

Page 8: No more REST - University of Torontomashiyat/csc309/Lectures/MeteorJS.pdf · WhatisMeteorJS? • Open&source&JS&web&framework& & • Builtusing&Node.js& & • Rapid&Prototyping&Tool&

System  Files

packages  

>  Important  to  know  what  packages  your  project  includes.  

>  Packages  a  great  because  you  don’t  have  to  code  internals  

>  Packages  can  become  heavy  if  you  don’t  keep  track  of  what  you’re  using  

Page 9: No more REST - University of Torontomashiyat/csc309/Lectures/MeteorJS.pdf · WhatisMeteorJS? • Open&source&JS&web&framework& & • Builtusing&Node.js& & • Rapid&Prototyping&Tool&

System  Files

release  

>  Current  version  of  Meteor  

>  Meteor  changes  frequently,  updates  can  break  current  packages  

Page 10: No more REST - University of Torontomashiyat/csc309/Lectures/MeteorJS.pdf · WhatisMeteorJS? • Open&source&JS&web&framework& & • Builtusing&Node.js& & • Rapid&Prototyping&Tool&

Spacebars  (Handlebars)

Supported  by  the  Blaze  TempLng  Engine  

Can  inject  data  into  the  template  

Page 11: No more REST - University of Torontomashiyat/csc309/Lectures/MeteorJS.pdf · WhatisMeteorJS? • Open&source&JS&web&framework& & • Builtusing&Node.js& & • Rapid&Prototyping&Tool&

Publishing/Subscribing  Data

•  Server  PUBLISHES  (chooses  what  data  to  send)  to  client  

• Client  SUBSCRIBES  (picks  what  data  it  wants)  

• Pub/Sub  have  to  agree  for  data  transmission  

Page 12: No more REST - University of Torontomashiyat/csc309/Lectures/MeteorJS.pdf · WhatisMeteorJS? • Open&source&JS&web&framework& & • Builtusing&Node.js& & • Rapid&Prototyping&Tool&

Reac?vity

•  counter  is  reacLve  when  count  changes,  counter  will  update  itself  

•  counter  is  reacLve    

Page 13: No more REST - University of Torontomashiyat/csc309/Lectures/MeteorJS.pdf · WhatisMeteorJS? • Open&source&JS&web&framework& & • Builtusing&Node.js& & • Rapid&Prototyping&Tool&

Security

• Restrict  PUBLISH  data  

•  LocalStorage  is  used,  no  cookies/tokens  

• Web  sockets  transmit  data,  encrypted  

• Built  in  support  for  DDoS  a`acks  

• DB  ORMS  protect  against  SQL  injecLons  

• XSS  prevented  by  match.js  built  into  Meteor  

Page 14: No more REST - University of Torontomashiyat/csc309/Lectures/MeteorJS.pdf · WhatisMeteorJS? • Open&source&JS&web&framework& & • Builtusing&Node.js& & • Rapid&Prototyping&Tool&

Analysis/Debugging

• Pub/Sub  Lmes  

•  Errors  

• CPU/Ram  usage  

• Methods  being  hit  the  most  

kadira.io      

Page 15: No more REST - University of Torontomashiyat/csc309/Lectures/MeteorJS.pdf · WhatisMeteorJS? • Open&source&JS&web&framework& & • Builtusing&Node.js& & • Rapid&Prototyping&Tool&

Now  it’s  ?me  for  the  demo!  :)