Reinventing the Wheel - Part I: Homegrown Blogging

I like doing things my own way, myself. Part of it is because doing things myself helps increase my understanding. Part of it is also I'm a complete control freak.

This explains why, when there are tools out there like Blogger, GreyMatter, Moveable Type, Radio, and so on, ad infinitum, I am still using a bunch of hand written Python scripts to generate a database driven blog. Yep, it's a bit clunky, and sure it doesn't have the latest, greatest stuff. But it's mine and I love it.

What follows is my thinking-out-loud process of developing a better version of the scripts, and a serious implementation attempt that began around August 2003.

To begin, ladies and gentleman, we have a lovely database model.

Organizing into Projects

When I first made my loveable little jalopy of a weblog backend (back in... 1999? 2000? something like that), it was pretty simple collection of concepts. I had "articles" (like the thing you're reading now) and "categories." Each article had one category, and each category could have as many articles as it wanted. Articles had a title, description, some content (this is the content here!), a timestamp for when it was created, and another one in case I ever updated/made edits to it. Another table for the blogroll links, and voila, it was a weblog! (Well, after some serious Python hacking, it was.)

But I wanted to do new things besides just post random stuff on a semi-regular basis. I have a Grand Vision. I want to be a writer. I want to post my writing projects. I want to be able to categorize stuff that I'm working on. I want different drafts of the same thing to be grouped together. So now I've got a project-orientated model.

The Nitty Gritty

Here's the new list of major tables that I've implemented in the database. It doesn't include tables that accomplish many-to-many foreign key links.

weblogs
Defines an individual weblog. Potential examples include "The Geek Icon" (what ARJLog will be transmogrified into), "All Things White and Circular" (what I think I will call my writing journal), and anything else that occurs to me, depending on how much brain I have to dump after this. A weblog has: a name; a description; a creation date; a root url.
projects
Defines a group of associated articles and links that all have to do with a particular finished product in mind. A project might be a poem, a program, a short story, or a sock I am knitting and documenting on my blog. A project has: a name, a type, a description, a creation date, and a status.
category
Defines a group of articles or links that are topically similar. For example, my blogroll could be a link category. "Lame Pseudo-Techie Ramblings" could be an article category. Projects could contain articles from a number of different categories. Categories could contain articles from a number of different projects. There's no direct hierarchical link between the two. Categories have: a name, a description, a parent (for categories within categories).
link
A link is just an external url. Like a blogroll link. It has: a url (duh), link text (e.g. the words that get linked), a description (optional additional unlinked text describing what the link is), an annotation (like a mini-editorial about the link, optional also), and a creation date.
article
Defines an individual block of text in which I compose some words that are supposed to mean something. This thing you are reading right now is an article. I think it should be pretty self-evident. An article has: a title, a description, a creation date, an updated date, content, and some keywords. An article can only belong to one blog and one project. It can belong to more than one category.
comment
Text that someone else can write about my article. I think this should be self-evident too. A comment has: commenter's name, commenter's email, the comment itself, a creation date. A comment belongs exclusively to one article only.

Those are the basics. Hopefully by the next post I'll find time to put up a full, formal database spec.

[Link] Comments: [0] Categories: [Techo] Project: [Homegrown Blogging]