18F/Paid-Leave-Prototype

View on GitHub
README.md

Summary

Maintainability
Test Coverage
# Paid Family & Medical Leave Prototype

[![Code Climate](https://codeclimate.com/github/18F/Paid-Leave-Prototype/badges/gpa.svg)](https://codeclimate.com/github/18F/Paid-Leave-Prototype)
[![CircleCI](https://circleci.com/gh/18F/Paid-Leave-Prototype.svg?style=svg)](https://circleci.com/gh/18F/Paid-Leave-Prototype)

This prototype was built by [18F](https://18f.gov/), in partnership with the [Department of Labor's Women's Bureau](https://www.dol.gov/wb/). Our goal was to provide a simple front-end, and some guidance on potential back-end structures, so that any jurisdiction with a Paid Family Medical Leave program can more easily create a website for it. [The prototype is available now](https://federalist-proxy.app.cloud.gov/site/18f/paid-leave-prototype/). Notable subsets of the prototype include [a public-facing application process](https://federalist-proxy.app.cloud.gov/site/18f/paid-leave-prototype/claims/new/) and a [healthcare-provider patient-approval process](https://federalist-proxy.app.cloud.gov/site/18f/paid-leave-prototype/claims/verify/).

## Development
Development is in the [18f-pages branch](https://github.com/18F/Paid-Leave-Prototype/tree/18f-pages).

## Project Management
Feel free to open an issue if you'd like to request a feature. You can also [look at our issues-tracking system on Trello](https://trello.com/b/0RAkaeci/dol-paid-leave).

## Technical Approach
With a goal of constructing a modular, extensible, lightweight easily-customizable platform, this prototype employs several notable processes:
* The site is constructed in [Jekyll](https://jekyllrb.com/).
* It is built entirely in JavaScript, to ensure that it can be hosted in any server environment.
* The application form is encoded as [JSON Schema](http://json-schema.org/), with [JSON Form](https://github.com/joshfire/jsonform) used to dynamically generate the HTML for the form. (No form data is present within [the application page's HTML](https://github.com/18F/Paid-Leave-Prototype/blob/18f-pages/_pages/claims/new.html)—it is all rendered in-browser, via JavaScript.)
* Upon submission, form contents are submitted against the JSON Schema before being submitted to a RESTful endpoint (a server to be provided by the state implementing this prototype software).

Making changes to the form and validation process can be done by modifying [the schema](https://github.com/18F/Paid-Leave-Prototype/blob/18f-pages/javascripts/schema.json), with some particular HTML customizations possible via extensions to the schema in [the form JSON](https://github.com/18F/Paid-Leave-Prototype/blob/18f-pages/javascripts/form.json). See [the JSON Form documentation](https://github.com/joshfire/jsonform/wiki) for specifics about this.

Because the form is generated from JSON, it would not be difficult to extend this prototype by adding a web-based form-building system, permitting customizations to the form without necessitating editing any JSON or HTML.

## Local Development
This can be deployed locally with the following commands:
```bash
git clone https://github.com/18F/Paid-Leave-Prototype.git
gem install jekyll bundler accesslint-ci
jekyll serve --watch
```
## Third Party Javascript Libraries
* [jquery-2.1.4](https://github.com/jquery/jquery)
* [jsonform](https://github.com/joshfire/jsonform/wiki#default-mapping)
* [TV4- Tiny Validator for JSON Schema v4](https://github.com/geraintluff/tv4)
* [Tablesaw Js](https://github.com/filamentgroup/tablesaw)
* [Underscore Js](https://github.com/jashkenas/underscore)

## Contributing

See [CONTRIBUTING](CONTRIBUTING.md) for additional information.

## Public domain

This project is in the worldwide [public domain](LICENSE.md). As stated in [CONTRIBUTING](CONTRIBUTING.md):

> This project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the [CC0 1.0 Universal public domain dedication](https://creativecommons.org/publicdomain/zero/1.0/).
>
> All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.