Skip to content

f-4/WalkSafe-server

Repository files navigation

WalkSafe Server

Mobile app on Android and iOS that provides the user crime density heatmap, real time crime updates using SpotCrime API, and many more safety features.

Table of Contents

  1. Team
  2. Demo
  3. Screenshots
    1. iOS Screenshots
    2. Android Screenshots
  4. Initial Setup
  5. Seeding Databases
    1. Auto-Seed Local Database
    2. Auto-Seed AWS EC2 Database
    3. Seed AWS EC2 Database
    4. Seed AWS RDS Database
  6. Requirements
  7. Development
    1. Installing Dependencies
    2. Installing PostgreSQL and PostGIS
    3. Developing Heatmap
    4. Roadmap
  8. WalkSafe Client
  9. Contributing

Team

  • Product Owner: Fredy-Edwin Esse
  • Scrum Master: Rick Gallegos
  • Development Team Members: Sonrisa Chen and Brian Kim

Demo

View a video of WalkSafe in action here

Screenshots

iOS Screenshots

Android Screenshots

Landing page

Heat Map

Recent Crimes

App Drawer

Initial Setup

  1. Fork and clone the repo
  2. Download and install PostgreSQL and PostGIS
  3. Create walksafe database
  4. Enable PostGIS on walksafe database
  5. In your terminal from within the root directory of your WalkSafe Server folder:
npm install
npm start

Environment Variables WalkSafe Server requires a Mapbox Access Token and Spotcrime API key to use the Mapbox and Spotcrime API on the backend. For Auth0 authentication, WalkSafe requires Facebook and Google credentials along with their corresponding callback urls that the WalkSafe Client will receive and then use to query WalkSafe server. We have used the .env package, which allows environment variables to be set easily with the .env file in the root directory of the project. An example of the necessary variables for WalkSafe Server been provided here in this repo.

WalkSafe Server and Local Host A fair warning when connecting from the WalkSafe Client: Emulated Android devices on Android Studio and iOS devices on Xcode run their own local host so setting the WalkSafe Client environmental variables to route to localhost or 127.0.0.1 will have requests that never reach their destination. Use the appropriate IP address to connect to your WalkSafe Server.

Seeding Databases

  1. Add csv files to /db/csv/
  2. Change seed.js to reflect csv files added

Auto-Seed Local Database

  1. From within the root directory:
npm run seed

Seed AWS EC2 Database

  1. Open up PSQL shell on local computer
  2. Connect to EC2 DB with team username and password
  3. Use \copy command to upload csv files into the EC2 DB

Seed AWS RDS Database

  1. Open up PSQL shell on local computer
  2. Connect to RDS DB with team username and password
  3. Use \copy command to upload csv files into the RDS DB

Auto-Seed AWS EC2 Database

  1. SSH into EC2 DB
  2. Filezilla to drop new csv files into /var/www/WalkSafe-server/db/csv folder
  3. SSH into EC2 Server
npm run seed

Requirements

Development

Installing Dependencies

From within the root directory:

npm install

Installing PostgreSQL and PostGIS

  1. Download and install PostgreSQL here
  2. Enable PostGIS extension during installation
  3. If this option does not pop up then download PostGIS here
  4. Download and install PGAdmin here
  5. Open PGAdmin
  6. On the left-hand side click on Servers
  7. Click on PostgreSQL to connect to PostgreSQL
  8. Right click on PostgreSQL
  9. Click Create
  10. Click Database and name it 'walksafe'
  11. Click Walksafe database
  12. Right click Extensions
  13. Click Create
  14. Click Extension
  15. Under the General Tab go to the Name field and select 'postgis'
  • If PostGIS is not here try manually adding it in terminal:
    psql -d walksafe -c "CREATE EXTENSION postgis;"
  • If PostGIS is still undetected make sure you have downloaded and installed PostGIS
  • Tables are located under Schema > Public > Tables

Developing Heatmap

  • Qgis
  • Mapbox
  • CSV files
  • Seed
  • PostgreSQL PostGIS

Roadmap

View the project roadmap here

WalkSafe Client Repo

View the WalkSafe Client repo here

Contributing

See CONTRIBUTING.md for contribution guidelines.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •