Skip to content

Latest commit

 

History

History
114 lines (101 loc) · 4.14 KB

README.md

File metadata and controls

114 lines (101 loc) · 4.14 KB

OpenReferral.org HSDA Implementation for BTV

OpenReferral is a project that has been building a set of standards to better facilitate building and sharing community service information, such as what is often associated with 211 systems.

OpenReferral provides a data specification for how the data will be stored called the Human Services Data Specification - the HSDS.

Access to and use of the HSDS is defined via the Human Services Data API - the HSDA.

This project aims to implement the HSDA as a method by which the brigade can then enable HSDA client programs - front-ends - to start creating and managing HSDS data for Burlington or all of Vermont.

Demo at https://codeforbtv-openreferral.herokuapp.com/

Contributing!?

Hop over to the GitHub project and claim a task card by dragging it to the "claimed" column, and assigning it to your GitHub user name.

The task cards with "Good First Issue" are ideal for beginners.

When you are ready, clone the repo using Git on your computer. Then make sure to "checkout" (aka switch-to) the development branch... or create your own branch with your own name.

This API, as was mentioned below, was generated with the intention of being built as a Restify-based API. You will likely find it useful to reference the documentation for Restify as you work.

How the initial commit was reached

We used "swagger-node" to generate an HSDA server skeleton. https://github.com/swagger-api/swagger-node

  1. Created New folder and open terminal/cli in that folder
  2. Use newest-ish node:
    nvm use 14.15.4
  3. Install swagger-node:
    npm install -g swagger
  4. Create project: swagger project create hsda-cfbtv
    • Chose “Restify” because of having used it the most before
  5. Use the OpenReferral YAML to overwrite the hello-world skeleton
    1. Go get the YAML: https://github.com/openreferral/api-specification/blob/master/_data/api-commons/openapi-hsda.yaml
    2. Start the project in edit mode:
      swagger project edit
      • The web browser should open in edit mode showing YAML on the left, and API GUI on the right
    3. Open the YAML and copy the contents to clipboard
    4. Select-all in the web browser YAML file display, delete, and paste OpenReferral YAML
      • It will take a few seconds for the browser to process and show updated editable-GUI
      • When it is done it should say it was saved in the top right corner (this is automatic, there is no button to push to save it)
  6. Start API:
    swagger project start
  7. Fix generated project
    1. There is a problem with swagger-node and modern versions of Node (i.e., => 10 ... which is bizarre!)
    2. Fix based on this note -> swagger-api/swagger-node#586 (comment)
    3. Edit ‘hsda-cftbv/project.json’ and change:
      that
      "dependencies": 
      {
        "bagpipes": "^0.2.2",
        "restify": "^4.0.2",
        "swagger-restify-mw": "^0.1.0”
      }
      
      to
      this
        "dependencies": 
        {
          "bagpipes": "^0.2.2",
          "restify": "^4.0.2",
          "swagger-restify-mw": "^0.7.0"
        }
        
    4. Edit ‘hsda-cfbtv/config/default.yml’ and change: to
      that
          swagger_controllers:
          - onError: json_error_handler
          - cors
          - swagger_security
          - _swagger_validate
          - express_compatibility
          - _router
      
      to to
      this
          swagger_controllers:
          - onError: json_error_handler
          - cors
          - swagger_params_parser
          - swagger_security
          - _swagger_validate
          - express_compatibility
          - _router
      
  8. Restart swagger project