1. Home
  2. Docs
  3. Development
  4. Software Environments
  5. Setting Up Your Developer Environment

Setting Up Your Developer Environment

TownSites does not use local environments. Instead, we use SSH to connect to a Developer Environment and program remotely. Each Developer has his or her own Developer Environment.

Using an IDE such as Visual Studio Code, all of the features typically found in a local environment should be available to you once you remotely connect via SSH. You will be given a public and private SSH key to use for connecting.

Once you have your SSH keys, use the instructions below to connect to your Developer Environment.

The instructions below are for Visual Studio Code, but should be somewhat similar across all IDEs.

  • Place the SSH keys somewhere on your machine and note the file path
  • Open the Extensions Panel (View → Extensions) Install the extension “Remote – SSH” to VS Code.
  • Open the Command Palette (View → Command Palette…) and select “Remote-SSH: Add New SSH Host”.
  • Enter ssh townsitesdev@ -i "{Filepath to private key}" as the SSH Connection Command.
  • Save the file, then open the Command Palette again and select “Remote-SSH: Connect to Host”.
  • Click the “Open Folder” button and navigate to public_html/devXX.townsites.dev, where devXX is the name of your developer environment.
  • Click OK. Your environment should load.
  • In the terminal, enter git status to ensure that Git is working and is on the dev branch.

Great—You can now create a new branch (git checkout -b {new branch}) and start developing. Here are couple tips to help you get started:

  • Most code is located in the custom theme and custom plugin directories. Thanks to Git, it’s easy to locate the files you should be editing—they’re colored white in the side panel, while the ignored files are colored gray (See the example on the right).
  • To get an understanding of the different functions and plugins, look for a readme.md file in their containing folders, or check for comments within the file.

As you code, please remember to comment thoroughly if you’re unsure if another developer will be able to understand your work! For more of our coding guidelines, please read the Coding Guidelines section here in the documentation.