Until now I was following Django's guidelines for projects. Every functionality was locked in its own "app" and Misago was nothing more than collection of apps. If you look at current master, there are lot of dirs. Each one of them is an "app". One app provides users listing and browsing, other app provides list of watched threads, etc ect. As number of apps increased code lost any "real" structure.
With refactoring I am attempting to make code's structure easier to understand. Misago's code can be put in one of two baskets:
- Foundation - this code provides features for other parts of code to use
- Actions - this code interacts with users
Looking at how Django itself is organised, I have refactored Misago to look like this.
Everything you see here is foundation code... with exception of "apps" package, which provides forum actions ("apps" in Django nomenclature) based on foundation. As I am writing this foundation refactoring has been completed and I am extracting actions from old code into "apps" package.
Now, there is one more reason for what I am doing. Misago is featured forum... but its also foundation for extending. New foundation layer is easier to explore and understand for possible extension authors. All models, middlewares, validators and signals are grouped together instead of being spread all over place. This makes it easier to find individual items. Same goes for services and libraries.