Normally I choose topics for the blog based on discussions or things which have happened during the week. At the moment I'm a bit electrically washed out, so for this post I decided to choose a non-electrical topic. After some thought I remembered a colleague asked me the other week how myElectrical was programmed; this seems as good a topic as any.
myElectrical is a personal endeavour which I started a few years ago (sometime in 2002). It started as a quick attempt at making some software available online and evolved into what it is today.
Over the years the site has grown from a couple of pages to what it is now. It's been a learning curve, devourer of evening and weekend hours and despite the odd frustrating moment a rewarding and enjoyable experience. I'm quite please with the way the site has turned out and hopefully it will continue to grow and improve.
In making the site I have blended various techniques and third party pieces of software to create myElectrical. To understand how this works it is probably best to break the website down in to sections:
Main Site
The portion of the site directly programmed myself I tend to call the 'Main Site' (if someone browses to http://myelectrical.com they end up here). This is programmed around asp.net and Visual Basic using Microsoft's Visual Web Developer. To work properly the site requires a database to store bits and pieces of information. For the database I use Microsoft’s SQL Server.
There is an express (free) version of both Microsoft's Visual Web Developer and SQL server. For budding site owners these are great tools and expandable to full versions.
Visual elements of the site are controlled by the use of Cascaded Style Sheets. This separates the web-page coding from the visual appearance of the site, allowing the sites appearance to be easily updated. Microsoft’s Ajax extension is also used to limit full page post backs - you can see this on some pages where you get the rotating wheel while it is uploading new content.
Additional features not be immediately obvious include identifying users based on IP address and providing appropriate/different content, an email queuing system so that mail is not lost and background tasks to update main page content, etc.
You can tell if you are moving around the main site by looking at the address bar - the pages should be starting with either http://myelectrical.com or http://www.myelectrical.com.
Community (forums, blogs)
In adding forums to the site I wanted a framework which would be stable and have an expansion route going forward (and be compatible with asp.net). After a lot of research I settled on a product called Community Server by Telligent Systems. Main reasons for choosing this (apart from being programmed in asp.net) were that the framework is widely used (including being used by Microsoft), offers upgrade paths and is promised to be continually supported by the developer.
As a coding environment asp.net provides a lot of functionality for site user membership. Community Server extends these membership functions to provide some additional functionality. To provide a common sign , the Community Server used and I have I tied the main site's membership into this (giving a transparent connection between the two).
You can tell when you are browsing the community as pages will generally begin with . The database used for the community is again Microsoft's SQL server.
Wiki
In choosing the Wiki I wanted a stable and well adopted framework with the specific requirement of being able to display equations. Unfortunately there are no asp.net Wiki systems around which will support equations and developing a complete Wiki from scratch is beyond my time constraints. After much research I settled on Mediawiki, which is the same system as used by the well known Wikipedia.
Unfortunately Mediawiki is programmed in php, which is not compatible with asp.net. This is why there are different user memberships for the Wiki and main/community site. Hopefully at some stage in the future I will be able to find away around this, but at the present it's a small compromise for the functionality Mediawiki gives. The Wiki database is MySql.
In terms of licensing/copyright of the Wiki content I selected Wikipedia's model of effectively making it not copyrighted and free for all to use. You can tell you are on the Wiki pages as they start with http://wiki.myelectrical.com.
In case anyone is wondering why different parts of the site have pages are starting with different prefixes there are reasons - it allows me to keep bits programmed in different languages separate, increases the efficiency of delivering pages, makes maintenance of the site easier (upgrading/stopping sections) and hopefully provides some future proofing of hardware upgrades.
Adverts
With myElectrical started growing I wanted to have the facility to place ads on the site to offset some of the hosting cost. A priority was to do this in a professional way and keep control over the serving of the ads. After much research I settled on using OpenX; an open source adserver solution written in php and it is the most widely used adserver on the Internet. As a user of the site you don't really see this, but it runs in the background serving all the ads.
Hosting
As with most sites myElectrical is hosted on servers provided by a web hosting company. Initially shared hosting was used as this was the cheapest solution, although fairly quickly the site started outgrowing this. Currently the site is hosted using Windows VPS hosting. Everything is on the VPS (database servers, domains for the different parts of the site and email services). As the site continues to grow and traffic demand increases the next step will be its own dedicated servers.
Affiliates
Hosting costs money and to try and offset some of this I do have affiliate advertising. Currently the two main ones are Google's AdSense system and Amazon's associate program.
Google's AdSense is the delivery of context sensitive ads, where the actual ads depend on the pages content. These are delivered via the adserver and every time someone clicks on one a small payment made by Goole. Currently the money made from this program covers about half the cost of the VPS hosting.
The books displayed on myElectrical are tied in with Amazon's associate program. Depending on country users either see amazon.co.uk or amazon.com books and prices. The idea of the program is that when people purchase a book Amazon pays a small commission. I have made very very little money with this, but it does add useful additional content to the site so I'm quite happy to keep the books on.
Going Forward
That was a brief rundown of the key components which make up the site. For the site to continue to grow I feel that getting more user participation is the key. Much of my current thinking is on how to get more users and encourage contributions to the forums and Wiki. Any suggestions, advice or offers of help in this would be greatly appreciated.
While this has turned out to be quite long post, hopefully it has provided some insight into how the site functions and what has gone into making it work.
Related Links