Skip to content

Setting Up A Development Environment

Gareth Latty edited this page Jun 4, 2016 · 14 revisions

Requirements

Core

If you'd like to develop MassiveDecks, there are a few core things you will need:

  • Elm - the language we use for the client. This is a pure-functional language that compiles to JavaScript - that may sound awkward to some, but it's actually really nice to use.

  • The Play Framework - the server-side framework. This will also grab Scala and other dependencies (less, etc...) for you if you don't have them.

Suggested

There are some other tools that will make things a lot easier:

  • Play Activator - comes with the play framework unless you specifically ask not to get it, and is a nice easy environment to run the server in - it'll handle compiling and deploying the scala and less code. It also includes a simple code editor, but I'd recommend something more powerful (see below). If you don't get this, you'll need SBT instead.

  • IntelliJ Idea - in my opinion, the best Scala IDE. Note that the support for deploying to web servers is only in the paid edition, but the community edition works well for code editing, and the play activator will handle deployment for you, so it isn't a problem. When you open a Scala file, it should prompt you to install Scala support.

  • Atom - an editor that has, in my experience, the best support for Elm. Go to the install tab in settings to install the language-elm package. It's also pretty good for HTML (built-in)/JS (built-in)/LESS (the language-less package).

  • Gulp - Unfortunately the Activator doesn't handle Elm compilation. There is a gulp script in the project root which will allow you to automatically compile the elm code whenever you make a change. Gulp can be installed via the node js package manager, npm. You will need to install gulp-elm and gulp-util.

Getting Running

The first thing to do will be to fork this repository and clone your new fork to your local system.

The first thing you will want to do is compile the Elm code so you have a UI.

  • With gulp: Run gulp in the project directory to compile. Running gulp watch will try to compile any time an Elm source file is saved.
  • Without gulp: Run elm make client/src/MassiveDecks.elm --output public/javascripts/MassiveDecks.js in that directory each time you want to compile. The first compilation will include downloading and installing libraries the project depends on, so it may take a bit of time.

Now you can run the server.

  • With Activator: Run activator ui, once it's running it should launch a browser, open the server directory as a project (same deal with downloading and installing dependencies, may take some time) - once it's all done, you can go to the run tab and run the server, once it's running it should give you a link to your local instance of MassiveDecks. Activator will watch for changes and redeploy as needed.
  • Without Activator: You will need to install and run SBT in the server directory.

You should now be up and running with a development environment for Massive Decks. If anything has gone wrong, check the troubleshooting page.

Clone this wiki locally