-
Notifications
You must be signed in to change notification settings - Fork 0
Getting started with development
- The Code - https://github.com/ariejan/firedragon -
- CI - https://travis-ci.org/ariejan/firedragon
- Wiki - https://github.com/ariejan/firedragon/wiki (☜ You are here)
You'll need several tools installed on your system. This guide assumes you're running a recent version of OS X with Homebrew.
You'll need the latest stable release of Golang: 1.5.1. If you don't have Golang installed yet, this is the recommended setup:
brew install golang
mkdir -p ~/go/src ~/go/bin ~/go/pkg
Next, make sure you configure GOPATH
and PATH
in your shell (~/.bashrc
or ~/.zshrc
):
export GOPATH="$HOME/go"
export PATH="$GOPATH/bin:$PATH"
You'll also need Node.js and NPM for the Ember.js application. Installing is as easy as:
brew install node npm
It's best to checkout your code in you $GOPATH
, so building the entire app will work as expected.
go get github.com/ariejan/firedragon/server
This should create $GOPATH/src/github.com/ariejan/firedragon
with the entire project in it. If this does, for some reason, not work, first create an issue, next try to clone the repo manually.
mkdir -p $GOPATH/src/github.com/ariejan
cd $GOPATH/src/github.com/ariejan
git clone https://github.com/ariejan/firedragon
We use Godep (installed via make setup
) to manage dependencies, go get
should handle things for you already. If you use new libraries, be sure to run godep save
to store them in the repository.
No worries here, my friend. You don't have to install any third party database servers as Fire Dragon's server uses an embedded key-value store named BoltDB. Bolt serves our purposes well and takes away a lot of complexity for end-users installing Fire Dragon.
You will notice that, once you run the server, a file named firedragon.db
will appear. This is where Bolt stores all its data. It's safe to remove this file if you want to get rid of it. It's already ignored by git.
Fire Dragon consists of two parts: the server and the ember.js project.
The server
directory contains the Golang sources for the server. The server has three important tasks:
- Serve hosted content (URLs, text, images, etc.). By default hosted content is available at http://127.0.0.1.xip.io:8042/
- Serve the API for managing content at http://api.127.0.0.1.xip.io:8042/
- Serve the web administrator interface (the Ember.js app) at http://admin.127.0.0.1.xip.io:8042/
The API and Admin are hosted on subdomains so their URL paths do not interfere with shortened content URLs on the main domain.
The client
directory contains an Ember.js project, used by the owner/administrator to create content and perform other administrator tasks. It's, by default, hosted on http://admin.127.0.0.1.xip.io:8042/. This project uses ember-cli
to make life easy.
Makefiles are used to make common development tasks easy. The Makefile
in the root of the project will perform tasks for both server
and client
projects.
The first task you want to run is make setup
. This task will install required dependencies, like ember. You will most likely only need to run this the first time you setup the project.
To run tests, simply run make test
in the root or either project directory. Running make test
in the root will first run the server tests, followed by the client tests.
make clean
will remove generated files and can be safely run to clean-up your project tree.
The default task (make
) will perform three actions:
- Compile the Golang project into a single
firedragon
binary. - Build the Ember.js application
- Create a
dist/
directory in the root of the project, move the build results of both projects into place.
After running make
in the root, you can start Fire Dragon by running the firedragon
binary in the dist/
directory.
During development you'll most likely work on either the Golang or Ember.js project. For Golang you can simply issue make test
and make
commands in the server
directory.
In case of the client
, you can use make test
, but you'll probably want to run ember server
. Doing this will run Ember.js in development mode and use a library named mirage. Mirage will stub the data store, meaning you can use the Ember.js app without having the back-end server running.
We love well tested software. Fire Dragon uses Travis to test master as well as pull requests automatically. Both the client
and server
are tested in one run. See Fire Dragon on Travis or check out the .travis.yml for build details.
If you want to push new code to Fire Dragon, please create a Pull Request. You may want to fork the project to your own account.