Monday, November 22, 2010

Making a business portal - case study startup

I'm currently working on business portal which is to include some community building features. As I'm building it from cratch I thought I could make a nice case study out of it. Fortunately I'm not in a hurry with this one so I can spend some time to write about it :)




Background

My client runs a business portal for couple of years now. In the beginning I was hired as a webmaster and I was to do fixes and little upgrades when it was needed. So I started looking through the code to see what I'm about to work with. Just after few minutes I was stunned - it was a totally messed up PHP4 code. For the worse - it was using Smarty templating system which I hate with all of my heart. Website in overall had ageing layout and lacked many functionalities. I shared my reflections with my client and he agreed that it's worth to rewrite it and give it a new shiny look and new functionalities.

Technology

Of course my framework of choice was Symfony. I think I don't have to explain why :) I've decided to use Diem as a base platform as it offers a lot of candies just out of the box. It has everything that Symfony offers plus much more. I'm not willing to reinvent the wheel so why not to use something that's ready and working?  It is my first time I'm building a project on Diem so it adds some educational value to it. After playing with it a little I have to say that it is great once you learn how to work with it.

I have decided that all functional modules will be created as plugins. I'll have to write many functionalities myself so I want be able to use them in other projects. From the same reason I'll try to keep ORM separated from models as much as it is possible (see HERE and HERE) With not-so-much-into-the-future introduction of Symfony2 with Doctrine2 I want to be prepared for switching ORMs.

Challenges

The biggest challenge will be migrating data between databases. The old version of portal has thousands of articles and other important data that cannot be lost. As I'm building database from scratch it will be totally different than the old one. Another thing is advertising system, which will have to be quite advanced to meet needs of my client. I woud like to incorporate some existing one, but if I don't find anything useful I'll write it on my own. Basically I want to use as much existing code as possible. Mainly to save time, but also to help myself tin maintaining the code later. The more is done outside the project the less time I'll have to spend later on developing new features and fixes. Because of low budget I'll have to depend on free solutions.

That's it for now. If anyone can recommend some free ads system drop me a line.

2 comments:

  1. This sounds interesting.
    I'll keep an eye on this blog for sure :)

    And what about testing ?
    If you find some places that you would rather refactor than recode it could be good idea to provide some functional tests earlier.


    Good luck
    Best regards

    ReplyDelete
  2. I'm not a big fan of test driven development so right now I'm not really concerned about testing. Usually I write unit tests after the basic module functionality is done and working. On the other hand I'm aware that working alone on such a big project will keep me from writing extended tests. Keeping things encapsulated will have to do the job.

    Refactoring is not an option. Old code is some kind of custom CMS with really ugly data structure and messed up code. Refactoring in this case is just a waste of time ;)

    ReplyDelete