osulp / kiosks

App for driving the various kiosks hosted in the library
4 stars 0 forks source link

CircleCI Coverage Status

The application is built as a combination of traditional Ruby on Rails for the backend and frontend administration interfaces along with a React app for the kiosk displays.

Dependencies

Server setup notes

See example files located in config/**/\* for the type of configurations needed on the server

Development workflow

Install node modules

Run yarn install in the application root directory to install dependencies.

Create config files

Copy config/application_config.example.yml.erb to config/application_config.yml.erb. Copy config/local_env.example.yml to config/local_env.yml

Configure CAS Login

In config/local_env.yml set values for CAS_BASE_URL and CAS_VALIDATE_URL (see production server)

Set Admin Privileges

First log in, then in Rails Console:

irb(main):001:0> me = User.last
irb(main):002:0> me.admin = true
irb(main):003:0> me.save

Load Drupal Development/Test database with seed data.

Run bundle exec rake test_drupal_database:setup to load the development database with some seed data for the "Hours" API.

Docker

React app directory structure

App code is found in app/javascript/react. Tests are run using Jest and are found in spec/javascripts/react with a directory structure to match the app code.

Rails API notes

Making HTTP calls to the API

The API routes are protected by constraints described in lib/api/v#/constraints.rb which enforce the existence and setting of the ACCEPT header on each request. An example of a valid HTTP ACCEPT header for version 1:

ACCEPT=application/vnd.kiosks.v1