I wanted to reflect on a big piece of software I wrote when I worked at Twilio. I was the lead engineer on building a new system to manage the Console Homepage. When a customer logs in to the Twilio Console, this was the first page they see. A problem our team had was managing the content to show here. There were some basic things we wanted to show every user (a greeting, their API token, their default phone number). There was also a lot of user-specific things we wanted to show. If a customer mostly used one of our many products, we wanted to show them information related to that product. Or if they were a newer customer, we wanted to show tutorials or guides to help them get started. For established customers, we wanted to highlight advanced usage or newer features. We needed a system to personalize the homepage for our users. A lot of other teams at Twilio wanted to be in charge of the content that was shown for their users. So the Twilio Voice team and the Twilio Notifications team needed a way to set content for their users.
There are a lot of parts to the system that I helped build, but I wanted to focus on my decision to have Layouts and Contents in a declarative system. Whoever gave us content, it needed to be defined up-front as a list of options for the page to render. By having a list of Layouts and Content within the layout, we were able to build a system with transparency. I built an internal page that listed all possible layouts the homepage could be in, with a link to load the homepage and force that layout. This gave us a great tool to demonstrate to others inside the company what their customers would see on login. It also let teams iterate on un-published layouts and share them with their product managers and designers. Before this system, understanding what someone would see on the homepage was very difficult. Engineers on my team would read through a long chain of if-else checks throughout the code for the homepage. Afterwards, to know what the page would show, you could point to the data that defined the layout, and you could load the page with that Layout on override to really see what would happen. This separation of the display login into a declarative data system was a huge win for me and my team.