Skip to content

Back-End for Asylum Case Analyzer - a tool to empower lawyers to explore case data and help discover judge biases, so they can build a better case for clients seeking asylum.

License

Notifications You must be signed in to change notification settings

tzonglian/human-rights-first-asylum-be-a

 
 

Repository files navigation

Personal Re-Deployment:

Front-End Deploy: https://a.humanrightsfirstasylum.dev/ (enable 3rd party cookies!)

  • Please request credentials because project contains sensitive stakeholder information

Back-up Front-End Deploy: https://human-rights-first-asylum-fe.vercel.app/ - Repo
Back-End: https://hrf-asylum-api.herokuapp.com/ - Repo

(If the deployment links stop working, it's because this was originally a school project that utilized the school's AWS and Okta resources.)

Human Rights First - Asylum - Back End

Dependencies

cacache cron mime-types json2csv aws-sdk

To get started:

  • Create a local Postgres database/instance.
  • Clone the repo locally to your machine
  • Create an .env file on the top level of the repo, with the provided credentials.
  • run: npm install to download all dependencies.
  • run: npm run watch:dev to start your local development server.

Current Back-End Database Schema

Asylum Case Analyzer - Database Schema

Labs30 Notes

  • There are several comments throughout the code that are in place for the Swagger docs, these comments should remain untouched unless the endpoints change.
  • Once there is an actionable API from DS, this backend will use AWS to connect to the API and update our database. This update function can be found in ./utils/update.js
  • Currently, there is a function to clear this cache every 30 days (located in ./utils/update.js), but it is currently commented out. We are still waiting for a working DS model before we uncomment that file.
  • As we near the end of labs, we are learning of some potential changes from the stakeholder regarding judge types, the stakeholder now wants to keep track of Board of Immigration Appeals (BIA) judges that are assigned to cases as well as the Immigration Judge (IJ) assigned. This could mean that the database as it stands will need to be redone and new queries will need to be written in the judgeModel. If this new information is confirmed, there will be a lot of work to be done. We have drawn up a proposed database schema in the event that a rework of the database is necessary. Both the current database schema and the proposed database schema can be found in ./reference.
  • Currently, only the /profile endpoints require authentication. In the future, auth will need to be added to all endpoints however it has not been done yet to make it easier for the entire team to work with the data.
  • Adding profiles was not in scope for this iteration, but there is an endpoint created for it. Because of the Okta integration, we were told that adding profiles was not something we would be doing.
  • The .env.sample file contains all of the environment variables needed and where to find the values in order to run the project locally.
  • It is encouraged that you install the "Better Comments" extension for VSCode, there are several comments that were written with this extension in mind.

Proposed Back-End Database Schema with BIA Judges

Asylum Case Analyzer - Database Schema

Bugs

  • No known bugs!

Uncompleted Tasks

  • Add auth to various endpoints
  • Add an edit case endpoint

Improvements

  • Better mock seed data. Currently, only user profiles, cases, and judges are seeded. Future seeding:
    • Protected Grounds: Race, Religion, Nationality, Political Opinion, Protected Social Group
    • Protected Social Groups
    • Positive Tags
    • Negative Tags
    • All Join tables
  • DS - Code has not been tested whether it will properly post to datascience Postgres database. Datascience PG database was unavailable during the project.
  • The update function written in middleware only works in theory. Once the DS server is up, it will need to be tested and tweaked.
  • Testing needs to be written more fully. The only tests that reliably pass are the profile tests.
  • Some Case PDFs have the case ID's redacted. If it is not provided by the DS db, we need to generate an (autoincremented) ID

Contributors

Labs29 - Team A

Ava Wingfield Tom Bauer Ryan Lee
Linkedin Linkedin Linkedin

Labs30 - Team A

Tzong-Lian Tsay Trevor Beadle Reuben Palumbo
Linkedin Linkedin Linkedin
Anna Brander Maycie Morris Lynda Santiago
Linkedin Linkedin Linkedin

About

Back-End for Asylum Case Analyzer - a tool to empower lawyers to explore case data and help discover judge biases, so they can build a better case for clients seeking asylum.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%