intro to meteor @py gotham aug 15-16 2015

25
Intro to @PyGotham Aug 15-16 by @ewenchristie

Upload: christieewen

Post on 07-Jan-2017

655 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Intro to meteor @py gotham Aug 15-16 2015

Intro to @PyGotham Aug 15-16

by @ewenchristie

Page 2: Intro to meteor @py gotham Aug 15-16 2015

3 Part Discussion

1. Introduction to2. Patterns in development3. Meteor + Python

Page 3: Intro to meteor @py gotham Aug 15-16 2015

What is ?

● 100% Pure Javascript Full Stack● Open Source● Web and Mobile Apps Dev Platform● Focus on apps, Not infrastructure● www.meteor.com

Page 4: Intro to meteor @py gotham Aug 15-16 2015

Who backs ?

● Meteor Development Group○ Active development by full time employees

● $20 Million series B - May 2015● Revenue Product: Galaxy (official host)● Meteor platform is opensource (MIT license)

○ You own the code; Host anywhere

Page 5: Intro to meteor @py gotham Aug 15-16 2015

The Basics

● Javascript (ES2015)● MongoDB: Node.js

○ https://university.mongodb.com/○ Schema-less Design

● HTML, CSS○ Bootstrap

● Git/GitHub● Node.JS (e.g., asynchronous, callbacks)

Page 6: Intro to meteor @py gotham Aug 15-16 2015

Code DEMO● curl https://install.meteor.com/ | sh● meteor create --example todos● cd todos● meteor● meteor mongo● meteor deploy PyGotham2015.meteor.com

Another example:

● meteor create --example localmarket

Page 7: Intro to meteor @py gotham Aug 15-16 2015

Architecture

Page 8: Intro to meteor @py gotham Aug 15-16 2015

Database Schema Design

Just build App → Let schema evolve

When to Denormalize○ 1 : 1 → embed○ 1 : few → embed○ many : many → link

Page 9: Intro to meteor @py gotham Aug 15-16 2015

Reactive Patterns using observeChanges

Meteor.startup(function() {observeChanges

})== OR ==

observeChanges in the top level code.

Page 10: Intro to meteor @py gotham Aug 15-16 2015

Example: publish / subscribe// SERVER

Meteor.publish("counts-by-room", function (roomId) {

var handle = Messages.find({roomId: roomId}).observeChanges({ added: function (_id) {

// Do something }, changed: function (_id) {

// Do something } });

})

// CLIENTTracker.autorun(function () {

Meteor.subscribe("counts-by-room", Session.get("roomId"));});

Page 11: Intro to meteor @py gotham Aug 15-16 2015

Observe and ObserveChanges

Page 12: Intro to meteor @py gotham Aug 15-16 2015

Function parametersmyCollection.find({}).observeChanges({

added: function(id, fields) {//Do something

}});

id = _id in the MongoDBfields → Changed fields only

Page 13: Intro to meteor @py gotham Aug 15-16 2015

AtmosphereJS.com

Page 14: Intro to meteor @py gotham Aug 15-16 2015

How to use packages

● meteor search <search-terms>● meteor add <package-name>● meteor list● gitHub

○ README.md

Page 15: Intro to meteor @py gotham Aug 15-16 2015

Search Patterns

● Search (Google, Yahoo!, Bing)● Find command (CTRL + f)

Page levelDirectory

● grep commandEx: “grep -R signIn --exclude-dir="\.meteor*”

Page 16: Intro to meteor @py gotham Aug 15-16 2015

Playgrounds

● Experiment queries on the command line○ meteor mongo

● Create small experiment applications○ meteor create myExperiment

Page 17: Intro to meteor @py gotham Aug 15-16 2015

CRUD

● Create● Read● Update● Delete

Page 18: Intro to meteor @py gotham Aug 15-16 2015

Production Servers

● yourApp.meteor.com● Digital Ocean● Modulus● Heroku● Galaxy (coming soon)

Page 20: Intro to meteor @py gotham Aug 15-16 2015

Challenges

● Unlearning ○ Relational vs. NoSQL○ Iterative vs. Reactive

● Documentation (need more official docs)● Scaling (similar to other platforms)● Keeping up with active changes● Accessibility to online information

Page 21: Intro to meteor @py gotham Aug 15-16 2015

Why Javascript?

Geoff Schmidt: Javascript State of the Union

Page 22: Intro to meteor @py gotham Aug 15-16 2015

Why learn a new platform?

● Learn a new programming language every year

● Opportunity to learn different points of view○ Examples such as Pythonic approaches○ LearnYouNode○ Security (Why Meteor doesn’t use cookies?)

Page 23: Intro to meteor @py gotham Aug 15-16 2015

What’s next?

● Meteor 1.2 (Summer 2015)● Galaxy (production meteor deploy)● REST, microservices, ES2015 modules, +● Reactive Database support for Redis & SQL ● Vote on Meteor’s Roadmap

○ https://trello.com/b/hjBDflxp/meteor-roadmap● Meteor-NY Meetup

Page 25: Intro to meteor @py gotham Aug 15-16 2015

THANKS!