No more REST - University of Torontomashiyat/csc309/Lectures/MeteorJS.pdf · WhatisMeteorJS? •...
Transcript of No more REST - University of Torontomashiyat/csc309/Lectures/MeteorJS.pdf · WhatisMeteorJS? •...
![Page 1: No more REST - University of Torontomashiyat/csc309/Lectures/MeteorJS.pdf · WhatisMeteorJS? • Open&source&JS&web&framework& & • Builtusing&Node.js& & • Rapid&Prototyping&Tool&](https://reader034.fdocuments.in/reader034/viewer/2022042100/5e7c50a3771bed45c57739bf/html5/thumbnails/1.jpg)
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&](https://reader034.fdocuments.in/reader034/viewer/2022042100/5e7c50a3771bed45c57739bf/html5/thumbnails/2.jpg)
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&](https://reader034.fdocuments.in/reader034/viewer/2022042100/5e7c50a3771bed45c57739bf/html5/thumbnails/3.jpg)
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&](https://reader034.fdocuments.in/reader034/viewer/2022042100/5e7c50a3771bed45c57739bf/html5/thumbnails/4.jpg)
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&](https://reader034.fdocuments.in/reader034/viewer/2022042100/5e7c50a3771bed45c57739bf/html5/thumbnails/5.jpg)
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&](https://reader034.fdocuments.in/reader034/viewer/2022042100/5e7c50a3771bed45c57739bf/html5/thumbnails/6.jpg)
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&](https://reader034.fdocuments.in/reader034/viewer/2022042100/5e7c50a3771bed45c57739bf/html5/thumbnails/7.jpg)
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&](https://reader034.fdocuments.in/reader034/viewer/2022042100/5e7c50a3771bed45c57739bf/html5/thumbnails/8.jpg)
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&](https://reader034.fdocuments.in/reader034/viewer/2022042100/5e7c50a3771bed45c57739bf/html5/thumbnails/9.jpg)
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&](https://reader034.fdocuments.in/reader034/viewer/2022042100/5e7c50a3771bed45c57739bf/html5/thumbnails/10.jpg)
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&](https://reader034.fdocuments.in/reader034/viewer/2022042100/5e7c50a3771bed45c57739bf/html5/thumbnails/11.jpg)
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&](https://reader034.fdocuments.in/reader034/viewer/2022042100/5e7c50a3771bed45c57739bf/html5/thumbnails/12.jpg)
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&](https://reader034.fdocuments.in/reader034/viewer/2022042100/5e7c50a3771bed45c57739bf/html5/thumbnails/13.jpg)
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&](https://reader034.fdocuments.in/reader034/viewer/2022042100/5e7c50a3771bed45c57739bf/html5/thumbnails/14.jpg)
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&](https://reader034.fdocuments.in/reader034/viewer/2022042100/5e7c50a3771bed45c57739bf/html5/thumbnails/15.jpg)
Now it’s ?me for the demo! :)