Skip to content

Rails app to demonstrate the psuedo-DEL functionality

License

Notifications You must be signed in to change notification settings

paciowg/delDemo

Repository files navigation

DEL Demo

This is a simple (and currently unfinished) web app meant to demonstrate the kind of website that's made possible through interaction with CMS's DEL on FHIR.

You can see it up and running at https://deldemo.herokuapp.com

Installation

These installation instructions may seem verbose as they were written to be accessible to most anyone. It should go quickly if you already have the necessary tools installed and follow the jumps provided!

MacOS

It is most likely the case that these steps are incredibly similar for all other unix based operating systems

  1. Open Terminal

  2. Check if you have Git installed by inputting:

    git --version
    
    • If Git is already installed, Terminal should output something like:

      git version 2.21.0
      

      Jump to step 7 if this is the case.

    • If Terminal responded with anything that might indicate it did not recognize Git, such as:

      -bash: git: command not found
      

      continue to step 3.

  3. Check if you have Homebrew installed by inputting:

    brew -v
    
    • If Homebrew is already installed, Terminal should output something like:

      Homebrew 2.1.7-16-gbf0f1bd
      Homebrew/homebrew-core (git revision 6cc9b; last commit 2019-07-16)
      Homebrew/homebrew-cask (git revision 177ff; last commit 2019-07-16)
      

      Jump to step 5 if this is the case.

    • If Terminal responded with anything that might indicate it did not recognize Homebrew, such as:

      -bash: brew: command not found
      

      continue to step 4.

  4. Install Homebrew by inputting:

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    
  5. Install Git by inputting:

    brew install git
    
  6. Configure Git to match your Github account:

    git config --global user.name "YOUR NAME"
    git config --global user.email "[email protected]"
    

    (Don't have a Github account? Register here then run the above commands)

  7. Create a new directory to store this web app. Feel free to put this directory wherever makes sense. For the sake of simplicity, the following commands will create it directly in the home directory:

    cd ~
    mkdir delDemo
    
  8. Clone the DEL Demo repository into your new directory by inputting:

    cd delDemo
    git clone https://github.com/paciowg/delDemo.git
    
  9. Check if you have Rails installed by running:

    rails -v
    
    • If Rails is already installed, Terminal should output something like:

      Rails 5.2.3
      

      If this is the case, jump to step 15

    • If Terminal responded with anything that might indicate it did not recognize Rails, such as:

      -bash: rails: command not found
      

      continue to step 10.

  10. Check if you have Ruby installed by inputting:

    ruby -v 
    
    • If Ruby is already installed, Terminal should output something like:

      ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin18]
      

      Jump to step 14 if this is the case.

    • If Terminal responded with anything that might indicate it did not recognize Ruby, such as:

      -bash: ruby: command not found
      

      continue to step 11.

  11. Check if you have the Ruby Version Manager (RVM) by inputting:

    rvm -v
    
    • If RVM is already installed, Terminal should output something like:

      rvm 1.29.9 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
      

      Jump to step 13 if this is the case.

    • If Terminal responded with anything that might indicate it did not recognize RVM, such as:

      -bash: rvm: command not found
      

      continue to step 12

  12. Install RVM by inputting:

    \curl -L https://get.rvm.io | bash -s stable
    

    If it asks for your password, provide it. Once downloading RVM, you will need to close and reopen Terminal. Input:

    exit
    

    Then close Terminal, and open Terminal again.

  13. Install Ruby by inputting:

    rvm install ruby-2.6.3
    
  14. Install Rails.

    First, input the following to ensure that Ruby's package manager RubyGems is up to date:

    gem update --system
    

    Then, install Rails by running:

    gem install rails
    
  15. Set up your local instance of the app.

    First, make sure you're in the correct directory (Remember to change the cd path if you chose to set up the app in a different location):

    cd ~/delDemo
    

    Next, ensure you have the Bundler gem installed by inputting:

    gem install bundler
    

    Finally, use Bundler to install the DEL Demo's gems:

    bundle install
    
  16. Check if you have PostgreSQL installed by inputting:

    postgres --version 
    
    • If PostgreSQL is already installed, Terminal should output something like:

      postgres (PostgreSQL) 11.4
      

      Jump to step 18 if this is the case.

    • If Terminal responded with anything that might indicate it did not recognize PostgreSQL, such as:

      -bash: postgres: command not found
      

      continue to step 17.

  17. Install PostgreSQL by inputting:

    brew install postgresql
    
  18. Create and migrate the (largely unused) DEL Demo dev db

    rake db:create:all
    rake db:migrate
    

Run Application

Once installation is complete, you can run the app by following these steps:

  1. Open Terminal

  2. Make sure your working directory is where the app is stored. If you followed the MacOS installation directions above with no variation, inputting the following will get you there:

    cd ~/delDemo
    

    If that is not where your delDemo directory is, instead input cd <path> where <path> is the path to your delDemo directory.

  3. Start up the PostgreSQL server by inputting:

    pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
    
  4. Tell Rails to start up a Puma server by inputting:

    rails server
    
  5. The DEL Demo should be running! Open a browser (I suggest Chrome) and type the following into the address bar:

    localhost:3000
    
  6. When you're done using the app, you need to make sure the server stops running. To do this gracefully, you need to do two things:

    • First, go back to your Terminal window and stop Puma by using the hotkey:

      control-C
      
    • Then, stop the PostgreSQL server by inputting:

      pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log stop
      

Copyright

Copyright 2019 The MITRE Corporation

About

Rails app to demonstrate the psuedo-DEL functionality

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published