JavaScript CSS Python Other
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
docker
gcloud
lib
public
rethinkdb
scripts
services
spec/support
test/locust
.babelrc
.dockerignore
.editorconfig
.eslintrc.yaml
.gitignore
.gitmodules
.nvmrc
Dockerfile
LICENSE
README.md
circle.yml
gulpfile.js
locustfile.py
package.json
profile-server
requirements.txt
run-server
run-webpack-dev-server
webpack.config.js

README.md

MuzHack

Gitter Stories in Ready Docker Repository on Quay.io Circle CI

MuzHack is a Web application for publishing musical instrument designs.

[Support via Gratipay](https://gratipay.com/~Arve Knudsen/) Flattr this git repo

Editing

Please install EditorConfig in your editor of choice, since we control the code standard through that (e.g. 2 spaces indentation). Specifically the EditorConfig settings are defined in the .editorconfig file.

Please also install ESLint in your editor, in order to make sure you conform to our code standards. This is configured via .eslintrc.

Development

MuzHack is developed with Node (via hapi.js) on the server and Omniscient (a functional, top-down rendering, React wrapper). The code standard is ES2015 JavaScript. We use Babel to be able to write ES2015 both on the server and on the client.

For the database we use RethinkDB, a NoSQL technology.

Local Installation

  1. Enter the MuzHack Git repository.
  2. Get Git submodules: git submodule update --init --recursive
  3. Install nvm.
  4. nvm install.
  5. npm install.
  6. If you don't have Python 3 already, install it with brew: brew install python3.
  7. pip3 install -r requirements.txt
  8. Install RethinkDB.
  9. ./rethinkdb/setup-rethinkdb.py.

Running Locally

  1. In one terminal, enter the MuzHack repository.
  2. Run the Node server: ./run-server
  3. In another terminal, enter the MuzHack repository.
  4. Run the Webpack dev server: ./run-webpack-dev-server. This serves as a front-end to the Node server, which automatically compiles resources via Webpack.
  5. Access the Webpack dev server at http://localhost:8080 in your browser. The app will automatically be refreshed when you make changes to the source code thanks to Webpack's hot reload feature.

Deployment

MuzHack is deployed as a set of Docker containers to Google Container Engine (GKE), which is a Kubernetes service for managing Docker clusters. GKE is for all intents and purposes Kubernetes, so read up on the latter in order to understand how MuzHack is deployed.

We are using two different clusters, staging and production. In order to work with each cluster, we use the local kubectl command; to configure which cluster kubectl operates on at any given time, issue the command gcloud container clusters get-credentials $CLUSTER, where $CLUSTER is the cluster in question (e.g. production or staging).

Updating Deployed Resources

In order to update a deployed resource, f.ex. a replication controller, use kubectl apply. For example, if the staging web-controller.yaml has changed, issue the following command: kubectl apply -f docker/staging/web-controller.yaml.