Bill Farrar

Portfolio Site and Blog

Boards : Technology

March 16, 2012

So, let’s talk about technology.

We need a back-end, something to persist state and manage stuff on the webserver end.  I’ve thought some about using node.js, both to learn to use it, and because we’ll need to be writing rules about what kinds of moves players can make, by using JavaScript on the server side, it would mean we could write that code once. Otherwise, we’ll be writing the same logic in more than one language.

Unfortunately, I don’t control the server I’m using (I have a home linux server, but I want this on a more robust site than my home Internet).  That puts node.js out of my reach for now, but I’ll leave it as an option.  So instead of learning something new, I’ll go with something I’m comfortable with on the server, and that’s LAMP.  Since I don’t want this to be a big drain on my time, I’m also going to use CakePHP since it’s what I’m using at work, and getting more familiar with it just makes me better at work.

I don’t have any illusions that PHP is the best web programming language, or that Cake is necessarily the best library to use (or that I really need something as hefty as Cake for this project).  But what I do know is, that when I look at the skills of the programmers (aka: me), this is what they know the best.  I’ll be more productive this way, and until there’s some technology requirement to do something different, I’ll keep with it.  I suspect we may refactor away from cake at some point (and perhaps away from PHP), but for this beginning bit, I’m sticking with this as the backend.

The front end is HTML5 with JavaScript.   Why HTML5? Primarily because of Canvas.  I want to be able to support image composition and saving it into the database, and I know I can do this with Canvas.  That may come later (when we start letting players design maps, for instance) and there might be some other features we can leverage, since we can easily draw on canvas, etc.  This does limit the browsers, but my primary users are all on G+ which already requires HTML5, so that doesn’t limit us too much.

For JS, I’ll be using the jQuery library.  They’ve already got a lot of the animations, drag and drop functionality and other bits that will make this pretty easy.  I looked at a project called fabric.js which is a really nice canvas toolkit.  It has some bugs with it’s event system, mainly for things that are stacked on top of each other. It’s fixable (I’ve looked at it and think I might be able to do it.)

On the other hand, jQuery uses the dom to move things around, and I’m familiar with that already.  Again, this may be a temporary decision, and I may borrow some techniques from fabric as they’re needed.  The goal here is largely OSS while running a service, so I’ll release anything I make — so I figure a little borrowing is okay.

I’ve also got a html framework that works with html5, incorporates a good clearfix and tools which bring all the different browsers in line.  If I was going to support ie6, it’d work too.  I need to make sure that I’ve got links to it in my template, and clean the templates up a bit for this project, but it’s also freely available.

So that’s the technology we’re going to start with.   I need to get a todo list updated on the site, but on Monday we’ll start looking into how we’re going to handle users.  By this time next week, people should be able to log in.  In two weeks, there should be some basic VTT functionality as we work on phase 2.  That’s the plan anyway (and since I need it in two weeks, I better keep to the plan.)

Bill Farrar
Bill Farrar
Full stack developer with over 20 years in web technologies and over 30 years as a software engineer and designer. Senior systems analyst and team lead, spending time running projects and mentoring peers.