This blog post is Human-Centered Content: Written by humans for humans.
One of the neatest things about humanity is how we lean on each other’s creativity and innovation. When we make something new, we don’t start completely from scratch. Even without a recipe, we have knowledge and tools from our predecessors that make crafting something original possible.
This collaborative ethos is epitomized by the open-source programming community. Open-source developers will create and publish code packages that are free to use, but also open for others to contribute and improve. This community is huge, and you’ve almost certainly used software built on open-source code. Some notable examples are Linux, Git, Docker, PostgreSQL and Apache.
Web development is a large category within open source with smaller groups when broken down by underlying framework. Laravel, React and Ruby are some of the most popular, but there are many, many others. These open-source frameworks also have open-source tools and packages to accompany them.
InterWorks created Curator almost a decade ago using the Laravel framework and an open-source content management system as its base. Since then, we’ve added quite a few proprietary bells and whistles to support connections to various analytical platforms as well as numerous style customization options. We’re now in a position where those bells and whistles can be published as open-source packages for others in the Laravel community to use. This is where the story finally begins!
One of the integrations I created for Curator was for embedding ThoughtSpot. This required some JavaScript (but that’s another story) and making REST API calls to ThoughtSpot. We used the REST API to get a list of Liveboards, Answers, data sources, users, etc. as well as access tokens to load the content for end users. This involved building a PHP class to handle the REST API communication, so making calls elsewhere in the Curator code would only require a line or two of code. That PHP class made for the perfect open-source composer package.
Now, this wasn’t only the first package published by InterWorks. This is also the first composer package I’ve ever made. Through much Googling and ChatGPT-ing, I was able to get to a finished product. I took notes along the way so I could walk you through the whole journey and maybe glean some useful information to use in your own projects. And I’ll cap the tale off with a walkthrough on how to use the package itself.
Here’s a look ahead at what I’ll be covering in this blog series, “My First Composer Package:”
- Setting up an app with a local copy of your composer package to develop.
- Scaffolding the composer package code.
- Writing an API for an API.
- Publishing to GitHub and Packagist.
- Adding testing to make sure things don’t break.
- How to use the interworks/thoughtspotrest
I hope you enjoy, and keep an eye out for new releases in this series over the next few weeks! Happy reading!