Define and Improve our team workflow, why and how? Part II
Project structure and automation
In the last part of this series, I talked about problems we had using emails to keep tracks of projects and tasks and how we ruled it out using Asana. But task management was not the only problem we had as a company. A major percentage of our projects are very custom websites, meaning that we often start from scratch not only in terms of design but also project structure. While the structure of many projects seems similar it is never quite the same and this causes us problems when a developer goes into a project he did not work on and tries to debug or add a feature. This also makes us lose time every time we begin a new project, because we must “figure out” what would be the best structure for this particular project. We had to simplify this process and so, we went in the direction of project scaffolding!
What is exactly project scaffolding and how can it help us? Well, project scaffolding is exactly what it sounds like: building a structure for a project. Why should we do it? Because we can mostly use the same structure for every project, thus removing confusion when moving into a project you didn’t work on and saving time when creating a one. Do you know what would be even better? Writing a single line of bash to do it and being able to customize it (like whether it uses our CMS or not) directly in the terminal. Luckily: we can!
And so, we used Grunt-Init for a little while. But one day we needed to update a couple of libraries and found that there was nothing inside of grunt-init that did this, and so we had to update every libraries in our “framework” (which is basically a repo of libraries written by us or others and is included in the scaffolding of every project) by hand and this was quite annoying. Of course we could have ultimately put bower in there, but from my understanding, we would have to do the bridge between grunt-init and bower ourselves. Unfortunately, we did not have the time to do this and thus began to search for an alternative.
A new guy: Yeoman
After a couple of arguments between our developers, we went in the direction of Yeoman. Yeoman is basically everything we wanted. It is a combination of:
- A scaffolding tool (Yo) that makes the structure of your project from a generator (basically a repo with a configurable template of folders, files and configuration files)
- An automation tool (Grunt or Gulp) that helps with redundant tasks like I briefly explained before
- And finally, a package manager (Bower or npm) to manage dependencies and update everything in your projects in a breeze.
I found it a bit trickier to use at first than Grunt-Init but then again, it is much more powerful. Everything is done from the command line interface, going from setting our node modules, the JS libraries to be included in the project and scaffolding the project to updating these libraries to their latest version or a specific version in the generator or the project itself and of course the automation tasks.
A good thing about Yeoman is also that it works on every major platform available (Windows, Mac, Linux). The team of developers behind Yeoman is also big and contains a few big names of the web industry, such as Paul Irish.
Another good feature of Yeoman is that if you don’t have time to make your own generator, there are already a lot of them available on GitHub for free.
Using a scaffolding tool such as Yeoman or Grunt-Init brought us what we were looking for when building projects: speed, structure, stability and always up to date scripts. If you are not already using such tools when developing web or offline apps, I highly suggest you to look at both options I presented to you today. If grunt is not your style, you can still check on Gulp, which we do not use simply because we just did not see the point of changing something that is working well.
Thanks to Yeoman, we now have a structure that is always the same in every website, a well defined and updated “framework” that is included in every project and that is very easy to update or revert to a certain version using GitHub releases and Bower. And creating a new project with all those cool features only takes us a minute or two! Another workflow problem solved!