April 1, 2018

Scaffoldr: Automation for new projects

Software Development is an industry built upon the concept of libraries - reusable packages of source code aimed at providing specific functionality, and frameworks - scaffolding and utilities to increase productivity via the convenience and speed. Therefore it’s fair to say that most software projects begin with the tedious task of configuring frameworks and installing libraries.

For a web application that may mean installing your favourite framework, editing some configuration files, and creating the same user and authentication boilerplate. Perhaps you regularly write microservices - and your first steps are generally configuring various middlewares, and setting in place the required steps to generate Swagger documentation.

Either way, beginning a new project can be tedious and repetitive - surely there’s another way?

The “Starter Project”

I’ve spent the last couple of years arguing with myself over the usefulness of “starter projects” - projects that often have a few helper methods bundled in, basic framework configuration done, some prewritten scaffolding, and work flows configured.

The concept of a starter project seems to suggest a “one size fits all” approach: whereby each project is going to share a number of similarities with the last one. Whilst that may be true in a niche or agency setting, it’s rarely true elsewhere.

I often find myself having to build out solutions from scratch for clients, and there’s often a lot of similarities between the projects: front-end heavy tasks generally require something like Vue, client-facing back-end tasks I’ll generally opt for Laravel, whilst when writing system daemons I’ll go for Go.

This means I really need to maintain several different “starter projects”, and taking inspiration from the likes of the Vue CLI tool - which allows project creation to be as simple as $ vue init - I opted to write my own tool.

Introducing Scaffoldr

Over the course of an afternoon I wrote a very simple little Python tool - named Scaffoldr - that was capable of providing a CLI interface that would:

  1. Maintain a list of Git repositories (”templates”);
  2. Cache the repositories - updating them when required;
  3. Clone the repositories in to a specific folder, with the ability of running a script automatically.

Essentially this was to scratch my own itch, although perhaps you will find it useful too?

© Fergus In London 2019

Powered by Hugo & Kiss. Source available on Github.