Journal Entry #3

Zayne Upton
Jul 24, 2017 · 5 min read

I started coding in earnest over the past 2 weekends. It’s been tough trying to get back into it, as I’m really rusty with the Ruby syntax. Quite slow going. But after this last weekend I’ve managed to get quite a few things right and I’m feeling confident again that I can really do this.

I’ve had to set everything up myself. The first step was to get a virtual server running. For this, I’ve used Digital Ocean and created a droplet. Initially I had the droplet configured as a Ruby on Rails server, but I realised that by doing that might be limiting, as we need to maximize the server capabilities for other things besides the RoR application. I wanted to be able to run a Wordpress blog on the same server to allow us to capture the details of the process as well as potentially use it almost as the main framework for the critical editions platform, as it comes with all the blog and website framework tools already built it. It also allows many plugins which will probably come in useful.I decided to reformat the server to instead be a Docker-based server. Docker is a great containerization platform that allows you to build applications in their own containers walled off from the other applications on the server. This means that there is less chance of applications interfering with each other and causing major support issues. I didn’t know Docker at all and so I read up on it and started trying it out. It took a while to get it right, but I now have a few containers running on that server. I have a Wordpress Multisite install, a database container for Wordpress, a Ruby on Rails web container, a RoR database container, and a container to administrate the RoR database. So far everything is running smoothly. I haven’t checked the usage stats properly yet, but so far it doesn’t seem to be maxing out. The Docker setup will allow me the flexibility to spin up or down containers and change them as needed without having to reinstall or reconfigure the server. This is going to be a huge time saver, because I don’t yet know exactly what is needed for this project and I’m figuring it out as we go along. I’m probably going to need another container for the MerMEId editor, which runs on completely different technology, but I haven’t got to that yet. Another great benefit of Docker is that I can have exactly the same environment running on my local development machine as on the production server. This means that there is little chance of any configuration issues cropping when I deploy to production.

I also have the code in github now and properly using git to manage the source code.

I started trying to integrate an authorization plugin into Rails (Devise) but I really struggled to get it working, so I parked that and worked instead on simply getting a basic Rails app going. I don’t think it’s critical at this stage to get authentication going as the site really doesn’t have anything important on it right now. It will become important when I put the MVP into the production so it will be included into Release 1.

One of the key tests I wanted to do was to get a work from Sibelius into MEI and then show it on the website. For this, I used a Sibelius plugin called SibMEI. This seems to work quite well, although the team will need to create the Sibelius files in a certain way to make sure that they are converted as accurately as possible into the right MEI format. Some aspects of the score either don’t come through at all or are positioned incorrectly when converting between the two formats. I will be creating a guide that the team can use when they start capturing the music. The next step was to try get the generated MEI file stored in the app. I created a Works model in Rails and used the CarrierWave plugin to allow for files to be uploaded. Once the file was uploaded I needed to be able to show the graphical score on the site. For this, I used the Verovio Javascript Toolkit. It’s amazingly powerful and easy to implement. I managed to get the score showing as well as being able to zoom in and out and move forward and backwards in the music. These functions were all available directly in the Verovio tutorial for me to copy, so it wasn’t that tricky to do, but I was still surprised at how easy it was to implement. I know the implementation of the javascript isn’t optimally done in the Rails Way, but that doesn’t matter for now. At least it works. I’ll refactor it later.

Probably the next most important task is to be test-driven development going. I haven’t ever worked like this, but it’s really going to be beneficial for a few reasons: 1) it will make it easier for me to find issues when I break the code; 2) I need TDD in order to get a continuous deployment pipeline going; and 3) if others are going to start working on this project along with me eventually, it will make it easier to ensure the code base is easy to get into. After that, I need to get the continuous deployment pipeline going so that I can get my code into production properly.

I’m also going to have to work on getting a proper production container going to the app, as I’m currently using the development versions on the production server.

I’ve also started a Trello board to get myself more organised on this project. I need a proper backlog of features to keep myself working on the right stuff in the right order. I can’t let this get out of hand like I usually do. Things need to be neat and tidy.

I think the next feature I’m going to be working on is the ability to show the editorial marks or comments in the MEI files directly on the scores. For this, I need to edit the MEI file to include the marks/comments first and then I can work on displaying them.

I’m feeling really good about where this is going.