- Ruby 3.2.2
- Bundler 2
- ImageMagick
- Solr
- Optional: Docker
-
Clone this repo
$ git clone git@github.com:cul-it/exhibits-library-cornell-edu.git
-
Copy example dotenv file and update
CHANGEMEvalues$ cp .env.example .env
-
Choose your path for setting up your dev environment: start with Docker or start app manually.
$ docker compose up -d
Web server: http://localhost:9292
Solr: http://localhost:8983
Sidekiq: http://localhost:9292/sidekiq
-
Set up admin user using the SITE_ADMINS email set in your dotenv file:
bundle exec rake spotlight:initialize -
Set up initial exhibit:
bundle exec rake spotlight:exhibit
Run full test suite:
$ ./docker/run_test.sh
Open the test container in interactive mode and run tests individually:
$ ./docker/run_test.sh -i
$ bundle exec rspec spec/models/solr_document_spec.rb:20
This project uses RuboCop to ensure consistency in code style/formatting. To output rubocop issues:
$ docker compose exec webapp bundle exec rubocop
Or open an interactive bash session to run rubocop:
$ docker compose exec webapp bash
$ bundle exec rubocop
$ exit
-
Install gems
$ cd <clone> $ bundle install
-
Create the database and run migrations
$ bin/rake db:create db:schema:load db:migrate
-
Start Solr (via solr_wrapper)
$ bin/solr_wrapper
Solr will be accessible at http://localhost:8983/solr
solr_wrapper is configured to persist data between runs. Please refer to the solr_wrapper documentation for details on purging persisted data.
Additional configurations can be made in .solr_wrapper.yml
-
Create an initial admin user and default exhibit
$ bin/rake spotlight:initialize
-
Start Redis and Sidekiq for processing background jobs (Needs to run at the root of the rails app.)
$ redis-server $ bundle exec sidekiq -
Start Rails in new terminal session
$ rails s
Visit the application at http://localhost:3000
Visit the Sidekiq dashboard at http://localhost:3000/sidekiq
$ bundle exec rspec
This project uses RuboCop to ensure consistency in code style/formatting. To output rubocop issues:
$ bundle exec rubocop