Giter VIP home page Giter VIP logo

therapy-dog's Introduction

Therapy Dog (Deposit Forms)

This is a Node.js and Ember application that provides:

  • flexible forms for collecting files and metadata,
  • an expression language for mapping form input to MODS and other XML schemas, and
  • routines for packaging and submitting METS deposits to the CDR.

Setup for development

Install Node.js.

If you are using Homebrew on macOS:

brew install node4-lts

If you are using Git for Windows, install Node.js using the v4.x.x LTS package available at https://nodejs.org/en/.

Install Dependencies:

make deps

Copy the example forms and vocabularies:

make examples

Start the API server:

make run-server

In a separate terminal, start the client:

make run-client

Visit http://localhost:4200/forms/test-form in your browser.

Setup for building forms only (not doing development)

Install Node.js as above.

Rather than installing dependencies using make deps as above:

cd client && npm install

Copy the example forms and vocabularies:

make examples

Start the API server:

make run-server

In a separate terminal, start the client:

make run-client

Visit http://localhost:4200/forms/test-form in your browser.

Documentation

More information can be found in the docs directory:

  • docs/arrow.md -- description and examples of Arrow features
  • docs/lifecycle.md -- where every part of deposits happen, from requesting a form to submitting to the CDR
  • docs/mailer-testing.md -- how to test mailers in development
  • docs/new-block.md -- how to add a new block type
  • docs/types.md -- reference for the structures that appear in form definitions

To generate API documentation for the server:

make docs

This runs JSDoc, saving the output in the server/docs directory.

If make is unavailable

Copy the example forms and vocabularies:

cp server/data/forms/article.json.example server/data/forms/article.json
cp server/data/forms/catalog.json.example server/data/forms/catalog.json
cp server/data/forms/test-form.json.example server/data/forms/test-form.json
cp server/data/vocabularies/genre.json.example server/data/vocabularies/genre.json
cp server/data/vocabularies/genre.json.example server/data/vocabularies/issuance.json
cp server/data/vocabularies/language.json.example server/data/vocabularies/language.json
cp server/data/vocabularies/role.json.example server/data/vocabularies/role.json

Start the API server:

cd server && npm start

In a separate terminal, start the client:

cd client && npm start

Check before you commit

We don't have CI set up yet, so always run make check before committing.

How to add dependencies

The source code for some dependencies is added to the repository:

  • for the client, Bower components and anything in the vendor/ directory
  • for the server, production npm dependencies (those listed in server/package.json under "dependencies")

We don't add the source code for development npm dependencies (those listed in server/package.json under "devDependencies"), which are anything we need for development (for example, running tests) but not for actually running the client or server.

Add or remove dependencies separately from code changes. This makes reviewing a merge request a little easier, since we can look at our own code in separate commits.

git log --oneline should look like this: (most recent at top)

bbbbbbb Remove 'left-pad' dependency from server.
aaaaaaa Implement NIH left-padding to avoid dependency on 'left-pad'.
1234567 Ensure output is left-padded.
abcdefg Add 'left-pad' dependency to server.

To add a Bower component to client

bower install --save DOMPurify
git add bower.json bower_components/DOMPurify
git commit -m "Add 'DOMPurify' Bower component to client."

To add a vendor dependency to client

git add vendor/normalize.css
git commit -m "Add 'normalize.css' vendor dependency to client."

To add a production npm dependency to server

npm install --save archiver
git add package.json node_modules/archiver
git commit -m "Add 'archiver' dependency to server."

To add a development npm dependency to server

npm install --save-dev xmldom
echo "node_modules/xmldom" >> .gitignore
git add package.json .gitignore
git commit -m "Add 'xmldom' devDependency to server."

How to run tests

make check (Runs server side unit tests)
ember test --server or in a browser go to http://localhost:4200/tests (Runs client side integration tests)

License Information

Copyright 2017 The University of North Carolina at Chapel Hill

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

therapy-dog's People

Contributors

daines avatar lfarrell avatar bbpennel avatar hannahlwang avatar mdaines avatar ember-tomster avatar

Watchers

James Cloos avatar Scorching Oyster avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.