sul-dlss / earthworks

Geospatial discovery application for Stanford University Libraries.

Home Page:https://earthworks.stanford.edu

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EarthWorks

CI

Geospatial discovery application for Stanford University Libraries, built using GeoBlacklight.

bay area video arcades slideshow preview

Developing

Pre-requisites

  • Ruby 3.1 or 3.2. Other versions may work but are unsupported.

Installing

Pull down the code:

git clone git@github.com:sul-dlss/earthworks.git

Run the supporting services

You can do this by either running them directly on your dev machine, or by running them in containers using Docker (you should choose one or the other)

Running supporting services directly

Start an Apache Solr instance using solr_wrapper:

solr_wrapper
Running supporting services using Docker

A more production-like setup using Redis and Postgresql is available via Docker. To start the stack:

docker compose up

To have the app use the Postresql container instead of SQLite, uncomment the DATABASE_URL line in the .env[.test] file(s) (in the project root).

To have the app use the Redis container, uncomment the REDIS_URL, REDIS_HOST, and REDIS_PORT lines in the .env[.test] file(s).

The Solr connection info is the same regardless of whether it's run using solr_wrapper or Docker.

Alternatively, you could specify those env vars by prefixing the rails command with them, to (for example) run the app once using Postgres while generally defaulting to SQLite (e.g. DATABASE_URL='postgresql://earthworks:earthworks@localhost/earthworks?pool=5' bin/rails server).

Install the Ruby and Javascript dependencies, and prepare the database

Next, run the setup script:

bin/setup

Run the application

Finally, start the development web server:

bin/rails server

Adding data

To add a small amount of test records to the Solr index, you can use the seed task:

bin/rake geoblacklight:solr:seed

You can also fetch records from OpenGeoMetadata using GeoCombine:

export OGM_PATH=tmp/opengeometadata     # location to store data
bin/rake geocombine:clone[edu.nyu]      # pull data from NYU
bin/rake geocombine:index               # index data in Solr

At Stanford, geospatial data is transformed and indexed by the gis-robot-suite.

Testing

You can run the full suite of tests with the ci command. Do not run this while ssh tunneled as it may delete the production index!

bin/rake ci

There is also a separate suite of "data integration" tests, which are intended to be run against a production search index.

export TEST_SOLR_URL=http://example.com:8080/solr/core_name
bin/rake integration

About

Geospatial discovery application for Stanford University Libraries.

https://earthworks.stanford.edu

License:Other


Languages

Language:Ruby 82.8%Language:HTML 10.2%Language:SCSS 3.7%Language:JavaScript 3.2%