This Project is currently in active development
Rails(~> 6.1) engine that sets up the basic data elements and routes for a more data driven JSON API for digital repositories. Implements ActiveStorage for Cloud or local storage for files. Currently all data models have been created with basic routes and json serializers
- Development
- Create Additional Seralizer Functionality (In priority)
Build JSON/XML Serializer- Refactor to be less complex
- Use
AdapterBase
class to build extended functionality for the followingMods XML- Dublic Core XML
- Marc XML
- RDF
-
Ensure you have the following installed on your development machine
Postgresql ~9.6(v 12 stable is recommended)
Redis
Imagemagick
Ruby >= 3.1
- Docker
-
Clone Project
-
Run
bundle install
-
Setup development dependencies(See the Running guide below)
-
Check
spec/internal/config/database.yml
and make sure yourpostgres
credentials are correct. -
cd
into thespec/internal
directory and:- run
$ rails curator:setup
-- this will run the database setup scripts for you - run
$ rails generate curator:install
(optional) -- this will add an initializer for customizingCurator.config
settings
- run
Curator requires several additional services:
- Solr (for indexing records)
- BPLDC Authority API (for retrieving authority data for controlled vocabluaries)
- Ark Manager (for creating persistent identifiers and permalinks)
- Azurite (for testing azure cloud storage)
- Avi Processor (for creating derivatives from primary files. NOTE this project is still in development and is not needed at the moment)
To set up these services:
- Add Environment variables. Make sure the URLs for these services are set as
ENV
variables (AUTHORITY_API_URL
,SOLR_URL
,AVI_PROCESSOR_API_URL
,INGEST_SOURCE_DIRECTORY
). You can set these using thespec/internal/.env.#{RAILS_ENV}.sample
files. For development copy/rename thespec/internal/.env.development.sample
tospec/internal/.env
ORspec/internal/.env.development
. You are also required to create an.env
and set the variables listed in the.env.docker.sample
file in the root of curator. These are required to start the docker containers - Start the docker containers with
docker-compose up
This will run docker images of theark_manager
,bpldc_authority_api
,azurite
as well as internal sharedpostgres
andredis
containers. On start theark-manager
andbpldc_authority_api
apps will runbundle exec rails db:prepare
which will wither run pending migrations OR runrails db:setup
. NOTE the postgres container is NOT exposed to the host machine so you will need to run a local instance of postgres for the curator app itself. - Install the Azure Cli on your local machine for your given operating system. NOTE.If installing on linux apt/deb DO NOT use the install with one command option as it appears broken in Ubuntu 16.04. Follow the step by step guide instead.
- Setup azure containers on azurite instance.
- First check if the containers exist by running. This will help test if you are having issues with your
--connection-string
param. See the Configure Connection String guide to troubleshoot problems you may have.:az storage container exists --name 'primary' --connection-string 'UseDevelopmentStorage=true'
az storage container exists --name 'derivatives' --connection-string 'UseDevelopmentStorage=true'
- If both containers return
{exist: false}
run the following two commands:az storage container create -n primary --connection-string "UseDevelopmentStorage=true" --public-access off
az storage container create -n derivatives --connection-string "UseDevelopmentStorage=true" --public-access container
- First check if the containers exist by running. This will help test if you are having issues with your
4 In the Curator project, start Solr using the following command (see solr_wrapper for more documentation):
* $ cd ./spec/internal && solr_wrapper
(development)
* $ solr_wrapper
(test)
Any Input/ Suggestions are appreciated as we develop this. Please contact Ben or Eben.
Solr needs to be running before specs can be run.
Prior to starting Solr, create config directory (only needs to be run once):
# populates spec/internal/solr/conf
$ git submodule init
$ git submodule update --remote
To start Solr in Test mode (use a separate console session):
$ cd spec/internal
$ solr_wrapper --config .solr_wrapper_test
Run the specs:
$ bundle exec rake spec
Special thank you to the Samvera community and Jonathan Rochkind for providing this project with gems and code samples to develop this.
The gem is available as open source under the terms of the MIT License.