Skip to content
Brian Riley edited this page Nov 9, 2023 · 17 revisions

Requirements

Roadmap is a Ruby on Rails application that requires the following:

  • Ruby >= 3.0
  • Rails >= 6.1
  • PostgreSQL >= 9.2 or MySQL >= 8.0
  • Yarn >= 1.22.4
  • Node.js 16.x for management of assets (DMPRoadmap is using the Rails asset pipeline with Webpacker)

Further details on how to install Ruby, please see their installation guide. If you are trying to setup a development environment. We highly recommend using a Ruby version manager like rbenv.

Further details on how to install the database server and create your first user and database. Be sure to follow the instructions for your particular environment.

You may also find the following resources useful:

Installation

Fork the repository and then clone it

We advise that you create a fork of this repository where you can store your local customization and branding. Then clone that fork instead of cloning this repository directly.

Navigate to the cloned repository and run the either ruby bin/setup mysql or ruby bin/setup postgres depending on which DB you have installed (assuming you have Ruby, Node and either MSQL or Postgresql installed)

The installation will walk you through the process of setting up your DMPTool application. It will:

  • Install bundler
  • Install all of the Ruby gem dependencies
  • Install all of the JS dependencies
  • Copies over a sample .env file and opens it in an editor window (vim for OSX and Linux). You should update the entries, and then save and close in order for the setup script to continue (to generate new secrets, you can run rails secret in a separate tab/window)
  • Copies over the sample encrypted Rails credentials file and opens an editor window (vim for OSX and linux). You should update the entries, and then save and close in order for the setup script to continue (to generate new secrets, you can run rails secret in a separate tab/window)
  • Builds the database
  • Populates the licenses table
  • Populates the metadata_standards table
  • Populates the research_domains table
  • Clears any existing Rails cache and restarts the server (if applicable)
  • Provides instructions on how to populate the repositories and registry_orgs tables

We highly recommend that you review the sample files mentioned above once the setup script has completed. Make any changes you find necessary (e.g. administrator email).

The DMPTool uses the AnywayConfig gem to help manage configuration settings. This gem loads configuration options in a cascading hierarchy. For example a value in config/dmproadmap.yml will be overwritten if the same value also exists in the Rails credentials file. The gem uses the following hierarchy (where values are overridden left to right ... ENV always takes precedence): config/dmproadmap.yml -> credentials.yml.enc -> AWS SSM (if applicable) -> ENV (or .env file)

This allows us to set default values and then override them for a specific environment.

If you need help determining where a particular configuration option is being set, you can run bin/rails config:trace which will return all of the config settings along with their location. For example:

  {"server_host"=>
    {:value=>"http://localhost:3000", :source=>{:type=>:env, :key=>"DMPROADMAP_SERVER_HOST"}},
 "port"=>
    {:value=>"3000", :source=>{:type=>:yml, :path=>"config/dmproadmap.yml"}},

If you need to edit your credentials file after the setup script finishes, you can run EDITOR=vim bin/rails credentials:edit

Once you're happy with the configuration files, you can start the Rails server and verify that the application is up and running:

  • Run bin/dev to start the application
  • Visit http://localhost:3000/ in a browser to verify that the site is working
  • Log in as the default super admin account: using the email+password option (default is: 'super_admin@example.com'+'password123')
  • Go to the 'Edit Profile' page and change your email and password to something more secure

Post Installation

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

  • Delete any other default users included in the seeds.rb file or at least change their passwords.

  • Update the site's Branding.

  • Please replace the app/views/branded files with your own copies. The DMPTool, UC3, CDL, DCC and DMPRoadmap logos and the DMPTool, DMPRoadmap names are for use by those organizations / applications.
  • 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.

Troubleshooting

If the installation process fails after the 'Preparing database' step, you will need to run rails db:drop before running the setup script again!

Clone this wiki locally