SciNote is developed in Ruby on Rails. It also makes use of Docker technology, so the easiest way to run it is inside Docker containers.

Prerequisites

Quick start

The following are minimal steps needed to start SciNote in development environment:

  1. Clone this Git repository onto your development machine.
  2. Create a file config/application.yml. Populate it with mandatory environmental variables (see environmental variables).
  3. In SciNote folder, run the following command: make docker. This can take a while, since Docker must first pull an image from the Internet, and then also install all neccesary Gems required by SciNote.
  4. Once the Docker image is created, run make run command. This will install all the required Gems, and spin-off a (not-yet-working) server.
  5. Once all Gems are installed, and server starts, stop it (Ctrl + C). Run make cli command. Once inside the running Docker container, run the following commands: rails db:drop - rails db:create - rails db:migrate - rails db:seed. This should initialize the database and fill it with (very minimal) seed data.
  6. Exit the Docker container by typing exit.
  7. To start the server, run command make run. Wait until the server starts listening on port 3000.
  8. Inside another CLI window (also from SciNote folder), run command make worker. This command should start the background worker process which is used by SciNote for a lot of demanding tasks.
  9. Open your favourite browser and navigate to http://localhost:3000. Use the seeded administrator account from seeds.rb (or account set up using environmental variables) to login, or sign up for a new account.

If you need to run server in production please check this section.

OS-specific Install Instructions

Debian

  1. Install Docker and add user 1000 to the docker group as described here.
  2. Install Docker Compose as described here.
  3. Follow Quick Start Guide above as user 1000.

Mac OS X

  1. Install command line developer tools (there are many resources online, like this).
  2. Install Docker Toolbox as described here.
  3. Inside CLI, run git clone https://github.com/biosistemika/scinote-web.git.
  4. Run Docker Quickstart Terminal (also described here).
  5. Inside this terminal, navigate to cloned Git folder.
  6. Follow the Quick Start Guide above.
  7. When opening SciNote in browser, instead of navigating to localhost:3000, navigate to <docker-machine-ip>:3000 (you can get the docker machine IP by running command docker-machine ip default).

Windows XP, Vista, 7, 8

There is currently no good way to deploy SciNote onto older Windows operating systems. You can run SciNote inside Docker Machine - the trouble is that Docker Machine is basically a lightweight Linux VirtualBox VM inside which Docker runs, and is very slow (due to nested virtualization), as well as having problems with file system mounting.

Windows 10

On Windows 10, you can use Docker for Windows - this will install Docker inside a Hyper-V container, which is much faster than Docker Machine. We still suggest to ramp-up the VM's memory to at least 4GB though (right click Docker icon in Windows taskbar -> Settings... -> Advanced).

  1. Install latest version of Docker for Windows.
  2. Check version of docker-compose by running docker-compose -v from command prompt. It needs to be at least version 1.9.0 for SciNote docker-compose scripts to work. If you have an older version of docker-compose, download newer version for Windows from releases repository, and overwrite the .exe file of current docker-compose (it should be located in <docker-install-dir>/Docker/resources/bin directory).
  3. Follow the Quick Start Guide above.

Important! As of right now, SciNote does not provide any Windows make script (Linux make command will not work on Windows), therefore you need to call docker-compose commands directly. See Makefile to inspect which docker-compose calls make commands execute.

Docker structure

For version 1.10.0 and later When starting SciNote application in development mode it runs in a Docker container called scinote_web_development, which uses volume scinote_development_files for storing uploaded files and scinote_development_bundler for storing program dependencies. The database runs in a separate container, called scinote_db_development. This database container makes use of a persistent volume called scinote_development_postgres for storing database files.

For versions prior to 1.10.0 The main SciNote application runs in a Docker container called web. The database runs in a separate container, called db. This database container makes use of a special, persistent container called dbdata.

For running application in production please check this section.

Commands

Call make commands to build Docker images and build Rails environment, including database.

Following commands are available:

Command Description
make docker Downloads the Docker image and build Gems. This should be called whenever Gemfile is changed.
make db-cli Runs a /bin/bash inside the db container.
make run Runs the db container & starts the Rails server in web container.
make start Runs the db container & starts the Rails server in web container in background.
make stop Stops the db & web containers.
make worker Runs the rails jobs:work (worker process) in web container.
make cli Runs a /bin/bash inside the web container.
make tests Execute all Rails tests.
make console Enters the Rails console in web container.
make export Zips the head of this Git repository into a .tar.gz file.