Monday, October 20, 2014

What can you build with Meteor?

In early 2012, I was searching for a platform, framework or stack with which to build EtherPOS (video) and eventually SignWaive (video).   I had looked at every possible option and had decided Node.js was the best solution.  Primarily, because of the advantages of a single language code base, the possibility of sharing code between the client and server and the potential for real-time communication via SocksJS or Socket.io.  I needed a solution that would allow me to build something that behaved like an application and not a website from the 90s.

I had already stumbled upon Meteor because of the original hacker news article.  I was in San Francisco for the Future of Money & Technology Summit III and there was quite a bit o chatter about Meteor among some of the developers in attendance.   Generally, in order to evaluate a solution, I build some basic applications first to see what it is like.

So, well before EtherPOS and SignWaive, I embarked on the grand adventure of creating my first Meteor application...or rather applications...

My very first Meteor and Javascript application was anonistreamr which is running to this day at anonistream.in (anonymously streaming).

Anonistream.in is a real-time multi-user anonymous stream of consciousness application.  The concept is people can share whatever they want, from the most mundane to the most intimate things, anonymously.

The concept was anonymous sharing of whatever comes to mind.  It prompts users with questions to get the ball rolling.  It also posts to the anonistream.in Twitter profile and the anonistream.in Facebook page.

Anonistreamr renders the 100 most recent posts and uses css to reduce the font size and opacity.  So, posts seem to disappear down the page in a sort of existential angst similar to how little people probably really care about each other's thoughts and feelings.  The Twitter profile and Facebook page have record of most of the past posts.

If a few people are using the application at the same time you will find yourself experiencing a range of emotions as you read their posts.

Sometimes, I laugh out loud.

Sometimes, I hope the anonymous person who posted is just kidding.

Sometimes, I wonder who they are and I hope that they have someone to talk to.

It can create interesting insights into your own life when you read the replies to some of the questions that other people post.

I have seen it be a sort of anonymous public venting, ranting, confessional and gratitude/appreciation journal all wrapped up into one.

It can be really funny reading some of the old posts on both the Twitter and Facebook feeds.

For example, every time I read "...next week...Ninjas be slippin' " on the Twitter archive feed I laugh out loud.   I am not sure why, but it is just hilarious on all kinds of levels.

A fun anonistreamr game is to get a few people using the application and trying to see if you can guess who posted what.  You can be in the same room or just in chat or a hangout.

When building anonistreamr, I didn't know what anonymous social networks were and had no idea that they would become a "thing"!

I just wanted to learn basic CRUD, publications/subscriptions, rendering and the other various components of Meteor to determine if I could built a real-time point of sale system such as EtherPOS.

Based on the anonistreamr github history, I wrote the application sometime in April 2012.  The first post archived on Facebook and Twitter corroborates.


...what cheers you up? her smile
LikeLike ·  · 

Aww shucks how mushy, right?  Hey, at least it is more thoughtful than "Mr. Watson--come here--I want to see you." right?  Though, clearly not a revolutionary solution to a problem like Bell's.

The original code base is very interesting.  I called the old branch "supaearly", before recently branching to upgrade to the latest code base for the latest Meteor release.

There are interesting things we had to do in order to get node packages to work or send Emails or post to Twitter or Facebook within a Meteor application.

Almost all of it can be seen in the server.js.  Almost all of my early Meteor Stack Overflow questions are the result of building anonistreamr.

It was interesting to go back and look at something written on pre-historic Meteor to see how far Meteor has really traveled...and how much the Meteor Development Group has accomplished...with all of us along for the ride!

My favorite bit of legacy Meteor application development code is...

_.each(['Posts', 'Questions', 'ContactUsFormPosts', 'AddAQuestion', 'Subscribe'], function(collection) {
    _.each(['insert', 'update', 'remove'], function(method) {
      Meteor.default_server.method_handlers['/' + collection + '/' + method] = function() {};
    });
  });

WTF does this do, right?

That magical bit of code was necessary in order to be able to hook into insert, update and remove methods on a collection!

Anonistreamr provided me the opportunity to get my hands dirty all the way up to my elbows in javascript and Meteor thereby preparing me to write EtherPOS and SignWaive.

For some reason, while developing anonistreamr I thought I had to have server side sessions before I could build a point of sale system on Meteor!

It just seemed like something I had to have.  All applications need server side sessions, right?

So, I embarked on my second Meteor application called Sessie which is also still running at http://sessie.meteor.com/

Sessie is an attempt at a simple server side persistent session management package for Meteor.  It is a bit odd, weird and unique. It is very noobular.  Sessie creates, validates and manages sessions.  Loch is where Sessie stores persistent session data when you feed her.  Monster destroys Sessie sessions and Loch session variable collection items.

I really don't know how it is still running?

I haven't updated this code since Aug 8, 2012 and haven't deployed since then!  This just goes to show you how solid Meteor deploy hosting can be even though it is primarily intended for non-production applications!

Speaking of production application hosting, I ran my 18 store retail chain on EtherPOS on top of Meteor's meteor deploy infrastructure for 3 months (Apr 2013 - June 2013), but that is another story for another day!

Now, why I thought I needed server side sessions I really don't know.  It just seemed like something I had to have.  I have noticed a tendency for developers to have a list of things they believe they need that they generally do not use which results in rationalizations for the argument of why they shouldn't try something new and different.

The bigger question is why I thought I could build server side sessions for Meteor when anonistreamr was not only my first Meteor app but also the first time I wrote anything in Javascript!

If you have time, do read the http://sessie.meteor.com/ feature set.  It is quite funny. I am not sure why I thought I would even need these features.  I certainly didn't use any of them in EtherPOS.

It is interesting to look back at anonistreamr and Sessie.  It is interesting for me to look at the feature set and read the code base.  It helps me realize that they were both necessary for me to build my real production Meteor applications.

Anonistream seems somewhat a folly and Sessie seems almost futile until you consider...

  1. I had never written a Javascript based application prior to anonistream.in and Sessie.  In fact, prior to early 2012, I consider javascript a necessary evil...and definitely mostly evil.
  2. I had certainly never written anything in Meteor because it was barely a year old.
  3. That I then went on to create a full featured point of sale system and paperless document management system as my follow on projects.
So, if someone that had...
  1. Never written a Javascript application before.
  2. Had only heard about Node four months prior.
  3. Had never used Meteor before (and literally couldn't have because Meteor was only a few months old)
..could build both of these then what are the possibilities?

Unlimited.  That is what they are.

Those possibilities are both still being realized both in EtherPOS and SignWaive.  
With EtherPOS we have realized an amazing amount of business automation that has allowed us to convert an 18 store brick and mortar retail chain into a virtual company.  Yeah, we no longer need an HQ and are realizing about $250,000 in annual cost savings in various areas such as equipment, software, systems, processes and human resources.


Sometimes the road we travel is crazy, crooked and weird, but ultimately the best possible route to give us the best possible experiences necessary to achieve our real goals.

So, my question to you is what can you build with Meteor?

Getting started is as easy as 1, 2, 3....

  1. curl https://install.meteor.com | /bin/sh
  2. meteor create myapp
  3. cd myapp 
  4. meteor
Ok, well 4!

For more Meteor learning resources visit: https://www.meteor.com/learn-meteor

1 comment:

  1. LOL, "noobular" :)

    And yes, Meteor was *designed* to be easy to learn, and I wrote about that at http://www.meteorpedia.com/read/Why_Meteor. After two annoying weeks of AngularJS for a client-only project, I can only appreciate that so much more.

    ReplyDelete