Document Store is a basic rails app for storing documents. It handles authentication through OAuth2 with a Concord Consortium portal, and/or it's own internal user table.
It relies on PostgreSQL and its JSON column type.
-
Install dependencies:
bundle install
-
Create your database.yml
production: adapter: postgresql host: localhost encoding: unicode database: documentstore_production pool: 5 username: user password: pw
-
Create the db:
rake db:create
-
Run migrations:
rake db:migrate
-
Set up a default user:
rake db:seed
-
Start the server:
rails s
-
Set up a new Client in the providing portal:
Client.create!(name: '<some unique name>', app_id: '<some unique id>', app_secret: '<some unique secret>')
-
In the document store:
Settings['auth.<some_unqigue_name>'] = { display_name: '<some nicely formatted name>', url: <url to the portal>, client_id: <app_id from above>, client_secret: <app_secret from above> }
-
Restart the document server
This repo auto-deploys master
and pull requests to a staging server on Heroku.
A deployment pipeline on Heroku allows deploying to production servers.
- Rspec test can be run using
bundle exec rake
. - Spec test are run automatically on Travis.
- If you have jest installed globally you can run focused JS tests using:
jest --watch --config jest/jest.config.js
Copy the sample database: cp config/database.yml.docker config/database.yml
Run the command: docker-compose up
Document server should be available at:
Other useful tips, incouding how to get SSO working can be found at:
https://github.com/concord-consortium/rigse/blob/master/docs/docker.md
This application was generated with the rails_apps_composer gem provided by the RailsApps Project.
The Document Store app code is licensed under the MIT License.
All other dependencies are under their own respective licenses.