hackage-server is based on a modular architecture which encourages a full-fledged REST-based public interface and not just a collection of scripts.
The fundamental unit of the Hackage website is the feature. Examples of features include user registration, where users can sign up for their own accounts, reverse dependencies, calculated from the main package index, and preferred versions, which allows package maintainers to recommend some versions over others for the package installer.
Each feature keeps some kind of data, and it serves that data on the website and is responsible for its backup. Features may depend on each other and use each other's data. To install a feature, it has to be compiled into the source, and swaths of functionality can be enabled or disabled by adding or deleting a few lines of source code.
If you'd like to learn about the internals of the server and extend it:
- HackageDB/2.0/Architecture/Types: the core server types
- HackageDB/2.0/Architecture/Happstack: a primer for Happstack usage
- HackageDB/2.0/Architecture/Resource: Hackage's routing system
- HackageDB/2.0/Architecture/Extras: extra functionality the server uses
- HackageDB/2.0/Architecture/Hook: summary of hooks and filters
- HackageDB/2.0/Architecture/Backup: implement backup/restore functionality