The Live Development Environment

What is it?

A live development environment is a development environment that is connected to the internet instead of running on a developer’s local machine.

How it Works

  • When working on a codebase, the developer uses VSCode’s remote development feature, or something similar, to connect to a remote server. When they save a file, they are not saving it to their local computer, but to the remote server
  • Simultaneously, the application server (rails s) is run in a persistent process, at a permanent url.
  • A simple way to think about this: The developer uses dev.myapp.com to develop, instead of localhost.

What This Enables

  • Project stakeholders (PMs, testers) no longer need to wait for a developer to “push” their work live. It is live-by-default.
  • Senior developers can help to debug and unblock team members 2 to 3x faster than the traditional git-powered process.

Drawbacks

  • Doesn’t work well with multiple developers - ideally only used on a single-developer codebase.
  • Doesn’t work well with many work-in-progress branches. The best setup is one with two branches: dev and main

Setup

  • Purchase a VPS server from a provider. We recommend Hetzner
  • Connect to it using VSCode
  • Install caddy
  • For Rails apps, use passenger as your app server
gem 'passenger'
bundle exec passenger start --daemonize -p 3000
  • Point your domain or subdomain to your VPS’ IP address
  • Configure Caddy with a Caddyfile
  • Restart caddy. SSL certs are handled out of the box.

FAQ

  • Why not use a tunnelling service like ngrok?
    • They’re offline-by-default and thus not constantly testable by project stakeholders.
  • Do you still use Git?
    • Yes, we still use version control and push changes regularly
  • Does this mean another developer can break your work-in-progress?
    • Technically, yes. In practice, people quickly adapt in the same way that they adapt to collaborating on a google document or a figma file.
  • How do you manage multiple git identities on a single VM
    • We use git-user