Rewriting CC [part 1]

The Critique Circle website is in trouble. Much like a piece of fiction you've been working on for way too long, CC's codebase is stagnant and way past its expiration date.

Jón Bjarni Bjarnason
Share:

I've known for at least a decade that CC was beyond salvation. Much like some of my scribblings, either I have to abandon it completely or rewrite it from scratch.

Some backstory

Critique Circle started as an icelandic website called rithringur.is (which has since been discontinued) which opened on Jan 1st 2003 and already by then Classic ASP, the web technology that powers the site, was being deprecated by Microsoft in favor of the new .NET framework. I had made a terrible error in judgement when picking a web stack. This was was my first attempt at writing a website and I'm afraid I didn't know any better at the time. Woops.

Most of the code here is around 17-18 years old and I'm afraid code does not age like fine wine. As time went by support for classic ASP lessened and it became harder and harder to find help, code snippets or plugins. Everyone was migrating from from ASP either to .NET or another web framework altogether.

As much as ten years ago each server upgrade was becoming a chore because newer versions of Windows and Internet Information Services stopped supporting classic ASP out of the box and needed increasing number of hacks. The last hardware upgrade was ten years ago and it was quite difficult.

CC is now running on an old Windows 2008 box which has reached its end-of-life and the provider has informed me I will be losing the box soon and we need to upgrade again. This upgrade will be uncomfortable for sure, and I think it's time I face my demons and see about moving the site into the 21st century, or at least the latter part of the 20th century. I will need to move the site to a more recent windows box and go through the song-and-dance one last time. Luckily Microsoft is very good in supporting old tech and maintaining backwards compatability so this will take some time, but hopefully I'll be able to get it done.

What exactly is CC?

The CC website is a classic ASP web application with a MS SQL Server database. The whole thing runs on one quad core Windows machine with 8GB of RAM. The machine was very powerful at the time, but it's getting a bit long in the tooth now.

The website itself is not horribly complicated as such but there is a lot of code. The backend is roughly 120.000 lines of code and we have over 200 tables in the database. The database is approximately 15 GB in size and contains something like 20 million rows. In addition we have a few thousand lines in python scripts and a few hundred in database functions called stored procedures.

There is no separation between controllers and views in the application so the html is generated inline with backend functionality. This makes any change quite cumbersome.

Here we can see how the code is split between different systems

Of course the reality is more muddled than this, but in terms of broad-strokes this gives me a reasonable indication of how much effort it will take to migrate each distinct system.

CC of the future

In order for CC to be relevant going forward I need to be able to add new features and keep up with advances in web development. This is not at all possible with the current stack and there is no migration path possible to a new web stack. Therefore the entire site will be rewritten. Obviously this is an ungodly amount of work. Why go through all that trouble, isn't CC just fine as it is, are there any features that we need?

Here are some potential features that I might implement once CC is rewritten

Mobile App

Although CC's webpage now supports mobile clients it would be very nice to have an android/ios app for CC that could send you notifications and allow you to interact with the site in a more natural manner.

Realtime chat

It might be nice to be able to chat with other CC'ers in realtime directly on CC, or even have the ability to discuss a crit while it is being written. Maybe a whole new realtime crit function would be possible.

Push notifications

Modern browsers support push notifications so that you could get notiified immediately if you receive a crit or a message.

Public API

We could have an API that allows other developers to interact with CC and even build their own applications.

Feed

We could have a newsfeed style notiification system similar to social media sites where your likes, crits, replies and mentions and whatnot could all be digested.

Revamped inline crits

By rewriting the inline crit system we could have the ability to do inline crits not online per paragraph but inside paragraphs as well, similar to what you see in word processors. I'm actually thinking of removing the different critique types and having just the inline option but you could do direct inline comments, paragraph comments, or simply a 'classic' crit. It would even be possible to do edits of the story text as the crit.

Revamped session and login system

We have a bunch of hacks in place to keep users from getting logged out during critical points because the web session isn't stable enough. This was a huge problem on the web 15 years ago but is just 'fixed' in modern frameworks. In addition, I would very much like to see 'login/signup with google/facebook' functionality. Usernames are so 2000's...

Rich editor

I would like to see a rich wysiwyg editor on CC, where we can format text like we're used to in a text editor (and on most web pages) and things just work.

The sky's the limit

There is so much that we can add to CC if we move to a modern web framework. In addition to the random list above, just normal everyday features and additions will be more frequent and will have more quality.

 

Okay, so now we know why we need to rewrite CC and the benefits are numerous. The problem is that there there are just too many features and functionality written over the course of 18 years. The work seems insurmountable and I'm just one guy. It's time to come up with a plan.

[to be continued...]

Member submitted content is © individual members.
Other material ©2003-2021 critiquecircle.com