Developer Setup
PMACS Frontend can be split into two discrete parts from a development perspective:
- The gem itself
- The Frontend demo app, embedded in
spec/demo_app
Installing
After cloning the project locally, run bundle install from the gem root (the root-level folder with a .git directory).
Set up the demo app by executing the following commands in the terminal:
cd spec/demo_app bundle install bundle exec rails db:setup
If you already went through installation and want to reset the demo app environment, run bundle exec rails db:reset instead of bundle exec rails db:setup.
Important note
Always
bundle installwith 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 in this project's root, allowing you to preview your changes to the source in realtime.
To serve the demo app run, the following commands in the terminal:
cd spec/demo_appbundle exec rails s
Then, navigate your browser to the resulting URL.
Add mock data to the demo app by executing bundle exec rails db:devseed in the terminal. You can always run the Rails console (bundle exec rails console) and generate objects manually as well.
Testing the gem
After following the steps in the README, run bundle exec rspec from the gem root.