- Database on Google Cloud PostgreSQL server
- Made with Python Flask and sqlalchemy
As newcomers to a city, we never know nor have connections who can tell us which part of the city is dangerous. As international students ourselves, this was certainly a concern for us as well as our families who worry about us every day overseas. This is where we came up with the idea of making a database based on crimes in the U.S. In this application, we will be able to look for crimes related to specific locations (states) within the U.S. to identify dangerous locations that newcomers should avoid. For each location, we will display data such as the number of crimes, past crime history, and locations of police offices. In addition to these fundamental functionalities, we will extend this app to display the details of the crime as well as display the missing and wanted person to branch for help to the public. Another aspect we intend to tackle is the current issue of police brutality. Since we will have a record of the police officer with their associated charges, we hope to have a positive impact on the officers’ actions (such as them having a second thought before doing the wrong) since they will be publicly organized and displayed.
- The location page is interesting because its output comes from multiple database tables and queries. We use SELECT COUNT(*) and WHERE table.state=user input state to get the number of crimes, police offices, police crimes, homicides, missing people, and fugitives in the selected state. The total number of crimes is equal to the sum of homicides and police crimes. This page is used to give the user an overview of how safe/unsafe the chosen state is.
- The police crimes page is also interesting because it allows the user to get detailed information on police crimes in the selected state. It first uses the user input to find police crimes that happened in the selected state. Then it finds the corresponding victim's information by matching case_id in Police_Crimes_Work_At table and Police_crime_victims table. This page displays both police officers' and victims' information, including age, race, sex, etc.
-
Create virtual environment with
python3 -m venv crimes_database
-
Activate virtual environment with
source crimes_database/bin/activate
-
Install dependencies with
pip install -r requirements.txt
-
Run server with
python server.py
-
Optional: to add dependencies, use pip, then include it in requirements.txt by
pip freeze > requirements.txt