#[Simple Meteor App for Document Sharing]
First, let’s install Meteor.
-
If you’re on Mac or Linux, simply open a Terminal window and type:
- curl https://install.meteor.com | /bin/sh
-
Creating a Meteor app is pretty easy. Once you’ve installed Meteor, all you need to do is go back to the Terminal and type this:
- meteor create docshare-tutorial
-
You’ll then be able to run your brand new app locally with this:
- cd docshare-tutorial
- meteor docshare-tutorial
-
Add packages nedded,Here i use smart coffeescript,backbone,accounts-password,accounts-ui,etc.The accounts-password,accounts-ui are used for implement runningegistation and login facility with username,email and password. To add packages Open up a new Terminal window (since your app is already running in the first one) and enter:
- mrt add accounts-ui
- mrt add accounts-password
-
In this App use Smart Collections,WHich is is a complete re-write of the MongoDB Collection API for Meteor. It is designed with following 3 areas in mind
- Speed
- Efficiency (Memory & CPU)
- Scalability
To add smart collection follow below steps
- mrt add smart-collections
-
Smart Collection is now retired & Meteor’s Collection implementation has fixes for most of the performance bottlenecks. It is also using the MongoDB oplog just like Smart Collections.
- You need to configure MongoDB for an active oplog - You need to use Smart Collections in your app* Now you need to use a separate MongoDB server * Start it with mongod *--replSet* meteor * Start a mongo shell and configure mongo as follows * Apply these commands var config = {_id: "meteor", members: [{_id: 0, host: "127.0.0.1:27017"}]} rs.initiate(config)* Use Smart Collections instead of Standard Collections * Start each Meteor instance with "OPLOG_URL" and the "MONGO_URL" *Apply these commands export MONGO_URL=mongodb://localhost:27017/appdb export OPLOG_URL=mongodb://localhost:27017/local meteor
MongoDB oplog is the heart of MongoDB’s replication engine (replicaSets). Oplog contains a log of all the write operations occurring in Mongo. In MongoDB replication, secondaries listen to master’s oplog and apply changes accordingly.