In this presentation can see some Meteor stuffs. Can learn how to install meteor and learn to code some basic things. This presentation based on www.discovermeteor.com
▪ Each Lesson has • Title • Date - Time • Location • Mini Description ◦ Registration/Login System ◦ Any logged in user can leave a feedback/comment ◦ Only admin can add new lesson and edit previous meteorlessons.meteor.com github.com/mstamos/meteorlessons
Regular Meteor packages ◦ Maintained by Meteor Development Group (like accounts-ui) • Third-party packages ◦ you can find them at atmospherejs.com • Local packages • NPM packages
into your app you just write the command • meteor add twbs:bootstrap ◦ twbs the package author’s username ◦ bootstrap is the package name • meteor remove twbs:bootstrap
/client: loaded on the client only • /tests: not loaded, use it for local test • Everything else runs on both the client and the server • Your static assets (font, images etc) go in the /public
variables are stored in the browser’s memory ◦ local to the current browser tab • The browser’s storage ◦ using cookies or Local Storage • The server-side database
that takes care of storing your data in the permanent server-side MongoDB database • Where to put them? ◦ Inside the lib directory to secure that are always defined first ◦ executed both to the client and to the server
The Mongo Shell ! Posts.findOne(); {title: "A new post", _id: LocalCollection._ObjectID}; First browser console ! Posts.find().count(); 1 ! Posts.insert({title: "A second post"}); 'xxx' ! Posts.find().count(); 2 ! db.posts.find(); {title: "A new post", _id: ObjectId("..")}; {title: "A second post", _id: 'yyy'}; The Mongo Shell ! Posts.find().count(); 2 Second browser console
Meteor app • The goal of autopublish is to make it very easy started coding your Meteor app • automatically mirroring all data from the server on the client
• in order to create an account he must insert ◦ username ◦ email ◦ password • User could type a message into an input text box (html tag) and publish it by pressing a submit button • Anyone could write a message ◦ If user is logged in, then his username should be appeared next to his name, otherwise “Anonymous”. Github link: https://github.com/mstamos/meteor-lesson-exercise-2