Extension Store
The large number of modules in aBAS calls for a solution to easily manage them. Enter Extension Store.
Background
aBAS is a sizeable web application, which comprises a number of modules. Some of these are core modules, which all clients will have enabled in order for aBAS to run properly. Other modules are features and are optional, referred to as extensions.
Depending on a client’s subscription plan, different extensions will be enabled. The Lite plan only includes basic modules, while our most comprehensive Enterprise plan grants access to the most powerful extensions in aBAS.
Current implementation
Currently, extensions are managed through Django’s settings configuration file. Each client has their own settings file to control which extensions are installed. This is not elegant for a number of reasons:
- the source code has to be changed whenever there is a change in installed extensions
- servers must be re-deployed for changes in installed extensions to be reflected
- clients experience some downtime during the re-deploy
Proposed implementation
At the point of writing this, a PR has been opened for a new implementation of handling extensions. This implementation addresses the above-mentioned issues. Its key points are as follows:
- an extension is implemented as a Django model
- each extension overrides Django’s default app config, which contains information used by the extension store
- a custom Django middleware checks requests to determine if a user can access an extension’s pages
- the states of all extensions are cached for performance
- extension dependencies can be defined in specific URLs in the Django app’s URLconf
- frontend created using reactjs via the aBAS API
- simple toggle to enable/disable each extension at runtime, which is effective immediately
Conclusion
While constant improvement of aBAS such as the Extension Store involves a big refactor of the existing code base, it is certainly an investment well worth it. As with all refactors, it is important to identify unsustainable areas and deliberate if the pros outweigh the cons.
In this case, it did.