Installation - portagenetwork/roadmap GitHub Wiki

Table of Contents

Pre Installation

Request

DMP Assistant is a Ruby on Rails application that requires the following:

  • Ruby ~2.6.x
  • Rails ~5
  • Bundler ~2.2.x
  • MySQL >=5
  • PostgreSQL >=9.2
  • Yarn ~1.22.x
  • Node.js ~12.x for management of assets
  • ImageMagick used by the Dragonfly gem to manage logos
  • Optional : we suggest you to use ruby AND/OR node package management application, such as rvm and nvm, for a better development environment control

You can find more details on how to install Ruby on Rails applications are available from the Ruby on Rails site.

Refer to the following documentation for installing the PostgreSQL database server and creating your first user and database. Be sure to follow the instructions for your particular environment.

You may also find the following resources useful:

Fork Our Repository

Get the latest version of DMP Assistant from integration branch:

# git init  [for an empty folder]
git remote add upstream https://github.com/portagenetwork/roadmap.git
git fetch
git checkout integration
git pull upstream integration
git push origin integration
git checkout -b [my-branch]

Database Preparation

  • Create a new user called postgres using a temporary password secret_password
  • Give the privilege for roadmap and test_db databases to this user

Environmental Variable Configuration

We are using secrets instead of encrypted credentials to handle sensitive information now. You can create a .env file at the root of the project folder, then change following environmental variables based on your need:

Name Description Default Value
RECAPTCHA_SECRET_KEY api key for reCAPTCHA
RECAPTCHA_SITE_KEY api key for reCAPTCHA
SECRET_KEY for encrypting the contents of cookie-based sessions
SECRET_KEY_BASE for encrypting the contents of cookie-based sessions
DEVISE_SECRET_KEY for password encrypting
DEVISE_PEPPER for password encrypting
RAILS_ENV for rails environment setup development
POSTGRES_DB PostgreSQL database name roadmap
POSTGRES_USER PostgreSQL database user postgres
POSTGRES_PASSWORD PostgreSQL database password secret_password
DATABASE_URL PostgreSQL database url "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@127.0.0.1/${POSTGRES_DB}"
DATABASE_TEST_URL PostgreSQL test database url "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@127.0.0.1/test_db"
DRAGONFLY_SECRET for store data
TRANSLATION_IO_API_KEY OPTIONAL. Change this if you want to sync with translation.io. Contact [email protected] for detail
WICKED_PDF_PATH OPTIONAL. wkhtmltopdf needs to be installed for PDF generation/download. See https://wkhtmltopdf.org for download and setup process /usr/local/bin/wkhtmltopdf
  • An example of minimized .env file to get the DMP Assistant work could looks like:
POSTGRES_DB=roadmap
POSTGRES_USER=postgres
POSTGRES_PASSWORD=secret_password
DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@127.0.0.1/${POSTGRES_DB}"
DATABASE_TEST_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@127.0.0.1/test_db"
RECAPTCHA_SECRET_KEY=change_me
RECAPTCHA_SITE_KEY=change_me
SECRET_KEY=change_me
SECRET_KEY_BASE=change_me

Option1: Docker Installation

We provide Docker development environment to simplify your journey of the DMP Assistant. We suggest you use the most up-to-date Docker platform for a better development experience.

In the terminal:

  1. Get latest version of our docker file:

    docker pull ualbertalib/dmp_roadmap:latest
    
  2. Navigate to the dmp assistant folder that you forked, and run the database services in the background:

    docker-compose -f docker-compose-development.yml up -d
    

    If you see an error said /roadmap/.env: no such file or directory, please create .env file on root directory referring to Pre Installation step above.

  3. Install the package.json dependencies:

    yarn install
    
  4. Install the Gemfile dependencies:

    bundle install
    
  5. Apply the migrations to the database:

    bin/setup
    
  6. Start the app:

    rails s
    
  7. Verify that the site is running properly by going to http://localhost:3000 using any of the four tested accounts that is load in seeds.rb:

    Email Password
    [email protected] password123
    [email protected] password123
    [email protected] password123
    [email protected] password123

We will have a new sample database coming soon for you to use. Refer the home page for latest update

  1. You should log in successful and see your dashboard:

Finish Installation

Congratulations for finishing your installation! Now start your journey with DMP Assistant!

Option2: Local Installation

Installation

  1. In the terminal, navigate to the dmp assistant folder that you forked, then run bin/setup to initialize the project (PLEASE BACKUP your old database first if you need first)

You will see dependencies being installed, sample files being created and corresponding databases being created. Lastly, the Rails server is restarted:

Restart Server

  1. Make sure you have npm (node package manager) installed, Then install the node dependencies by running the Webpacker rake task:

    rake yarn:install
    
  2. Once webpack is running, open a second window/tab and start the application

    rails server
    
  3. Verify that the site is running properly by going to http://localhost:3000 using any of the four tested accounts that is load in seeds.rb:

    Email Password
    [email protected] password123
    [email protected] password123
    [email protected] password123
    [email protected] password123

We will have a new sample database coming soon for you to use. Refer the home page for latest update

  1. You should log in successful and see your dashboard:

Finish Installation

Congratulations for finishing your installation! Now start your journey with DMP Assistant!

Post Installation

You should perform the following tasks prior to deploying the system on a server that is accessible to the web:

  1. Delete the users included in the seeds.rb file (e.g. [email protected]) or at least change their passwords. You can also do a data dump if you have a SQL file ready.

  2. Update the site's Branding.

  3. Designate/create a default template. If a user creates a plan and specifies no research organization and no funder (or a combination that results in no published templates) then their plan is created using a default template. You must define your default template in the DB by setting templates.is_default equal to true.