grails (11) vaadin (11) meteor (6) java (4) elasticsearch (3) apple (2) centos (1) cloudbees (1) google analytics (1) gradle (1) heroku (1) javafx (1) javascript (1) jdbc (1) jug (1) logback (1) logging (1) mac os (1) management (1) mongodb (1) mongolab (1) mysql (1) twitter (1) ubuntu (1)

Sunday, May 26, 2013

How to deploy Meteor on Heroku with external MongoDB


This blog post is obsolete, use instead: http://justmeteor.com/blog/deploy-to-production-on-heroku

The case is following, you have made a Meteor application and you want to deploy it on heroku.com. Also, you want to use external MongoDB database provided by mongolab.com.
  1. Register at https://id.heroku.com/login 
  2. Install Heroku Toolbelt from https://toolbelt.heroku.com
  3. Register at https://mongolab.com/signup and create new MongoDB database (they give 500MB for free)
  4. Open the root folder of you Meteor project in console (you need a Git repository in order to deploy applications to Heroku, just set up one or use the one provided by Heroku, it becomes accesible after you create new application)
  5. Login to the Heroku from the command line: $ heroku login
  6. Create new Heroku application: 
    $ heroku create <appname> --stack cedar --buildpack https://github.com/oortcloud/heroku-buildpack-meteorite
  7. Setup other than default MongoDB for your Meteor application (you can get all the details for constructing the MONGO_URL from yours Mongolab account): 
    $ heroku config:set MONGO_URL=mongodb://<username>:<password>@ds027308.mongolab.com:27308/<dbname>
  8. Set the root URL
    $ heroku config:set ROOT_URL=http://<appname>.herokuapp.com
  9. Or this, in case you have got a domain
    heroku config:add ROOT_URL=http://yourdomain.com
  10. Add the Heroku Git repository as another remote to your git repository and push the code to that remote. The application will be automatically deployed and becomes accesible on <appname>.herokuapp.com 
    $ git remote add heroku git@heroku.com:<appname>.git
    $ git push heroku master
When you make changes to your code, just run git push heroku master again and all the commit from your origin/master will be released.

In case you want to see the response times for this setup, you can try it out on http://failtracker.com or http://templhub.com 
TextLab for Mac
Ultimate application to validate, clean and format JSON, XML, SQL, HTML.

Tuesday, May 21, 2013

Meteor with Google Analytics

Trying to get Google Analytics working with Meteor framework is so much fun. It took me quite some after I got this wonderful view:

How to get there: that is the question which is answered in the following gist.

Create new template, so we can hook to Template.googleAnalytics.rendered function. So, when googleAnalytics template is rendered, we can call Google Analytics service.
Insert the template into the HTML page that should be reported to Google Analytics.
Implement the call to Google Analytics service as follows (just replace 'UA-111111-1' with your token).
Thanks to these two sources.
TextLab for Mac
Ultimate application to validate, clean and format JSON, XML, SQL, HTML.

Thursday, May 9, 2013

Vaadin 7 Cookbook

Few things I would like to share about Vaadin 7 Cookbook.
We started writing the book since Vaadin 7 alfa versions - which was hard because we needed to made a lot of changes before releasing the book. But, it gave us a lot of knowledge about Vaadin 7 and we could put it into that book. And that makes the book amazing for those who are starting with Vaadin 7. 
One of the first feedback, was "If I would be a beginner with Vaadin, this is the kind of book I’d like to study - a lot of examples that do a single thing, and everything regarding to that one thing is well explained. ... that’s how I learn new things, not by reading theoretical ramblings regarding things and stuff." - vaadin blog 
Luckily, I could participate a project where we used Vaadin 7 with Grails, which was amazing experience. Many notes are included in the book. 
Jaroslav Holan accepted my offer to be co-author, thanks to him the book is more rich for recipes that I would hardly include. Thank you for that, Jaroslav
Looking forward to hear you reflections.