-
-
Notifications
You must be signed in to change notification settings - Fork 91
Setting Up A Development Environment
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.
-
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.
There are some other tools that will make things a lot easier:
-
Gulp - There is a gulpfile in the project root which will make all the build-related tasks much easier. Gulp can be installed via the node js package manager, npm. Doing an
npm install
from the main directory should give you gulp and all needed dependencies. All the server related tasks need the activator (see below). -
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. There is an elm language plugin as well, if you want to keep everything in one place.
-
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).
The first thing to do will be to fork this repository and clone your new fork to your local system.
The easiest way to develop is just to run gulp
- the default task starts watching for client changes (compiling the elm when detected), and runs the activator server (http://localhost:9000/ by default), watching for server code changes. This should be everything you need to develop, and you can just edit the files in your chosen editor(s).
Please remember to run the tests (gulp test
) and ensure they pass before submitting any pull requests, as well as doing manual testing, and adding new tests as appropriate.
If you want to manage the compilation for yourself:
The first thing you will want to do is compile the Elm code so you have a UI.
- With gulp: Run
gulp make:elm
in the project directory to compile. Runninggulp 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.
You should now be up and running with a development environment for Massive Decks. If anything has gone wrong, check the troubleshooting page.