LilyPond mini-score engraving and sharing service for musicians.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
config
db
public
script
spec
tmp/jobs/CompileScoreJob
vendor
.env.example
.gitignore
.ruby-gemset
.ruby-version
.semver
.travis.yml
CHANGELOG.md
Dockerfile
Dockerfile.worker
Gemfile
Gemfile.lock
LICENSE.txt
Procfile
README.md
Rakefile
config.ru
docker-compose.yml

README.md

Tunefl

Build Status Code Climate

LilyPond mini-score engraving and sharing service for musicians.

The live Tunefl service is at tunefl.com.

More sleep lost by tiredpixel.

Installation

The primary method of development installation is using Docker. You can also use this as a basis for production installation, but you'll probably want to change some things, if so.

You can also install manually, by installing the linked services and packages defined in Dockerfile & Dockerfile.worker, using bundle install, and running services using the supplied Procfile.

The default Ruby version supported is defined in .ruby-version. Any other versions supported are defined in .travis.yml.

Prerequisites

Various versions will probably work. I'm currently using:

# docker --version
Docker version 1.9.1, build a34a1d5
# docker-compose --version
docker-compose version 1.5.2, build 7240ff3

Note that --x-networking will no longer be preview in Docker Compose 1.6, so this flag might not be necessary for you.

Configuration

Copy and configure your settings:

cp .env.example .env

Database

Start the postgres service:

docker-compose --x-networking up -d postgres

Connect using psql:

docker exec -it tunefl_postgres_1 psql -U postgres

Create the database:

CREATE ROLE tunefl_dev LOGIN PASSWORD 'password';
CREATE DATABASE tunefl_dev OWNER tunefl_dev;

Start the web service:

docker-compose --x-networking up -d web

Migrate the database:

docker exec tunefl_web_1 bundle exec rake db:migrate

Stop all services:

docker-compose stop

Usage

Start all services:

docker-compose --x-networking up

Open the web service in a browser:

xdg-open "http://$(docker-compose port web 8080)"

Open the web service admin area in a browser:

xdg-open "http://$(docker-compose port web 8080)/admin"

Monitor the queue using Sidekiq Spy:

docker exec -it tunefl_worker_1 sh \
    -c 'TERM=xterm bundle exec sidekiq-spy -h tunefl_redis_1.tunefl -n resque'

Development

Create multiple stacks as required; the main one in installation is suitable for a dev stack, and you can build on this. You'll probably also want to create a test stack, following similar steps. One approach is to:

Add an alias to your shell; for Bash:

echo "alias docker-compose-stack='docker-compose -f docker-compose.\$STACK.yml -p \$STACK'" >> ~/.bashrc
source ~/.bashrc

Copy and configure a different settings file (here I'm using 0 as a separator as Docker Compose currently strips -_.):

cp .env.example .tunefl0test.env

Copy the Docker Compose file, modifying to point to your .tunefl0test.env:

cp docker-compose.yml docker-compose.tunefl0test.yml

Thereafter, execute docker-compose commands using docker-compose-stack. I prefer to be explicit and use a subshell, as a protection against forgetting which stack I'm using; e.g. to start all services:

(export STACK=tunefl0test; docker-compose-stack up)

To run all tests:

docker exec tunefl0test_web_1 bundle exec rspec

Tests are written using RSpec. There are not many tests, because the application is very simple. If generating a score from the home page works, then things are probably okay.

Stay Tuned

You can become a watcher on GitHub. And you can become a stargazer if you are so minded. :D

Contributions

Contributions are welcome! Please fork the repository and prepare your patches in one or more branches, ensuring that any tests are not broken by the changes. Then, send me one or more pull requests. Proposed patches will then be reviewed prior to acceptance, usually into master branch. If you'd like to discuss something, then please get in touch.

Do whatever makes you happy. We'll probably still like you. :)

Blessing

May you find peace, and help others to do likewise.

Licence

Copyright © 2012-2016 tiredpixel. See LICENSE.txt.