GSoC’23: Administration System for BookBrainz

Namaste!

I am Shivam Awasthi, a recent graduate from IIT(BHU), Varanasi. As part of Google Summer of Code’23, I participated as a contributor for the MetaBrainz Foundation, where I worked on creating an Administration System for BookBrainz.

During this period, I was mentored by monkey, and ansh. With this post, I’ll be giving an overview of my project.

What is my project all about?

BookBrainz lacked an Administration System, which meant that direct database access is required in order to do admin work like adding a relationship type or an identifier type. Trusted community members should have an interface which allows them to add/edit new types to the database. 

Thus, a system was required which allows us to give special privileges to certain users and add types to the database, specifically relationship and identifier types.

Therefore, this project involved:

  • Creating an Administration system, which allows admins to give special privileges to users.
  • Creating Type Editors for both Relationship-Types and Identifier-Types.
  • Creating an Admin Logs of these administrative actions
  • Privileged users should be able to trigger a reindex of the search engine

The Administration System

After making the required schema changes for an admin-logs table, and modifying the editor table to support privileges, I started my work on creating an Admin Panel.

Now there is support for 5 different types of privileges:

  • Entity Editor: This is a basic privilege, which allows normal users to edit and create new entities.
  • Reindex Search Server: This privilege allows a user to directly trigger a reindex of the search server.
  • Relationship Type Editor: This privilege allows a user to edit and add relationship-types.
  • Identifier Type Editor: This privilege allows a user to edit and add identifier-types.
  • Administrator: This privilege allows a user to edit privileges of other users.

BookBrainz now has a Privilege Dropdown which allows Administrators to access an Admin Panel:

On the Admin Panel, you can search for a user by name. You can see the privileges that a user currently has by their privilege badges. There is also a distinct shield icon for Administrators.

On clicking the Edit button, a Modal opens up which allows us to change privileges and add a reason for the change.

These changes are recorded on an Admin Logs page:

Relationship Types Matrix, Relationship Types Page, and the Type Editor:

After having some discussion on how the different relationship types should be displayed on the website, we, like always, decided to do it like MB does.

We now have a matrix which allows us to view the relationship-types between any two types of entities:

The Relationship Types are listed in a Tree type of format:

The PR also added a Relationship Type Editor which allows us to add/edit relationship types.

The Identifier Types page, and the Identifier Type Editor

The final PR for this project added a page which lists all the different Identifier Types and an Identifier Type Editor.

We can access the relationship types page and the identifier types page through a newly-created ‘Docs’ Menu:

TypeScript Challenges:

BookBrainz is slowly moving to TypeScript, which means there is only partial support for types from the bb-data end. Since there is already another project which will add support for more types, and in the process create a more definite naming convention for the different types on BookBrainz, I was sometimes left wondering whether I should create the new type on the bb-site or the bb-data.

We finally decided that we should, for the time being, create the required types on the bb-site repo and move them to the bb-data after the project.

What’s left?

Below are some things which are extended goals, and can be considered as a good continuation of the project:

  • Attribute Type Editor
  • Moving the types to the bb-data repo
  • Better error handling for the relationship type editor

I plan to work on these after GSoC.

Most of these features are already deployed on the test website.

My Proposal can be seen here.

My PRs: merged | unmerged

My experience with MetaBrainz

Working on this project has been a very fulfilling experience.

From careful reviews by ansh, to the various gotchas pointed out by monkey, to the constant feedback around the features by the community, it has been an enriching journey, both as a developer, and as a member of the BookBrainz community.

I am really glad that I got to be a part of this project, and received guidance from wonderful mentors like monkey and ansh

I would be remiss if I dont mention the constant feedback I received from fellow GSoC participant kellnerd, who provided insightful comments and suggestions from time to time.

The MetaBrainz Foundation was my first foray into open source, and I am glad that I got the opportunity to contribute as a GSoC student for the project!

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.