Skip to content

MakerSquare Workflow

Michael Ornellas edited this page Feb 5, 2014 · 1 revision

So once you've setup your dev environment and learned how to develop using Vagrant, you're ready to start coding with MakerSquare.

Code Organization

All your MakerSquare code should live within the ~/code/mks directory. We went ahead and gave you a directory structure to start with containing three subfolders. It should look a little like this:

~/code/mks/
  backend/
  frontend/
  misc/

The idea being that you can clone down repos to backend/, frontend/ or misc/ depending on what part of the class they were dealing with. For example, later in the course you will be working with the Ativa app as part of the Rails-centric portion of the class. If you were to clone that project down, since it deals with the backend portion of class, it would make sense to clone it inside of the backend/ directory. However, when we're working with the Riot.js portion of the class, it would make more sense to create or clone those directories into frontend/. For stuff like Git that affects both sides of the class, or things that are hard to pigeonhole, we always have misc/ to lean on too. This all might look a little like this:

~/code/mks
  backend/
    Ativa/
    blurred_press/
  frontend/
    javascriptPrototypes/
    javascriptObjects/
    riotjs/
  misc/
    learning-git/

This makes it a little easier to keep track of where our projects live. If you have projects you want to work on that are outside of MakerSquare, you might want to make another directory here (maybe called personal/) or just use the misc/ directory that is already there.

Vagrant flow

We make a distinction between your Vagrant machine and your local machine. We even set up the themes differently so it is obvious to the user which environment they are using at any given time. Since those are the two contexts, I'm going to explain what is appropriate to do in each context:

Locally

  • Edit code and other files using tools like Sublime Text or Vim
  • Use Git to version control your files and to push/pull changes from GitHub
  • Use the Heroku toolbelt to manage Heroku apps, addons and settings

On Vagrant

  • Running code using things like ruby, rails, sinatra, and node
  • Installing libraries using tools like bundle, gem and npm

For the most part, if you're in your local context, you'll be doing things that deal with writing and saving information, like editing code and making git commits.

When you're in the context of your Vagrant machine, you'll be dealing with running code, installing libraries and dealing with anything that actually runs the code you've written locally.