When you have a big project, it makes sense to break it into smaller parts. Doing this helps simplify processes and prevent errors and rework among a team. We have a fairly large web development team at Hennessey Digital, and with several people working on projects at the same time, we would be constantly overriding and breaking each other’s changes if we used the same server.
This is why I developed Local HD, a localhost tool our Engineering team uses at Hennessey Digital.
What is localhost?
In simple terms, “localhost” is a full copy of a website that is hosted on our own computers instead of the server. We write code and make changes on our own (“local”) computers, then we push that code out to the live site we’re working on.
For web development, this process makes sense when multiple developers work on a project together. And for our team at Hennessey Digital, a “project” refers to a client’s website.
When many individuals are accessing and changing the same code on a live website, we could make conflicting changes or even delete each other’s changes. Local HD prevents this issue.
Local HD use
In full transparency, Local HD was created because of errors we made. We like to be open about our mistakes and what we learned to help others from having the same issues.
With this new proprietary tool, our developers can make a local copy of any website to make any tweaks and changes to the code on their own computer before moving the changes over to the live site.
Local HD is a version of what others have built and use now. The technology isn’t new, but developing an in-house solution has many advantages. For example, we can use this tool to build more automated tests to run on our clients’ websites, which frees up our developers to focus on more advanced tasks.
It makes it possible for our developers to work with Docker without having any experience with virtual environments. Our infrastructure team sets up clients’ servers, and then our developers can use LocalHD to easily and quickly copy the configuration from the server to their own computer.
Developing Local HD
Local HD makes it easy to build and test changes to our clients’ websites.
I developed this tool using Electron and JavaScript over a period of 6 months. The tool is a set of scripts that execute one after the next to complete these steps:
- Prepare a local environment. Create docker containers for local web server (apache), database (mysql), and install fresh WordPress under it. Assign a local fake “domain” to the local website.
- Prepare an external database. Create a dump of the external database of the live site and install it on the local environment.
- Connect to Git repository, then download all the necessary files and assets from the remote website.
- Start the Docker containers and voilá – you have a local copy of the remote website. Just open the editor and start writing code!
This process saves developers a ton of time. Using Local HD, it takes anywhere from 5 to 30 minutes (based on website size) to clone a single website, while the manual process can take 1.5 to 2 hours or more, and this does not take into account the required training.
Local HD and automated testing
When we can prevent errors on clients’ websites with automated, repeatable tests, it saves developers time from having to manually test things.
Using technology created for the Local HD tool, we can now leverage localhost to automate and run tests for clients’ websites. The team also uses a 2-step review process before making changes to a client’s live website.
To illustrate this 2-step process, here’s how we added a video to our own Careers page:
First, the developer does a technical review on their local machine. After the review, they open a “Pull Request” which allows other team members to test features and review the code. Only after two other team members have reviewed and approved the Pull Request can the developer deploy to the staging server.
Next, we run API, Integration, and Selenium tests on the server and then move it from staging to production.
Finally, the pull request triggers an automated deploy which bundles all the website’s code together and pushes it to the receiver endpoint. It’s then deployed to production and seen on the live site.
Advantages of Local HD
- Fewer website errors. Our in-house localhost solution makes it possible for developers to update multiple features of a website simultaneously.
- Increased team efficiency. Tight deadlines can only be met with a tool like this. Local HD is saving our team thousands of hours and frees up our developers for creative problem-solving that leads to projects like the HD Platform
- Cross-functional technology. The Hennessey Digital SEO team can use this tool for local staging and production environments on their machines. Duplicating our Engineering team’s process creates more time for innovating and making things more efficient across multiple areas of the organization.
Hennessey Digital’s technology solutions
From technology to our internal processes, we continually evaluate and update the solutions our team builds.
As Google Partners, our HD Platform leverages hard-to-access technology that many of our competitors don’t have.
My team and I are also rebuilding the top WordPress theme for attorneys (acquired earlier this year) on a continual basis. We are digital marketing technology enthusiasts who love creating new solutions to old problems, and ingenuity isn’t limited to the Engineering department.
It’s why we call ourselves “the digital marketing agency you wish you’d hired first!”