SlideShare une entreprise Scribd logo
1  sur  16
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances (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
 

En vedette

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
 

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
+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@
 

Dernier (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
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...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
+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...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

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