Learn about the inspiration and tech stack behind Wojciech's creation, Performeter; a tool for performance testing.
Hello, youve stumbled into the old Cogblog archives
We've switched our blogging focus to our new Innerworks content, where tech community members can share inspiring stories, content, and top tips. Because of this, old Cogworks blogs will soon be deleted from the site, so enjoy it while you can. A few of these might refer to images in the text, but those have been deleted already sorry. Some of these subjects will return, some aren't relevant anymore, and some just don't fit the unbiased community initiative of Innerworks.
If you'd like to take on this subject yourself please submit a new blog!
Farewell Cogworks Blog 💚
Every month, client communication takes a backseat and we get our creative heads on within our teams to solve problems. The two-day internal event includes a hackathon that is dedicated to internal work only. You can read a bit more about what we do, here.
It was over a recent Cogworks Hackathon that I had my idea, plus, the time to execute it!
The inspiration.
Some time ago we had a team discussion about automating lighthouse reports. We wanted to be able to easily spot any performance issues that might appear when certain changes are made, for example, when we deploy to a production environment.
The idea.
I’d had this idea for a tool to help performance for a while. In my head, I visualised a tool that would produce lighthouse reports for our client websites, store them in a database and display the data as charts. From the charts, it would be easy to see where performance is falling down as a result of simple changes like a package update, or a layout change.
The plan.
The goal was to create a client-side application that presents data from Lighthouse stored in a database through a custom backend application with REST API. My requirements were pretty simple. I wanted to do this efficiently and cost-free. I definitely didn’t want to spend any money on hosting, databases or other services.
The stacks I used to build Performeter.
For the client application, the choice was easy. I decided to use Vue.js to build the whole UI! Why? Because the whole team love it, (you may have read in my previous blog, but to sum up, Vue.js is a framework our whole team are experienced at building with).
For styling and design, I used Tailwind and some free components from Tailwind Components. Thanks to the free components, I saved loads of time writing CSS, HTML and thinking about how things should look. For the charts, I used a package created by Dmytro Barylo - Vue Trend Chart, it looks great and has the functionality that I needed.
As I said earlier, I wanted this to be as easy as possible. As a client-hosted application, I used Netlify. Netlify is awesome because it’s easy to configure and allows you to plug in a custom domain, deployment is automatically triggered by GitHub push, plus, we already use it to store static items so getting to grips with it was easy.
For the backend application & rest API I needed something simple. I decided on Express.js to create the REST API that will be responsible for making Lighthouse reports and serving data for the client application. To store data I chose MongoDB hosted on MongoDB Atlas, selecting the shared option (as that is free and has more than I need for this application)
As a hosting for Express application, I choose Heroku. Again, it was the free option, easy to configure, intuitive and allowed the use of Buildpacks. FreecodeCamp.Org describes buildbacks as the scripts that are run when your app is deployed, used to install dependencies for your app and configure your environment.
Heroku Buildpack makes it easy to build with headless chrome which is great because it was the one thing that I considered as a potential challenge or blocker at the start of this side-project! To run the headless Chrome, I used a package called chrome launcher.
Additionally, Heroku has a lot of available add-ons. One of them is Heroku Scheduler which makes it possible to set some regular time-based jobs. This is the add-on I used to trigger Lighthouse reports, automatically every day.
After a few hours, I was done with the whole project, it was working and deployed. I called it Performeter and I’m really happy with the results.
The Performeter works great! (Although it's more of an MVP-type tool for now) Looking back, Heroku was the weakest point of the application. and at some point, the shared machine from the free plan on Heroku will be too slow and running multiple lighthouse reports will become tricky.
Innerworks and Cogworks are proud to partner with Community TechAid who aim to enable sustainable access to technology and skills needed to ensure digital inclusion for all. Any support you can give is hugely appreciated.