Free, open source forum/customer support system released for ASP.NET 2.0: HnD
Yesterday, we released
HnD, which stands for Help and Discuss, our own
customer support system and forums software! HnD has been
released as free, open source software under the GPL v2 and
uses ASP.NET 2.0, SqlServer and uses
LLBLGen Pro
v2.0 power for 100% of the data-access functionality.
HnD is meant both as an example what you can do with LLBLGen Pro v2 but also as a functional application for everyone out there. Why a forum/customer support system you might ask? Well, I've been working on LLBLGen Pro now for almost 4 years now, full time, non-stop and after such a long period of time you need to take a step back and perform a reality check: is everything progressing in the right direction, is everything functional enough, are there serious features lacking? etc. etc. So I took a 4 month break and instead of working on new features of LLBLGen Pro I worked on our old forum system, TinyForum, and ported it to ASP.NET 2.0, removed the last old LLBLGen v1.21 code and implemented new features we always wanted to have in our forum system. I didn't do this on my own, I had a big help from a couple members of our support team: Walaa Atef, Jean-Sylvain Boige and Todd Price.
Dogfooding your own work in a serious application is IMHO
the best way to test if your own work actually does what you
think it does in the way you had envisioned. Of course,
during unit-test writing you'll already catch most issues
and awkward design decisions but features which take a
broarder scope than a single test also have to be able to
use easily and efficiently. I must say that I was very
pleased to see that I could easily remove any stored
procedure and custom view we created in the old forum and
replace them with LLBLGen Pro code, enable two-way
databinding with the LLBLGenProDataSourceControl and it
worked out really well.
Porting the code, written in 'lovely' hungarian coding style
(I started the forum in 2002
), from ASP.NET 1.x to ASP.NET 2.0 was fairly straight
forward. We chose the default web project style as it's
shipped with VS.NET 2005 so everyone can open the sourcecode
without installing an add-in, and it worked OK except for
deployment where we hit the well-known 'I generate the theme
name in every aspx page'-issue. Commenting out the theme
directive in the web.config file solved this so if you run
into this with your applications, simply comment out the
<pages theme="foo"/> tag before pre-compilation and
you're set (uncomment it on the production server of
course).
We didn't replace all our code with code using new ASP.NET 2.0 features: we kept our own role based security system and didn't use a master page on the main site because we already had a header and a footer control so it was of not that much use while it would imply a lot of work to port every page over to be using a master-page. We did implement theming support though, so creating skins is easy. In the current codebase we still use a lot of tables in the HTML because a forum system is mostly viewing tabular data. Perhaps we'll change that in the future for divs.
We also kept the repeater controls we already used and used
the two-way databinding with a grid and the
LLBLGenProDataSource control only in the admin section.
After all, using a forum is mostly done in a read-only basis
so repeaters are excellent ways to dump data into a page.
Porting the hungarian coding style over to modern MS-style
wasn't always easy and it became sometimes pretty tedious
especially because refactoring support in VS.NET 2005 with
ASP.NET is so incredibly slow and, if I may say so: pretty
stupid (e.g. renaming a private variable with local scope
still triggers the refactor engine to scan every page's code
in a terribly slow pace), that we had to use old-skool
refactoring techniques (read: search/replace) to get the
work done.
Turning a project, which is used internally, into an example
to show how things are done is also a task which sounds
easier than done. How much extra comments should I add? Is
the design straight forward or does it need extra
documentation? What can I expect from the reader, is s/he a
seasoned developer or does s/he has to learn ASP.NET 2.0 as
well at the same time? Should I design this feature with the
fastest code possible using feature XYZ or should I use a
more general approach so that it explains the more general
feature ABC? Questions which answers can help in that
process and after a while it became second nature and
natural to explain the code I was writing with comments I
perhaps wouldn't have added myself before. (I already add a
lot of comments during programming, though not in the style
of // fill i with 0. )
One of the biggest challenges was to rewrite the LR(n) UBB
parser to a new LL(n) UBB parser which was more
maintainable. The old forum code used a UBB parser which was
generated with my own LR(n) parser generator engine though
as the rules and handlers were all defined in code it became
very hard to adjust the syntax. Add to that that UBB is a
bit cumbersome to parse because it's ambiguistic and you
have a parser with shift-reduce conflicts and reduce-reduce
conflicts. So with pain in my heart I left my implementation
of Aho-Sethi-Ullman's LR(n) parser generator algorithms
behind and wrote a new UBB parser which now uses an LL(n)
technique. The advantage is that this parser is much easier
to extend with new syntaxis or to modify for adjustments to
existing syntaxis. The full sourcecode of this UBB parser
engine is also included in the HnD sourcecode. It converts
any text formatted in UBB to XML.
So what kind of features does HnD pack? Here's a small list of features, there are more, smaller, features not enlisted in this list.
- Unlimited forums can be organised into as many sections as you like.
- Both public and private forums, using role-based security
- Queueing facility for support teams, enabling claiming questions and moving threads between queues. Threads can be auto-queued through forum settings.
- Role-based security system for easy right management
- Flexible attachment system for messages which is configurable per forum and user role.
- Attachment approval system for moderators.
- Editing all messages, editing thread properties and closing and moving threads for moderators.
- Powerful search facility utilizing SqlServer's full-text search.
- Native ASP.NET 2.0 code written in C#
- Using LLBLGen Pro v2.0 for all data-access functionality.
- Standard UBB message formatting with various font styles and sizes as well as allowing quoting, code display, attachments and automatic URL linking.
- Email notification of replies to your topics.
- Allows fine grained control over access to viewing, posting, replying, marking threads as 'done', thread memos and many other options.
- Personal profile creation and management.
- Administration centre with forum and section setup, complete group and member management, extensive ban management, support queue management, role management, mass emailing of groups and users by the administrator and many other options.
- Complete control of fonts and colors by ASP.NET 2.0 theme support.
- Open source, so changes and additions can be easily implemented.
- And many more...
It was a blast creating this piece of software and I hope it
will be of help and useful to you all. Enjoy!