Meteor

The Future Web Platform

By Daniel Chcouri / theosp.github.io

Meteor

  • Full stack web platform for single page applications
  • Real time interaction with the server via sockets
  • Based on node.js (js on server & client)
  • Modular - Easy to extend

Background

Project File Structure


meteor-project
├── common
│   └── myapp.js
├── server
│   └── myapp.js
├── client
│   └── myapp.js
└── main.html

Templates

main.html


<head>
    <title>Project Title</title>
</head>

<body>
  <h1>Today's weather!</h1>
  {{> forecast}}
</body>

<template name="forecast">
  <div>It'll be {{prediction}} tonight</div>
  <button>Button</button>
</template>

Templates Helpers

client/myapp.js


Template.forecast.prediction = function () {
  return Math.random() > Math.random() ? "cloudy" : "cool and dry";
};

Templates Events

client/myapp.js


Template.forecast.events({
  'click button': function () {
    alert("Clicked");
  }
});

Packages

  • Coffee script support
  • LESS css
  • Users support (FB, Twitter, etc. bundles)
  • Bootstrap
  • Internationalization

$ mrt add bootstrap-3

More Key Concepts

  • Sessions
  • Collections & Publish/Subscribe
  • Reactivity

Open Chat Development Demo

Thank You!

Daniel Chcouri / theosp.github.io