Code Monkey home page Code Monkey logo

youcanbenefit's Introduction

home_page try it live

YouCanBenefit is a web application that increases social benefit program discoverability for people of lesser means and their allies. There are similiar projects, but where I think YouCanBenefit differs in at least some cases, is that it takes what the user likely knows -- their demographic information -- and compares against what the user likely has trouble finding -- the available social programs. It does not save user data.

Contributing

We love contributors! Here are some tips for getting started.

Slack

Join us in our Slack workspace! Get an invite here.

Setting up the development environment

This was tested on Mac OS. It should work on most Linux distros that support Node.js. Windows users should try using Linux Subsystem for now.
Angular NestJS Elasticsearch

To get started, fork this repo to your GitHub account. Clone the fork to your dev machine. Ensure you have Node.js v11 and Docker installed.

There are 3 components required to run YCB.

Frontend

This is built using Angular (the new one). Navigate to the folder frontend inside the project root in your favorite cli.

Run npm ci to install the dependencies.

Run npm start to start the frontend of the app up. You should see the app at localhost:4200.

Backend

This is built using a Node.js framework called Nest. Navigate to the folder backend inside the project root in your favorite cli.

Run npm ci to install the dependencies.

Run npm start to start the backend of the app up. You should see the routes at localhost:3000. To confirm it's working, sending a GET to localhost:3000 should yield Hello World!.

Elasticsearch

This provides the application its search and indexing abilities. You can set this up however you like, but I find using Docker is the easiest way. From their documentation:

docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:6.4.2

Keep in mind, this will lose all the info when it's restarted.

Next Steps

You should now be able to hit the API, have the API talk to Elasticsearch and to be able to view the app. Lets load some data into it. Navigate to localhost:4200/data and click the initialize button and wait a moment. Next, navigate to localhost:4200/data/upload and upload this JSON file. This is an example of the City of Edmonton's YouCanBenefit setup. It should give an indication it was successful after a couple of seconds. Navigate to http://localhost:4200/browse-programs/all to confirm it was successful.

Debugging

We use VS Code primarily, so it's easiest to get set up using that. For the front end, simply running the "Launch You Can Benefit frontend" debug task should pop up a debuggable instance of the Angular frontend. For the backend, ensure you have auto-attach turned on in VS Code. Run npm start from inside the /backend folder in VS Code's integrated terminal. This should automatically detect the running app and attach to it.

youcanbenefit's People

Contributors

azure-pipelines[bot] avatar codygramlich avatar dependabot[bot] avatar farhadmak avatar j-rewerts avatar kylecjo avatar robsonyeg avatar slmyers avatar thebromoe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

youcanbenefit's Issues

Remove keys

  • Use question label instead of key in program queries
  • Remove Keys section
  • Replace input type "type" with Number Input or something similar
  • Infer key type from question input type
  • Add input type to nested multiselect questions

This issue will break the City of Edmonton's current YCB schema. We will need to write a script to transform it to the new keyless schema.

Change default search for program to "search title"

Currently the search option is set to "search disabled" by default. Also, when the "search title" option is selected, no programs are listed initially. We would want it to list all the programs by default and then the user can enter in text as a filter.

Updated dependencies

We need to upgrade our deps again.

Front end:

found 4 vulnerabilities (2 low, 2 high) in 40290 scanned packages
  run `npm audit fix` to fix 3 of them.
  1 vulnerability requires semver-major dependency updates.

Back end:

found 385 vulnerabilities (226 low, 146 moderate, 13 high) in 11829 scanned packages
  385 vulnerabilities require semver-major dependency updates.

Add optional overview statement on screener

Katie has requested to put the following under the "Eligibility Screener" title and before the questions:

“You Can Benefit can be used to find out what benefits you are eligible for right now. It can also be used to plan ahead by finding out what benefits you might be able to get in the future if your life changes. Feel free to submit this questionnaire as many times as you like to explore different possibilities.”

We could either put this in manually or make it customizable so that an admin user can create it if he or she wants to and edit it as desired.

Separate build and deployment

We've gone back and forth on this, but we should colocate Dockerfiles with the source, while removing any Kubespec files. We will be migrating to using Helm to manage YCB soon, so it will be stored in a City-run private repository.

Add type string to keys

Keys only support integer and boolean types.

Also rename "number" to "integer" for consistency throughout the program

Fix snapshot testing

We currently have problems with reproducibility. Our snapshots often change:

      Object {
        "guid": "hp5mupqcVY8ZMiKg7Q91Uoi4Wf",
        "queryIDs": Array [
    -     "C8NZoL1Nf7VEgEC4VMFI9GlebN",
          "d5NswIlUvzxY0AJ1hGm4eKQtS4",
    +     "fMwdx1jiAZUt09ALDer98GardT",
          "JeXk8cOZnqJMepmHpxDqpsEXNE",
          "jI1HlTlpbULsSVUmHnYi3ZlVJ7",
          "jzMQkEK41gnhmwWyxAuWF3eZ4d",
          "NOyR66aE30dJYXgdHJ2CvGLpnx",
          "qZyokzKnpIw3Ue6mdTi8je3knK",

We need our snapshots to be the exact same between runs.

Unable to delete program in program-edit

At the screen to edit the details of a program, there is a delete program button in the top right corner. No network request is sent when this is clicked and a snackbar always responds with "delete failure."

Deleting a program from the list of programs (program-overview) still works.

Cannot delete query

When I delete a query, then refresh the page, the query I thought I deleted is still there.

Fix should be same as #36

Add tooltip to questions

Some questions can confuse people. One of the questions on the City of Edmonton You Can Benefit site is "What is your Household's Total or Gross yearly income? (check line 150 of your tax return) Option: If you don't know your gross income, multiply your monthly income by 12." Having a tooltip that can be hovered over to give more info would be helpful for citizens. In this case, maybe it could explain what your tax return looks like, where to find your income, etc.

Loading screen displays incorrect number of programs

ycbloadingscreen

This message often doesn't show up when the page loads quickly. I'm thinking we should just remove the 28 and have the message say, "Please wait a few seconds while we load data from government and nonprofit programs for you."

Ability to edit/delete keys

Once a key is made, there is no way to delete it.

Could be an intentional design decision. Look into Elasticsearch.

Update query display

Since keys have been replaced with question texts and some question texts are long, it is difficult to distinguish between one condition and the next. The type column can be removed since the type can be inferred from the question.

Keys

Creating new keys was erroneously removed from the app. It should be replaced.

Add KeyEditComponent <app-key-edit></app-key-edit> into the keys overview component

this area may give trouble. In that case, adapt so that you feed keys from here and delete troublesome code.

Also, this feature is needed because the site admins are thinking about adding new programs soon.

Give keys description

Currently, it's difficult to tell what keys where created for. If we could add a description, that would make things easier to understand.

Pass environment variables to frontend app

It's easy to pass configuration to the backend through Docker. This makes configuring and creating new containers easy. It's a bit trickier in frontend apps. See here for some discussion on how to do it.

Range conditions

use case:

Is there a way to input an income query result as a range? I am working with the new Leisure Access Program and for people over the base amount but under another amount they will be eligible the Leisure Access Pass Lite. I would like to set it up so that for people eligible for the regular LAP they won’t see the Lite version (less confusing that way) but can’t seem to figure out how to set a minimum AND maximum income amount.

requires:

  1. Making a new condition type in Query object.
  2. Building UI to support constructing such a condition.
  3. testing the feature.

Queries created in new unsaved program remain in elasticsearch

When a user creates a program, adds some queries, but then clicks away from the page so that the program was never saved, the queries remain in elasticsearch. When queries are created on an existing program and the program is not saved, the queries remain (which I think we would want to have).

This bug isn't too big of a problem as it won't affect programs that show up since the programs for the queries don't exist.

Template System

use cases

Any way to copy a query set from one program to another? It would really speed up data entry if we could do this and then only have to modify one variable on the various queries rather than renter everything from scratch.

Is there a way to set it up so a single question makes someone ineligible for a program? For example I am working on the Alberta Adult Health Benefit and want to set it up so that if someone is on AISH then the program doesn’t show up regardless of their other answers. So far I think the only way to do that is to add aish to every query, is that correct?

requires

  • Defining a Template object common to client, server and db.
  • Implement Template endpoint on server.
  • create programs/Template/*, where * := new | edit/:id
  • Interface Template with Program.

Add screener tester to queries page

It would be handy if we could have a little testing area where we assign keys values directly, and the queries are dynamically evaluated. It would display whether someone with the set keys would qualify for the program. As you edit your current query, it would dynamically adjust to tell you whether you qualify or not.

Add ability to duplicate queries

Building queries is the most arduous part of a YCB site administrator's role. If we could duplicate them, it would make it much easier.

Add configurable quick-links page

The page here will need to be customizable. GitHub's wiki pages allow a sidebar built from markdown, as well as a primary markdown area. Something similar could be integrated into YCB.

This probably only needs to be a single page, which should make it easier.

Frontend issues creating a new program

When creating a new program, the program details and program queries may correspond to different guids. If you click create a new program, enter the program details and click save program, then you must navigate to a different route and then back to /admin/programs to see the new program and begin editing the queries. If you don't do this and instead click edit queries while in the program-edit view, the queries will be linked to a new program with a different guid.

However, if you click create new program and go to the edit queries view and then back to the edit details view, this is not a problem.

Also, we would want the request GET /protected/program to be sent every time the PROGRAMS tab is clicked so that new programs are listed after creating new programs. Right now it does not get sent when you go from /admin/programs/application-edit/:guid or /admin/programs/edit/:guid to /admin/programs/overview.

Update information - about page, quick-links page, screener statement

Katie wants some information on the about page and the documents and resources page to be updated. The child and family benefits calculator link is broken and should be updated. A link to a CPP calculator should be added. A disclaimer should be added on the about page. And a statement on the screener page should be added.

404.html

need a nice 404.html. We have one, but Caddyserver doesn't seem to want to show it.

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.