Skip to content

IG-ReDCAD/Safely

Repository files navigation

Safely

Safely

From now on you can travel safely in San Francisco. Safely helps you walk or drive in safe routes. The user can get an idea about the level of safety of each route given by google maps. Then, these routes can be saved and shared on the phone. Safely also can give the user information and statistics about the level of safety of each neighborhood in San Francisco.

Deployment

http://www.imen-graja.com/

Table of contents

Technologies

  • Python
  • Javascript
  • Flask
  • Jinja2
  • Pandas
  • SQLAlchemy
  • HTML
  • CSS
  • Bootstrap
  • jQuery

APIs

  • Google maps APIs ** Geocoding api ** Directions api ** Places api
  • Twilio API

Features

login and registration

Once signed in, the user’s profile is created. alt text

Directions

Using Safely, users can access the direction page and give the origin and the destination of their trip. Using SQLAlchemy, the application can interface with the crime database. The application’s backend is written in Python with Flask as a Python web application framework. Using Javascript and google maps APIs, the different route options are generated. Then, by sending an Ajax request to the server, the different crime data for each direction are given. Based on this data, safety score for each route is calculated.

alt text

Safely also enables the users to save and share the different trips on their iOS/ Android phone or tablet using the Twilio API. If you are concerned about your children safety, you can just create a profile for them, and if your child is going through a high crime route, Safely will automatically notify you by sending a text message.

Neighborhoods

The Safely app enables the user to get an idea about the safety level of each neighborhood in the city. Here the user can select the neighborhood and the crime category to get the information about the crime history in that area, and to get the statistics according to the time which is generated using jQuery and Chart.js.

alt text

Profile

The user of Safely has a profile in which the different trips are saved and a safety related statistics are given.

alt text

Roadmap

The project roadmap for Safely has several features planned out for the next sprint:

  • Extending support to other cities besides San Francisco.

Installation

💡To run Safely on your own machine:

  • Clone this repository:
https://github.com/IG-ReDCAD/Safely.git
  • Create and activate a virtual environment inside your Safely directory:
virtualenv env
source env/bin/activate
  • Install the dependencies:
pip install -r requirements.txt

Sign up to use the Google maps API Sign up to use the Twilio API

Save your API keys in a file called secrets.sh using this format:

export API_KEY="YOUR_KEY_HERE"
export ACCOUNT_SID="YOUR_SID_HERE"
export AUTH_TOKEN="YOUR_TOKEN_HERE"
export MY_PHONE="YOUR_PHONE_NUMBER_HERE"

  • Source your keys from your secrets.sh file into your virtual environment:
source secrets.sh
  • Create an empty database called crimeData and use crimeData.sql to populate it:
createdb crimeData
psql crimeData < crimeData.sql
  • Run the app:
python3 server.py

⭐ You can now navigate to 'localhost:5000/' to access Safely.