{"id":551,"date":"2014-07-30T16:38:28","date_gmt":"2014-07-30T16:38:28","guid":{"rendered":"http:\/\/www.nikola-breznjak.com\/blog\/?p=551"},"modified":"2015-08-10T07:09:31","modified_gmt":"2015-08-10T07:09:31","slug":"mean-io-vs-mean-js-and-deploying-the-latter-on-digitalocean","status":"publish","type":"post","link":"https:\/\/nikola-breznjak.com\/blog\/javascript\/nodejs\/mean-io-vs-mean-js-and-deploying-the-latter-on-digitalocean\/","title":{"rendered":"MEAN.io VS MEAN.js and deploying the latter on DigitalOcean"},"content":{"rendered":"<h2>What are they?<\/h2>\n<p>MEAN.(<strong>io<\/strong> + <strong>js<\/strong>) are both full-stack JavaScript\u00a0frameworks, and\u00a0they are both comprised of\u00a0these technologies:<\/p>\n<ul>\n<li><strong>M<\/strong>ongoDB \u2013 leading NoSQL database, empowering businesses to be more agile and scalable<\/li>\n<li><strong>E<\/strong>xpress &#8211; minimal and flexible Node.js web application framework, providing a robust set of features for building single and multi-page, and hybrid web applications<\/li>\n<li><strong>A<\/strong>ngular \u2013 lets you extend HTML vocabulary for your application. The resulting environment is extraordinarily expressive, readable, and quick to develop<\/li>\n<li><strong>N<\/strong>ode.js &#8211; a platform built on Chrome&#8217;s JavaScript runtime for easily building fast, scalable network applications<\/li>\n<\/ul>\n<h2>Which is which?<\/h2>\n<p>There seems to be a lot of confusion between the two, and this <a href=\"http:\/\/stackoverflow.com\/questions\/23199392\/difference-between-mean-js-and-mean-io\">StackOverflow answer<\/a>\u00a0can help clarify it. Essentially:<\/p>\n<blockquote><p>Mean.js is a fork of Mean.io and both initiatives were started by <a href=\"https:\/\/github.com\/amoshaviv\">the same guy<\/a>. Mean.io is now under the umbrella of the company Linnovate and looks like the guy (Amos Haviv) stopped his collaboration with this company and started Mean.js. You can read more about his reasons <a href=\"http:\/\/blog.meanjs.org\/post\/76726660228\/forking-out-of-an-open-source-conflict\">here<\/a>.<\/p><\/blockquote>\n<p>On their GitHub pages the MEAN.io has more stars, forks, and watchers but that may easily be to the fact that the MEAN.js is younger:<\/p>\n<div id=\"attachment_576\" style=\"width: 614px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/mean_1.jpg\" rel=\"lightbox[551]\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-576\" class=\"size-large wp-image-576\" src=\"http:\/\/www.nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/mean_1-1024x892.jpg\" alt=\"mean js github page\" width=\"604\" height=\"526\" srcset=\"https:\/\/nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/mean_1-1024x892.jpg 1024w, https:\/\/nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/mean_1-300x261.jpg 300w, https:\/\/nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/mean_1.jpg 1051w\" sizes=\"auto, (max-width: 604px) 100vw, 604px\" \/><\/a><p id=\"caption-attachment-576\" class=\"wp-caption-text\">MEAN.js GitHub page<\/p><\/div>\n<div id=\"attachment_577\" style=\"width: 614px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/mean_2.jpg\" rel=\"lightbox[551]\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-577\" class=\"size-large wp-image-577\" src=\"http:\/\/www.nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/mean_2-1024x927.jpg\" alt=\"mean.io github page\" width=\"604\" height=\"546\" srcset=\"https:\/\/nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/mean_2-1024x927.jpg 1024w, https:\/\/nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/mean_2-300x271.jpg 300w, https:\/\/nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/mean_2.jpg 1048w\" sizes=\"auto, (max-width: 604px) 100vw, 604px\" \/><\/a><p id=\"caption-attachment-577\" class=\"wp-caption-text\">MEAN.io GitHub page<\/p><\/div>\n<h2>How to get started?<\/h2>\n<p>I already wrote about MEAN.io and how to <a href=\"http:\/\/www.nikola-breznjak.com\/blog\/nodejs\/deploying-mean-io-to-nodejitsu-from-windows-machine\/\">deploy\u00a0it\u00a0to Nodejitsu from Windows machine<\/a>, and in this blog post I&#8217;ll show you how easy it is to deploy MEAN.js on\u00a0<a href=\"https:\/\/www.digitalocean.com\/?refcode=974c9bc93d77\">DigitalOcean<\/a>. Surely, you can deploy MEAN.io too on <a href=\"https:\/\/www.digitalocean.com\/?refcode=974c9bc93d77\">DigitalOcean<\/a>, but you would have to install all the prerequisites on your own, and as you&#8217;ll see the MEAN.js is all set up <em>automagically<\/em> with few button clicks.<\/p>\n<p><strong>Disclamer:<\/strong> I am affiliated with <a href=\"https:\/\/www.digitalocean.com\/?refcode=974c9bc93d77\">DigitalOcean<\/a>.\u00a0If the post helped you,\u00a0you can <a href=\"https:\/\/www.digitalocean.com\/?refcode=974c9bc93d77\">signup via my referral link<\/a>. They regularly offer free credit (currently they offer 10$) so you can try it out without paying anything (I&#8217;m sure you have the Google skills to get the discount code).<\/p>\n<p>So, from my experience with the cloud\u00a0hostings I was pretty much amazed how fast you can get your root box up and running on DigitalOcean, additionally they have the (so called) droplet for MEAN ready so in basically less than 1 minute you&#8217;ll have everything ready to start coding your MEAN project. Let&#8217;s now see how to do this step by step.<\/p>\n<h2>Create a droplet<\/h2>\n<p>Naturally, first you have to signup up with <a href=\"https:\/\/www.digitalocean.com\/?refcode=974c9bc93d77\">DigitalOcean<\/a>\u00a0(remember to look for coupons), and once you do that you&#8217;ll be able to login to their web admin dashboard.<\/p>\n<p>DigitalOcean calls its virtual servers, <strong>droplets<\/strong>; each droplet that you create is a new virtual server for your personal use. In order to create a new droplet from your web admin, click on the <strong>CREATE<\/strong> button, and select a custom hostname and size (as shown on the image below):<\/p>\n<p><a href=\"http:\/\/www.nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/create_1.jpg\" rel=\"lightbox[551]\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-581\" src=\"http:\/\/www.nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/create_1.jpg\" alt=\"create_1\" width=\"1003\" height=\"676\" srcset=\"https:\/\/nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/create_1.jpg 1003w, https:\/\/nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/create_1-300x202.jpg 300w\" sizes=\"auto, (max-width: 1003px) 100vw, 1003px\" \/><\/a><\/p>\n<p>All on the same page (scroll down), select a region which is closest to you (<em>London \u00a01<\/em> in my case, as shown on the image below):<\/p>\n<p><a href=\"http:\/\/www.nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/create_2.jpg\" rel=\"lightbox[551]\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-582\" src=\"http:\/\/www.nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/create_2.jpg\" alt=\"create_2\" width=\"708\" height=\"505\" srcset=\"https:\/\/nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/create_2.jpg 708w, https:\/\/nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/create_2-300x213.jpg 300w\" sizes=\"auto, (max-width: 708px) 100vw, 708px\" \/><\/a><\/p>\n<p>The most important part is selecting the actual distribution\/application that will be installed on your droplet by default. Here you have quite a few options and I encourage you to test them as you see fit. In my example, however, we&#8217;re gonna use the <strong>MEAN on Ubuntu 14.04<\/strong>\u00a0(as shown on the image below).<\/p>\n<p><a href=\"http:\/\/www.nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/create_4.jpg\" rel=\"lightbox[551]\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-584\" src=\"http:\/\/www.nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/create_4.jpg\" alt=\"create_4\" width=\"737\" height=\"451\" srcset=\"https:\/\/nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/create_4.jpg 737w, https:\/\/nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/create_4-300x183.jpg 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/a><\/p>\n<p>Finally, you can leave the additional settings as they are and you can confirm the droplet creation by clicking on the <strong>Create Droplet<\/strong> button.<\/p>\n<p><a href=\"http:\/\/www.nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/create_5.jpg\" rel=\"lightbox[551]\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-585\" src=\"http:\/\/www.nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/create_5.jpg\" alt=\"create_5\" width=\"758\" height=\"256\" srcset=\"https:\/\/nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/create_5.jpg 758w, https:\/\/nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/create_5-300x101.jpg 300w\" sizes=\"auto, (max-width: 758px) 100vw, 758px\" \/><\/a><\/p>\n<h2>Login to your new\u00a0droplet<\/h2>\n<p>Shortly after (less than <strong>1 minute!<\/strong>) you&#8217;ve clicked the <strong>Create Droplet<\/strong> button you&#8217;ll get\u00a0the email with the info on how to connect to your droplet. Below is the example of such an email. In order to connect to your droplet you can use <a href=\"http:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/download.html\">PuTTY<\/a>\u00a0(<span style=\"color: #000000;\">a free implementation of Telnet and SSH for Windows and Unix platforms<\/span>), and all you&#8217;ll have to do is enter the IP and click <strong>Open\u00a0<\/strong>(it&#8217;s good to name this connection and save it for later use &#8211; <em>digocean<\/em> in the image below).<a href=\"http:\/\/www.nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/connect_11.jpg\" rel=\"lightbox[551]\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-590\" src=\"http:\/\/www.nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/connect_11.jpg\" alt=\"connect_1\" width=\"706\" height=\"624\" srcset=\"https:\/\/nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/connect_11.jpg 706w, https:\/\/nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/connect_11-300x265.jpg 300w\" sizes=\"auto, (max-width: 706px) 100vw, 706px\" \/><\/a><\/p>\n<p>If the popup appears as shown on the image below, most likely you&#8217;ll want to click <strong>Yes<\/strong>.<a href=\"http:\/\/www.nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/connect_2.jpg\" rel=\"lightbox[551]\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-579\" src=\"http:\/\/www.nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/connect_2.jpg\" alt=\"connect_2\" width=\"672\" height=\"424\" srcset=\"https:\/\/nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/connect_2.jpg 672w, https:\/\/nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/connect_2-300x189.jpg 300w\" sizes=\"auto, (max-width: 672px) 100vw, 672px\" \/><\/a><\/p>\n<p>When you log in with the username <strong>root\u00a0<\/strong>and password that you got in the mail, you&#8217;ll be prompted to repeat the root&#8217;s password and to change it to something else, which is a standard security practice.<a href=\"http:\/\/www.nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/connect_3.jpg\" rel=\"lightbox[551]\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-580\" src=\"http:\/\/www.nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/connect_3.jpg\" alt=\"connect_3\" width=\"649\" height=\"387\" srcset=\"https:\/\/nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/connect_3.jpg 649w, https:\/\/nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/connect_3-300x178.jpg 300w\" sizes=\"auto, (max-width: 649px) 100vw, 649px\" \/><\/a><\/p>\n<h2>Run the application<\/h2>\n<p>Your application will be located in\u00a0<strong>\/opt\/mean<\/strong>\u00a0 folder, and in order to run it you just have to\u00a0execute the following command in that folder:<\/p>\n<pre class=\"lang:default decode:true\">grunt<\/pre>\n<p>Output that you&#8217;ll most likely see after running the <strong>grunt<\/strong> command can be seen on the image below:<\/p>\n<p><a href=\"http:\/\/www.nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/run_1.jpg\" rel=\"lightbox[551]\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-586\" src=\"http:\/\/www.nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/run_1-1024x877.jpg\" alt=\"run_1\" width=\"604\" height=\"517\" srcset=\"https:\/\/nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/run_1-1024x877.jpg 1024w, https:\/\/nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/run_1-300x257.jpg 300w, https:\/\/nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/run_1.jpg 1063w\" sizes=\"auto, (max-width: 604px) 100vw, 604px\" \/><\/a><\/p>\n<p>To view\u00a0your application in the browser, visit http:\/\/YOUR_DROPLET_IP:3000\/ (in my case that would be http:\/\/178.62.47.198:3000) and you should see a screen similar to the one on the image below:<a href=\"http:\/\/www.nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/run_2.jpg\" rel=\"lightbox[551]\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-587\" src=\"http:\/\/www.nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/run_2.jpg\" alt=\"run_2\" width=\"840\" height=\"605\" srcset=\"https:\/\/nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/run_2.jpg 840w, https:\/\/nikola-breznjak.com\/blog\/wp-content\/uploads\/2014\/07\/run_2-300x216.jpg 300w\" sizes=\"auto, (max-width: 840px) 100vw, 840px\" \/><\/a>Finally, all done. Next logical step would be to check out he <a href=\"http:\/\/meanjs.org\/docs.html\">MEAN.js docs<\/a>.<\/p>\n<p>Happy building!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What are they? MEAN.(io + js) are both full-stack JavaScript\u00a0frameworks, and\u00a0they are both comprised of\u00a0these technologies: MongoDB \u2013 leading NoSQL database, empowering businesses to be more agile and&hellip;<\/p>\n","protected":false},"author":1,"featured_media":573,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-551","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-nodejs"],"_links":{"self":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/551","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/comments?post=551"}],"version-history":[{"count":9,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/551\/revisions"}],"predecessor-version":[{"id":596,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/551\/revisions\/596"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/media\/573"}],"wp:attachment":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/media?parent=551"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/categories?post=551"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/tags?post=551"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}