Meteor Framework Enables to Create and Deploy Scalable Web Applications on the Cloud. Here is How to Get Started with Meteor. But, before we get started, some topics around Scalable Web Applications on the Cloud must be explained. Previously, we talked about the Characteristics For Being a Cloud Application and Why Cloud Based App Needs API. Meteor is an open-source JavaScript web application framework. It was first introduced in December 2011 under the name Skybreak. At its core there is the Distributed Data Protocol.
Build Scalable Web Application with Meteor Framework Hosted on Their Website
As Meteor is Open Source, we can deploy it in two ways :
- Hosting at the Project’s Server with HTTPS subdomain (like Heroku, OpenShift PaaS) for Free
- Hosting Meteor on Own Web Server
The first way is explained in brief on this paragraph. This is quite easy. Simply point to this URL :
---
1 | https://www.meteor.com/ |
Sign up and create your named application. For example, if your application’s name is abhishekghosh
, probably you will love to point towards :
1 | https://abhishekghosh.meteor.com/ |
Just for an Example application, this is the way :
1 2 3 4 5 6 7 | #Install Meteor curl https://install.meteor.com | sh # Make a copy of the example app meteor create --example leaderboard cd leaderboard # Deploy it, `abhishekghosh` is your App's name meteor deploy abhishekghosh.meteor.com |
Quite easy, right?
Build Scalable Web Application with Meteor Framework Hosted on Own Server
Bundle your app on localhost using :
1 | meteor bundle deploy.tar.gz |
to make a file called deploy.tar.gz in your meteor directory containing your project. Spin up a Server (on Rackspace Cloud or something like that) and Install node.js. Upload your project and uncompress it :
1 | tar -xzvf bundle.tar.gz |
Note : Node.js installation has not been shown here.
Fibers is needed for any meteor project for synchronous style code on server side Javascript. CD to the directory and install Fibers :
1 2 3 | cd bundle/programs/server/node_modules rm -r fibers npm install fibers@1.0.1 |
Get MongoDB installed and test it :
1 2 | cd ../../../ node MONGO_URL=mongodb://dbuser:dbpassword@dbhost:dbport/meteor ROOT_URL=http://yourwebsite.com app.js |
Install Forever :
1 2 | sudo npm install forever -g forever start MONGO_URL=mongodb://dbuser:dbpassword@dbhost:dbport/meteor ROOT_URL=http://yourwebsite.com app.js |
Another easy way is to run a script to deploy Meteor on EC2 (or your own server).
Note : You can use Rackspace DevOps Automation Service, it has Meteor as managed service.