/life-after-hate

An intuitive resource map to aid nonprofit Life After Hate staff in finding resources for individuals attempting to disengage from hate groups.

Primary LanguageJavaScript


Life After Hate
Life After Hate

A Hack4Impact UIUC project.

About This Project

"Each year, more than 250,000 people in the United States are victims of hate crimes. The vast majority are violent and more than half go unreported. Between 2008 and 2017, 71 percent of extremist-related fatalities in the U.S. were committed by members of the far right or white-supremacist movements. LAH helps people leave the violent far-right to connect with humanity and lead compassionate lives."

- Life After Hate

When helping people leave hate groups, LAH staff members need to sift through their resources located on many different platforms: Excel, email, paper, and more. These resources can be either businesses or organizations that will support ex-hate group members willing to change.

This time sunk looking for resources is time not spent helping people exit hate groups, limiting LAH's reach as an organization. This bottleneck in the support process can also take up to days to complete. By automating and organizing the search process, we can speed up the process of matching resources to formers. We wanted to create a highly-secure, easily searchable, centralized web application to host and manage these resources. This way, we can enable LAH to spend more time serving people and accomplish their mission on a larger scale.

To learn more details about the project, please view the official case study.

Team

Alan Fang
Alan Fang

Product Manager
Josh Byster
Josh Byster

Technical Lead
Evan Eckels
Evan Eckels

Product Designer
Alice Fang
Alice Fang

Software Developer
Rebecca Xun
Rebecca Xun

Software Developer
Lauren Ho
Lauren Ho

Software Developer
Gene Wang
Gene Wang

Software Developer
Albert Cao
Albert Cao

Software Developer
Eugenia Chen
Eugenia Chen

Software Developer
Angad Garg
Angad Garg

Software Developer
Aryn Harmon
Aryn Harmon

Software Developer
Josh Burke
Josh Burke

Software Developer

Setup Instructions

Prerequisites

To run this project locally, please first install Docker on your machine. We use Docker to allow for a more seamless development experience, allowing us to get up and running with just a few commands.

You must have Git installed as well, along with Node.js to use the helper utility.

Cloning the repository

To get a copy of the code to run, please clone this repository.

In your terminal:

git clone https://github.com/hack4impact-uiuc/life-after-hate

Creating the .env file

To run this app, we use external integrations with Google OAuth, Mapbox, and MapQuest. Hence, you will need to create a file named .env in your root directory with the below template, and provide values for the specified API keys below. Feel free to set SESSION_SECRET to any arbitrary string. The keys may be obtained from the following sources:

GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
REACT_APP_MAPBOX_ACCESS_TOKEN=
SESSION_SECRET=
MAPQUEST_KEY=
REACT_APP_API_URI=http://localhost:5000/api/
FE_URI=http://localhost:3000/
DB_URI=mongodb://db:27017/LAH_DB
OAUTH_CALLBACK_URI=http://localhost:5000/api/auth/login/redirectURI
MAPQUEST_URI=http://www.mapquestapi.com/geocoding/v1/

Setting up LAHUtil

You may have trouble running the below commands on a Windows machine. If this is the case, please reach out to us for support.

This project comes bundled with an executable to help ease development located at scripts/lahutil. It wraps around the Docker Compose commands, so if you are familiar with those, you can skip this step and run the commands directly. Once you have completed the above step with your .env file, please cd into this repository and run the following commands in your root directory:

npm install
sudo chmod +x ./scripts/lahutil
./scripts/lahutil

You should be presented now with a menu of options at this point.

Optional: you may add lahutil to your PATH environment variable to allow you to run commands directly, so instead of running ./scripts/lahutil up, you can just run lahutil up.

You can add the following to your ~/.bashrc (or ~/.zshrc if you are using zsh):

export PATH=~/Documents/life-after-hate/scripts:$PATH

Running the app

To add mock data to the database, run the following command:

./scripts/lahutil seed

To bypass authentication, run the following:

./scripts/lahutil up --admin

Alternatively, to run without authentication bypass (i.e. requiring you to log in), instead run:

./scripts/lahutil up

The above may take a few minutes to run, as it will download all the appropriate packages to run the entire application.

After this, you should be able to navigate to localhost:3000 in a web browser to access the app. Similarly, the backend will run at localhost:5000. These ports are configurable within the .env file. If you do so, however, make sure to change the corresponding ports in docker-compose.yml.

When you are finished running, you can run lahutil down.

Running manually without LAHUtil

You can instead run the following commands instead if you are running into difficulties with the above steps:

To seed the database with sample data:

docker-compose run backend /bin/bash -c "node utils/generate_mock_data.js"

To run the app bypassing authentication:

BYPASS_AUTH_ROLE=admin docker-compose up

Without authentication bypass:

docker-compose up

Credits

We want to give credit to the following open source packages (non-exhaustive list):

Frontend packages:

  • React for creating the single page application
  • Redux for state management
  • DeckGL for rendering resources on a map
  • MapboxGL for providing the main map view

Backend packages:

  • Express for the API layer
  • Mongoose for interactions with MongoDB
  • Passport for authentication
  • Joi for schema validation
  • Fuse for fuzzy searching
  • Ramda for functional programming utilities

Testing:

License

Copyright 2020 Hack4Impact UIUC

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


lifeafterhate.org  ·  GitHub @hack4impact-uiuc  ·  Website uiuc.hack4impact.org