DEV Community

loading...
Cover image for Do you create templates or automate initial setup?

Do you create templates or automate initial setup?

darksmile92 profile image Robin Kretzschmar ・2 min read

This discussion concerns freelancers, employees and owners of side projects alike.

Who doesn't know it: You laboriously set up a development environment, configure everything and start the project.
Later on in another project you copy the whole or parts of the previous project, change some things, get annoyed about mistakes and places you forgot to adjust and end up with a running second project.

With private side projects it is just as annoying, but not critical. In a professional working environment, however, you should avoid these unnecessary times. Especially as a freelancer, it is even more important, as this has a considerable influence on delivery times and hourly wages.

A current example from myself:
Some time ago I set up an app with Next, React and GraphQL (Prisma).
Just the rough steps:

  • Deploy Prisma Server to DigitalOcean (Docker)
  • Set up MySQL Server (also Docker)
  • Configuring Firewalls
  • Set environment variables correctly in the project
  • Initialize Git

This architecture was an exact fit for my next project and so I created a docker-compose.yml file to facilitate the deployment of the Prisma server and the MySQL server.
For the backend and frontend part I duplicated the folder of the old project and had to (with the help of search and replace) painstakingly go through all configurations, customize them and change other places (app name, constants, etc.).
This all seemed very tedious to me.
In the end, I wrote a short shell script for those tasks aswell.

Then this morning I read the article about the $200 challenge:

I thought:
As a freelancer you have to be able to start a new project quickly and you need templates for different types of projects and best of all scripts to automate the setup.

What I use so far

  • Scripts to deploy maschines on DigitalOcean (via API)
  • Scripts to setup the firewalls on DigitalOcean (via API)
  • A temaplate I created on base of my first React+GraphQL tutorial from the course of
    wesbos image
    (hey Wes, sick-fits was great! 👍)
  • Various docker-compose files for different topologies
  • AWS Cloud9 partially as IDE to be able to code from anywhere and to be able to share it with others if needed.

So now I'm curious...

❓What templates did you create?

❓For which stacks?

❓Do you use scripts? If so, what do they do? (rough)

❓Do you have a local IDE or in the cloud? (AWS C9, Codenvy,...)

❓What other clever helpers did you build?

Discussion (2)

pic
Editor guide
Collapse
webknjaz profile image
Sviatoslav Sydorenko

FWIW I heavily automate setup of my dev machines: github.com/webknjaz/ansible-gentoo...

Collapse
darksmile92 profile image
Robin Kretzschmar Author

Thanks for sharing Sviatoslav!
I had a look at your repo and must say: it looks very thoughtful!

I like the checks you implemented because most of the time people (including myself) are writing those scripts to automate the setup and forget to check stuff already installed on the system but need to be installed first on a blank system.