SlideShare ist ein Scribd-Unternehmen logo
1 von 16
Downloaden Sie, um offline zu lesen
Getting Started with
Meteor

,

Emily Stark
What is Meteor and
who am I?
Meteor is a full-stack JavaScript framework
for quickly creating fast, realtime web
applications.
I’m Emily: Stanford CS ’11, Meteor core dev,
@estark37
Step 1: install Meteor
• On Mac and Linux:
$ curl https://install.meteor.com/ | sh

• Try http://nitrous.io for Windows
docs.meteor.com
Step 2: basic Meteor
commands
meteor create <app name>
meteor help and meteor help <command>

Inside your app directory:
meteor run
meteor mongo
meteor reset
Step 3: scaffolding
git clone https://github.com/
estark37/acmhn.git
Step 4: the MongoDB
API
Leaders
A collection (sort of like a table in a SQL database)

Leaders.insert({name: “Foo”, votes: 0});
Inserts a new document (sort of like a row)
Step 4: the MongoDB
API
Leaders.find();
A cursor representing all the documents in the collection
Leaders.find({ name: “Foo” })
A cursor representing all documents with name equal to
“Foo”
Leaders.findOne({ name: “Foo” })
Returns a single document with name equal to “Foo”
Step 4: the MongoDB
API
Leaders.update({name: “Foo”}, {$set:
{votes: 1}});
Update all documents with name “Foo” by setting the
number of votes to 1
Leaders.update({name: “Foo”}, {$inc:
{votes: 1}});
Update all documents with name “Foo” by incrementing the
votes by 1
Step 5: add voting
•

Add upvote/downvote buttons in the “leader”
template.

•

Add a click event:
Template.leader.events({
‘click .upvote’: function (evt) {...}
});

•

You can use the MongoDB API in your click handler!
Step 6: add new items
• Add a form in a new template
• Add an event handler for submitting the
form:

Template.newItem.events({
‘submit .upvote’: function (evt) {...}
});
Step 7: Meteor
methods
Should all clients be able to write anything to
the database? No.
meteor remove insecure
Meteor.methods({
foo: function () { ... }})
Meteor.call(‘foo’)
Step 8: the Meteor
package system
meteor list
meteor list --using
meteor add accounts-ui
meteor add accounts-password
https://atmosphere.meteor.com for
community packages
Step 9: authentication
and authorization
• Make it so that only logged-in users can
vote on items or add new ones.

•
•

this.userId inside methods
{{loginButtons}} in templates
Step 10: publish and
subscribe
Right now, all users can read all data.
meteor remove autopublish
Meteor.publish()
Meteor.subscribe()
to control which data is sent to which
clients.
More
•
•
•
•
•

www.eventedmind.com

•

Come to Meteor Devshop 11! http://www.meetup.com/
Meteor-SFBay

www.discovermeteor.com
https://github.com/meteor/telephone-pictionary
https://www.meteor.com/learn-meteor
Interested in starting a Meteor South Bay meetup? Email
community@meteor.com

Weitere ähnliche Inhalte

Was ist angesagt? (8)

My Very First Zf App Part One
My Very First Zf App   Part OneMy Very First Zf App   Part One
My Very First Zf App Part One
 
Let's Build a Chatbot
Let's Build a ChatbotLet's Build a Chatbot
Let's Build a Chatbot
 
Tutorial for Installing eclox
Tutorial for Installing ecloxTutorial for Installing eclox
Tutorial for Installing eclox
 
How to get full power from WebApi
How to get full power from WebApiHow to get full power from WebApi
How to get full power from WebApi
 
Labs And Walkthroughs
Labs And WalkthroughsLabs And Walkthroughs
Labs And Walkthroughs
 
2310 b 16
2310 b 162310 b 16
2310 b 16
 
Using Bitbucket and Mercurial
Using Bitbucket and MercurialUsing Bitbucket and Mercurial
Using Bitbucket and Mercurial
 
REST API testing with SpecFlow
REST API testing with SpecFlowREST API testing with SpecFlow
REST API testing with SpecFlow
 

Andere mochten auch

081110 minuta sesión 1 foro de comunidades mapuche
081110 minuta sesión 1 foro de comunidades mapuche081110 minuta sesión 1 foro de comunidades mapuche
081110 minuta sesión 1 foro de comunidades mapuche
Foro Abierto
 
Romit Ray Resume PDF
Romit Ray Resume PDFRomit Ray Resume PDF
Romit Ray Resume PDF
romit ray
 
Honokage Company Presentation
Honokage Company Presentation Honokage Company Presentation
Honokage Company Presentation
Shirley Yu
 
15. Veronica Sánchez ¿QUE ES UN TROYANO INFORMÁTICO? ¿ QUE ES UN GUSANO?
15. Veronica Sánchez ¿QUE ES UN TROYANO INFORMÁTICO? ¿ QUE ES UN GUSANO?15. Veronica Sánchez ¿QUE ES UN TROYANO INFORMÁTICO? ¿ QUE ES UN GUSANO?
15. Veronica Sánchez ¿QUE ES UN TROYANO INFORMÁTICO? ¿ QUE ES UN GUSANO?
Yaritza Cedillo
 
Oracle eBusiness and Middleware
Oracle eBusiness and MiddlewareOracle eBusiness and Middleware
Oracle eBusiness and Middleware
Carina Kordan
 

Andere mochten auch (20)

Camisas y polos- selobaby.es
Camisas y polos- selobaby.esCamisas y polos- selobaby.es
Camisas y polos- selobaby.es
 
Perché monitorare le performance delle tue azioni online
Perché monitorare le performance delle tue azioni onlinePerché monitorare le performance delle tue azioni online
Perché monitorare le performance delle tue azioni online
 
Groupon Clone
Groupon CloneGroupon Clone
Groupon Clone
 
Trabajo final sobre_seminario_de_estudios_sobre_asia-libre
Trabajo final sobre_seminario_de_estudios_sobre_asia-libreTrabajo final sobre_seminario_de_estudios_sobre_asia-libre
Trabajo final sobre_seminario_de_estudios_sobre_asia-libre
 
IT Flex Solutions
IT Flex SolutionsIT Flex Solutions
IT Flex Solutions
 
Revolution. E-Commerce bei WearLite. - Kevin Klak, Wearlite
Revolution. E-Commerce bei WearLite. - Kevin Klak, WearliteRevolution. E-Commerce bei WearLite. - Kevin Klak, Wearlite
Revolution. E-Commerce bei WearLite. - Kevin Klak, Wearlite
 
081110 minuta sesión 1 foro de comunidades mapuche
081110 minuta sesión 1 foro de comunidades mapuche081110 minuta sesión 1 foro de comunidades mapuche
081110 minuta sesión 1 foro de comunidades mapuche
 
Administracion y gestion
Administracion y gestionAdministracion y gestion
Administracion y gestion
 
S4 tarea04 tecam
S4 tarea04 tecamS4 tarea04 tecam
S4 tarea04 tecam
 
Romit Ray Resume PDF
Romit Ray Resume PDFRomit Ray Resume PDF
Romit Ray Resume PDF
 
Mas Turnos - Servicio Multiclinic
Mas Turnos - Servicio MulticlinicMas Turnos - Servicio Multiclinic
Mas Turnos - Servicio Multiclinic
 
Honokage Company Presentation
Honokage Company Presentation Honokage Company Presentation
Honokage Company Presentation
 
Introducción a la web móvil
Introducción a la web móvilIntroducción a la web móvil
Introducción a la web móvil
 
Elec 184
Elec 184Elec 184
Elec 184
 
Taller: Cómo Redactar sin Incurrir en Plagio Rosa Guzmán
Taller: Cómo Redactar sin Incurrir en Plagio Rosa GuzmánTaller: Cómo Redactar sin Incurrir en Plagio Rosa Guzmán
Taller: Cómo Redactar sin Incurrir en Plagio Rosa Guzmán
 
15. Veronica Sánchez ¿QUE ES UN TROYANO INFORMÁTICO? ¿ QUE ES UN GUSANO?
15. Veronica Sánchez ¿QUE ES UN TROYANO INFORMÁTICO? ¿ QUE ES UN GUSANO?15. Veronica Sánchez ¿QUE ES UN TROYANO INFORMÁTICO? ¿ QUE ES UN GUSANO?
15. Veronica Sánchez ¿QUE ES UN TROYANO INFORMÁTICO? ¿ QUE ES UN GUSANO?
 
MyTimetable web interface for Syllabus Plus, Scientia User Conference 2011
MyTimetable web interface for Syllabus Plus, Scientia User Conference 2011MyTimetable web interface for Syllabus Plus, Scientia User Conference 2011
MyTimetable web interface for Syllabus Plus, Scientia User Conference 2011
 
Presentación fredy
Presentación fredyPresentación fredy
Presentación fredy
 
Towards Patterns for Creativity
Towards Patterns for CreativityTowards Patterns for Creativity
Towards Patterns for Creativity
 
Oracle eBusiness and Middleware
Oracle eBusiness and MiddlewareOracle eBusiness and Middleware
Oracle eBusiness and Middleware
 

Ähnlich wie Emily Stark at Stanford ACM Hackathon

PT1420 File Access and Visual Basic .docx
PT1420 File Access and Visual Basic                      .docxPT1420 File Access and Visual Basic                      .docx
PT1420 File Access and Visual Basic .docx
amrit47
 

Ähnlich wie Emily Stark at Stanford ACM Hackathon (20)

Web works hol
Web works holWeb works hol
Web works hol
 
An Introduction to Django Web Framework
An Introduction to Django Web FrameworkAn Introduction to Django Web Framework
An Introduction to Django Web Framework
 
Soa lab
Soa lab   Soa lab
Soa lab
 
03 integrate webapisignalr
03 integrate webapisignalr03 integrate webapisignalr
03 integrate webapisignalr
 
SharePoint Project Phase 1 And 2
SharePoint Project Phase 1 And 2SharePoint Project Phase 1 And 2
SharePoint Project Phase 1 And 2
 
LKF Portfolio
LKF PortfolioLKF Portfolio
LKF Portfolio
 
Hydrosphere.io for ODSC: Webinar on Kubeflow
Hydrosphere.io for ODSC: Webinar on KubeflowHydrosphere.io for ODSC: Webinar on Kubeflow
Hydrosphere.io for ODSC: Webinar on Kubeflow
 
Meteor
MeteorMeteor
Meteor
 
Mvc4 crud operations.-kemuning senja
Mvc4 crud operations.-kemuning senjaMvc4 crud operations.-kemuning senja
Mvc4 crud operations.-kemuning senja
 
Qtp launch
Qtp launchQtp launch
Qtp launch
 
Plone FSR
Plone FSRPlone FSR
Plone FSR
 
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISE
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISEWINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISE
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISE
 
Flask jwt authentication tutorial
Flask jwt authentication tutorialFlask jwt authentication tutorial
Flask jwt authentication tutorial
 
Matlab to vhdl
Matlab to vhdlMatlab to vhdl
Matlab to vhdl
 
Databases in Android Application
Databases in Android ApplicationDatabases in Android Application
Databases in Android Application
 
Installing WordPress on AWS
Installing WordPress on AWSInstalling WordPress on AWS
Installing WordPress on AWS
 
3 Ways to Get Started with a React App in 2024.pdf
3 Ways to Get Started with a React App in 2024.pdf3 Ways to Get Started with a React App in 2024.pdf
3 Ways to Get Started with a React App in 2024.pdf
 
Apps1
Apps1Apps1
Apps1
 
PT1420 File Access and Visual Basic .docx
PT1420 File Access and Visual Basic                      .docxPT1420 File Access and Visual Basic                      .docx
PT1420 File Access and Visual Basic .docx
 
Test Complete
Test CompleteTest Complete
Test Complete
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Kürzlich hochgeladen (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

Emily Stark at Stanford ACM Hackathon

  • 2. What is Meteor and who am I? Meteor is a full-stack JavaScript framework for quickly creating fast, realtime web applications. I’m Emily: Stanford CS ’11, Meteor core dev, @estark37
  • 3. Step 1: install Meteor • On Mac and Linux: $ curl https://install.meteor.com/ | sh • Try http://nitrous.io for Windows
  • 5. Step 2: basic Meteor commands meteor create <app name> meteor help and meteor help <command> Inside your app directory: meteor run meteor mongo meteor reset
  • 6. Step 3: scaffolding git clone https://github.com/ estark37/acmhn.git
  • 7. Step 4: the MongoDB API Leaders A collection (sort of like a table in a SQL database) Leaders.insert({name: “Foo”, votes: 0}); Inserts a new document (sort of like a row)
  • 8. Step 4: the MongoDB API Leaders.find(); A cursor representing all the documents in the collection Leaders.find({ name: “Foo” }) A cursor representing all documents with name equal to “Foo” Leaders.findOne({ name: “Foo” }) Returns a single document with name equal to “Foo”
  • 9. Step 4: the MongoDB API Leaders.update({name: “Foo”}, {$set: {votes: 1}}); Update all documents with name “Foo” by setting the number of votes to 1 Leaders.update({name: “Foo”}, {$inc: {votes: 1}}); Update all documents with name “Foo” by incrementing the votes by 1
  • 10. Step 5: add voting • Add upvote/downvote buttons in the “leader” template. • Add a click event: Template.leader.events({ ‘click .upvote’: function (evt) {...} }); • You can use the MongoDB API in your click handler!
  • 11. Step 6: add new items • Add a form in a new template • Add an event handler for submitting the form: Template.newItem.events({ ‘submit .upvote’: function (evt) {...} });
  • 12. Step 7: Meteor methods Should all clients be able to write anything to the database? No. meteor remove insecure Meteor.methods({ foo: function () { ... }}) Meteor.call(‘foo’)
  • 13. Step 8: the Meteor package system meteor list meteor list --using meteor add accounts-ui meteor add accounts-password https://atmosphere.meteor.com for community packages
  • 14. Step 9: authentication and authorization • Make it so that only logged-in users can vote on items or add new ones. • • this.userId inside methods {{loginButtons}} in templates
  • 15. Step 10: publish and subscribe Right now, all users can read all data. meteor remove autopublish Meteor.publish() Meteor.subscribe() to control which data is sent to which clients.
  • 16. More • • • • • www.eventedmind.com • Come to Meteor Devshop 11! http://www.meetup.com/ Meteor-SFBay www.discovermeteor.com https://github.com/meteor/telephone-pictionary https://www.meteor.com/learn-meteor Interested in starting a Meteor South Bay meetup? Email community@meteor.com