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

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Kürzlich hochgeladen (20)

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
 
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...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
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...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
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?
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

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