Skip to content

jtcheng26/ucla-cs35l-bruinsafe

Repository files navigation

BruinSafe

React Native

Los Angeles is not pedestrian friendly.

With high crime rates and a car reliant infrastruction, walking around LA is often dangerous. However, what do we do when walking is unavoidable?

Our solution: BruinSafe.

BruinSafe is a mobile app that aims to enhance the personal safety of UCLA students by providing real-time location tracking equipped with walk requests with peers, nearby crime alerts, and crime report tracking.

Table of Contents

Prerequisites

  • Node.js (>= v18.0.0). Install Node here.
  • npm (>= v8.3.0)
  • Expo CLI (>= v6.3.0).
  • Expo Go (Mobile App)

Note: Do not use WSL2.0/WSL1.0 functionality

Getting Started

Installation

  1. Clone the repository and enter it:

    git clone https://github.com/jtcheng26/ucla-cs35l-bruinsafe.git
    cd ./ucla-cs35L-bruinsafe
  2. Install dependencies by running npm install

Setup MongoDB

If you do not have a prexisting MongoDB Atlas Account, create one for free here.

Once logged in, navigate to Dashboard. Under the Deployment header, click Database.

Click Green Button with message Build a Database.

Choose which deployment option you would like to use. Shared Clusters are free.

Choose your favorite Cloud Provider and Region. Recommended to stick with the default (AWS).

Press Green Button with message Create Cluster.

While waiting for Cluster Provisioning, navigate to Security header and select Database Access. Click Add New Database User. Fill out form.

Under Security header, select Network Access Tab. Press Add IP Address.

Select either Add Current IP Address or Allow Access From Anywhere. Press confirm.

Wait for Cluster Provisioning to finish.

Once finished, press Connect. Under Connect to your application, select Drivers.

Follow driver installation instructions. Copy your connection string. Should be in the format: mongodb+srv://<username>:<password>@cluster0.qan00x8.mongodb.net/?retryWrites=true&w=majority.

Remember to replace <username> and <password> with your login credentials.

Within ucla-cs35L-bruinsafe repository, navigate to backend directory: cd backend

Within backend create and enter .env file.

Within .env file, create DATABASE_URL variable and assign it with your connection string. Should look like:

DATABASE_URL="mongodb+srv://<username>:<password>@cluster0.qan00x8.mongodb.net/?retryWrites=true&w=majority"

Don't forget to replace <username> and <password> with your unique login credentials.

Database should be fully setup for running app.

If you run into any issues, visit MongoDB Atlas Docs

Google Maps Directions API

The Google Maps Directions API is required to show directions in the application. You need to sign up for an account and generate an API key.

Then, run export GOOGLE_APIKEY={YOUR_API_KEY_HERE_WITHOUT_BRACKETS} to set the key as an environment variable. npx expo start should then be run in the same terminal session where the environment variable was set.

Running

  • Run npm start
  • On mobile device switch to same WIFI as local device
  • On mobile device scan QR code:
    • If IOS scan using Camera App
    • If Android scan using Expo Go App
    • Certain networks may create issues, if so:
      • Stop hosting on local device by typing CTRL-C
      • Run:expo-cli start --tunnel
      • Repeat above steps

Features

  • Crime Report: Alert users of nearby crimes in real-time. Users can report crimes via a simple report tab.
  • Walk Requests: Allow users to send walk requests to designated contacts who can monitor their safety and progress.
  • Built-in Navigation: Provide navigation functionality so that users never have to switch applications, allowing continous safety.
  • Authenticated Login: Authenticate users for secure access to the app, as well as preventing illegitimate reports. Uses SHA-256 hash for password protection.

Issues

For any issues please contact one of the developers:

Jeffrey Cheng Pranav Puranam Darlina Williams Bach Ngo Abhi Morumpalle