For some time now I’ve been writing the framework for this site with the intention of releasing it publicly. With the recent release of MVC2 and .Net 4.0 I figured that while rewriting the site, it would be a good time to also make it available. So hopefully, this will be part 1 in a series of how to create your own blog engine using MVC2 and .Net 4.0 and will be accompanied by the source code. As we go along, I’ll explain why I’m doing things the way I am. If you disagree, feel free to comment away.
To begin with, there are a few constraints we’re going to have. As this site is already live and using the “first version” of what we’re going to create, we need to make sure we don’t break any URLs in the process. One of the worst things about trying to solve a computer problem is googling the problem, finding what looks like a solution, clicking on the link and getting a 404. Secondly, many (or most) web hosts only allow you to run web applications in Medium trust. While not entirely necessary if the host is running Windows Server 2008 and has things configured correctly, this is usually done to protect the users sharing the same server. However, this protection comes with it’s own problems. Namely, restricted permissions in code. Lastly, like any other blog engine, we want to make something that you could hand off to your grandmother and she’d be able to use it.
Moving along, we need a name for what we’re working on. Instead of just referring to this as “the site” or “the blog engine” or something equally unidentifiable, we’ll give our project a code name, Veritas. Veritas is Latin for truth, which is kind of funny since a lot of what is written on the internet isn’t exactly that. So going forward, articles will be titled “Veritas: What this article is about - Part X”.
So how do we start and where do we go? I’m going to try to break things up into different articles so it’s a little bit easier to go from section to section. Tentatively, we’ll have the following articles:
- This summary and description of the project.
- Designing the database support tables.
- Designing the database entry tables.
- Creating the basic project and solution structure.
- Base objects we’ll use throughout the site.
- Error logging.
- Email handling.
- The UI design.
- Data Access with Entity Framework 4.0.
- Adding a MetaWeblogAPI accessor so we can use Live Writer.
- Enabling viewers to add comments.
- Preventing spam in the comments.
- Creating an RSS feed for entries and comments
- Handling authentication and authorization.
- Creating a file uploader.
- Creating an Admin section.
- Automatically adding highslide to pictures you post using Live Writer.
Now we’re waiting until pretty far into the series to get to creating an administration section. We’ll use the admin section for stuff like adding new categories, changing configuration options, and updating entries. So until then we’ll have to do some manual DB changes here and there. I’ll provide the SQL for those queries when necessary so you don’t get lost.
I’m sure some other topics will come up and the order of things might change. If there is a particular area I glaze over a little too quickly and you’d like more info on, let me know and I’ll get it up here.
At the end of all this, we’ll have rewritten the framework that is currently hosting this site and will have actually replaced it. Stay tuned for more coming soon.