https://github.com/hack4impact-uiuc/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.
https://github.com/hack4impact-uiuc/life-after-hate
cypress full-stack hack4impact mongodb nonprofit nonprofit-organizations react uiuc
Last synced: 4 months ago
JSON representation
An intuitive resource map to aid nonprofit Life After Hate staff in finding resources for individuals attempting to disengage from hate groups.
- Host: GitHub
- URL: https://github.com/hack4impact-uiuc/life-after-hate
- Owner: hack4impact-uiuc
- Created: 2019-09-26T04:47:45.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-05-03T11:40:25.000Z (about 2 years ago)
- Last Synced: 2024-05-03T15:30:57.221Z (about 2 years ago)
- Topics: cypress, full-stack, hack4impact, mongodb, nonprofit, nonprofit-organizations, react, uiuc
- Language: JavaScript
- Homepage: https://www.lifeafterhate.org/
- Size: 16.9 MB
- Stars: 15
- Watchers: 5
- Forks: 0
- Open Issues: 27
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
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](https://www.evaneckels.com/work/life-after-hate).
# Team

Alan Fang
Product Manager

Josh Byster
Technical Lead

Evan Eckels
Product Designer

Alice Fang
Software Developer

Rebecca Xun
Software Developer

Lauren Ho
Software Developer

Gene Wang
Software Developer

Albert Cao
Software Developer

Eugenia Chen
Software Developer

Angad Garg
Software Developer

Aryn Harmon
Software Developer

Josh Burke
Software Developer
# Setup Instructions
## Prerequisites
To run this project locally, please first install [Docker](https://www.docker.com/) 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](https://git-scm.com/) installed as well, along with [Node.js](https://nodejs.org/en/) to use the helper utility.
## Cloning the repository
To get a copy of the code to run, please [clone this repository](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-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:
- [Mapbox](https://docs.mapbox.com/help/how-mapbox-works/access-tokens/)
- [Google OAuth](https://developers.google.com/identity/protocols/oauth2)
- [MapQuest](https://developer.mapquest.com/)
```
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:
```bash
docker-compose run backend /bin/bash -c "node utils/generate_mock_data.js"
```
To run the app bypassing authentication:
```bash
BYPASS_AUTH_ROLE=admin docker-compose up
```
Without authentication bypass:
```bash
docker-compose up
```
# Credits
We want to give credit to the following open source packages (non-exhaustive list):
Frontend packages:
- [React](https://reactjs.org/) for creating the single page application
- [Redux](https://redux.js.org/) for state management
- [DeckGL](https://deck.gl/#/) for rendering resources on a map
- [MapboxGL](https://www.mapbox.com/) for providing the main map view
Backend packages:
- [Express](https://expressjs.com/) for the API layer
- [Mongoose](https://mongoosejs.com/) for interactions with MongoDB
- [Passport](http://www.passportjs.org/) for authentication
- [Joi](https://github.com/hapijs/joi) for schema validation
- [Fuse](https://fusejs.io/) for fuzzy searching
- [Ramda](https://ramdajs.com/) for functional programming utilities
Testing:
- [Cypress](https://www.cypress.io/) for E2E testing
- [Mocha](https://mochajs.org/) for backend 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](https://www.lifeafterhate.org) ·
> GitHub [@hack4impact-uiuc](https://github.com/hack4impact-uiuc/) ·
> Website [uiuc.hack4impact.org](https://uiuc.hack4impact.org)