Meteor in production
-
Upload
remco-veldkamp -
Category
Technology
-
view
54 -
download
2
Transcript of Meteor in production
Remco Veldkamp
★ Q42 - “happy place for nerds”
★ full-stack developer
★ worked on Rijksmuseum.nl
★ Meteor fan \o/
DemocratieLAB
★ “museum-tour”
★ 1 class of students at the time
★ tablet app guides student through museum
★ student answers questions on tablet
★ printed certificate at the end
Teacher - insert a new class
Classes = new Mongo.Collection(‘classes’);
Classes.insert({
location: "Aa en Hunze",
schoolType: "Basisonderwijs",
route: "42",
active: true
});
<button data-action=continue
class="fade {{#if activeClass}}visible{{/if}}">
ga verder
</button>
Template.player_welcome.helpers({
activeClass : function() {
return Classes.findOne({ active:true }); // livequery
}
});
Student view reacts
Realtime dashboard
Teachers
★ instant feedback
about what’s going
on
★ more control: ability
to take action
Testing
★ end-to-end
★ the whole flow
★ real hardware
★ loadtest on location with real wifi conditions
Autoplaytm
Students.find(Session.get(‘studentId’)).observe({
changed: function(student) {
if (student.autoplay)
Meteor.setInterval(randomAnswer,
1000);
}
});
Solution
// server
Meteor.publish("studentById", function (id) {
return Students.find(id);
});
// client
Tracker.autorun(function() {
Meteor.subscribe("studentById", Session.get('studentId'));
});
Conclusions
★ Real-time reactivity: UX opportunities
★ autopublish: use only for prototyping
★ latency compensation may hide problems
★ Kadira is a must-have