Thursday, December 15, 2011

Installing My Funky Calendar (Backbone.js)

‹prev | My Chain | next›

Up tonight, I hope to finish off my efforts to get my simple Backbone.js application, Funky-Backbone.js-Calendar, easily install-able. By "easily install-able", I mean:
  1. install node.js / npm
  2. git clone git://github.com/eee-c/Funky-Backbone.js-Calendar.git
  3. npm install
I already have node.js and npm installed, so I skip to step #2. In a temporary directory, I clone the github repo:
➜  tmp  git clone git://github.com/eee-c/Funky-Backbone.js-Calendar.git
Cloning into Funky-Backbone.js-Calendar...
remote: Counting objects: 1027, done.
remote: Compressing objects: 100% (534/534), done.
remote: Total 1027 (delta 512), reused 961 (delta 446)
Receiving objects: 100% (1027/1027), 280.11 KiB | 105 KiB/s, done.
Resolving deltas: 100% (512/512), done
In that cloned directory, I have to follow a temporary additional step—checking out the "dirty" (as in node-dirty) branch. Assuming this goes OK, I will merge this into master and eliminate the step:
➜  tmp  cd Funky-Backbone.js-Calendar 
➜  Funky-Backbone.js-Calendar git:(requirejs) git co dirty
Branch dirty set up to track remote branch dirty from origin.
Switched to a new branch 'dirty'
Now, I need to install the node.js modules required to run the server:
➜  Funky-Backbone.js-Calendar git:(dirty) npm install
dirty@0.9.5 ./node_modules/dirty 
dirty-uuid@0.0.2 ./node_modules/dirty-uuid 
express@2.5.2 ./node_modules/express 
├── mkdirp@0.0.7
├── qs@0.4.0
├── mime@1.2.4
└── connect@1.8.2
Man, I freaking love npm.

With that, I am ready to start the application server:
➜  Funky-Backbone.js-Calendar git:(dirty) node app
The "sys" module is now called "util". It should have a similar interface.
Express server listening on port 3000 in development mode
Hrm... I am not sure what that "sys" vs. "util" message is. I will worry about that another day.

For now, I navigate to http://localhost:3000 and am greeted by an empty calendar:


If I click on any day in the calendar (today's date for instance), I am greeted with an add-appointment dialog:


Clicking "OK" saves that record, which then shows on the calendar:


I can even update and delete appointments by clicking on the appointment title and the little "X" next to it, respectively.

Satisfied that all is in order, I merge the node-dirty branch into master and update the README.

There are a couple of minor little bugs in there. I will likely resolve them quietly. Tomorrow, I hope to do a little cleanup work with jasmine before calling it quits.


Day #235

No comments:

Post a Comment