Skip to main content

Developer Setup

PMACS Frontend can be split into two discrete parts from a development perspective:

  1. The Gem itself
  2. The Frontend Demo App, embedded in spec/demo_app

Installing

After cloning the project locally:

  1. Run bundle install from the Gem root (the root-level folder with a .git directory)
  2. Set up the Demo App:
  cd spec/demo_app
  bundle install
  bundle exec rails db:setup

Important note

Always bundle install with the default "Development mode".

Do not attempt to bundle install --deployment, or bundle install --path=vendor/bundle. It is important that the Demo App's dependencies are simultaneously available to both it and the project root.

Running the Demo App

The Demo App uses the PMACS Frontend gem as is in this project's root, allowing you to preview your changes to the source in realtime.

To serve the Demo App:

  1. cd spec/demo_app
  2. bundle exec rails s
  3. Navigate your browser to the resulting URL

Creating a user

  1. Create a user:

    1. Through the Devise login page in the browser, or
    2. Through the Rails console

      FactoryBot.create(:user, email: 'admin@example.com', password: 'password')
      

Testing the Gem

After following the steps in the README, run bundle exec rspec from the Gem root.