Inspiration
CalSafe is inspired by the lack of action taken to address the fear and discomfort that crime has caused among students and other people in Berkeley. As a place known for its lack of safety at night, people may feel restricted and limited in their choice of nightly activities than they may otherwise be due to fears of getting robbed, being physically abused, or being caught in the middle of a gunfire.
While it is noted that BearWalk services do run throughout the day, students unfortunately cannot call upon them after 2:30am and are often in a hurry to reach another area, thus being unable to wait for very long. With a lack of sufficient security in the Berkeley campus, this app seeks to guide students to their destination in the safest possible way using past crime data and street population information to display the safest routes to reaching their destination.
What it does
CalSafe considers both recent historical crime data (from the past 180 days - which is important because it will continuously be updated as per the most recent crimes) and the live number of people on each street to recommend the safest route back home for a user. Higher crime rates would discourage particular routes, and a higher live number of people would encourage those routes as they would be safer. Moreover, CalSafe anonymously crowd-sources locations by uploading each installer’s anonymized location to a database to build a live map of people on the streets. This way, we can optimize for safety where a walking partner or other transportation may not be available.
How we built it
We wanted to make CalSafe cross-platform, so we primarily relied on React Native to provide support for both Android and iOS. React Native primarily relies on javascript, which we learned from scratch while making the project itself. For possible routes and other map-handling related tasks, we used Google’s map APIs.
The Berkeley Police Department provides regularly updated crime data for the last 180 days. Once a user enters their destination (for which we provided an autocomplete model to make it easier for the user to find their intended location), we query for possible routes to reach there, and plot all crimes that occured along each path to allow the user to make a judgment call on the safest path. At the same time, we generate a population map of the live number of people in the region, and then display which route has the most and least traffic. Both of these factors combined would allow the user to find the safest path home, even if it means walking a few extra minutes.
Challenges we ran into
Technical: Initially, we faced difficulty in receiving a successful response from Google Maps’s REST API. Even after getting a response, we realized maps was returning a lot more data than we needed, which unnecessarily increased latency. We had to efficiently process the data to display multiple routes quickly. We faced similar issues for autocomplete suggestions in the app. While developing the app, our screen varied drastically for different screen sizes and anchoring elements to certain points wasn’t working. We redesigned the entire UI to fully use the relative positioning and flexbox system of react native to maintain consistency across phone models and sizes. Since this was the first time we were using React Native and Javascript, we ran into many dependency and flow management issues, which took hours of debugging to finally resolve.
Practical: One of the other major challenges we ran into was considering the real-world challenges in terms of the potential dangers of our solution and realizing how there may be predators who could actually use the app for malicious purposes by targeting streets with low numbers of people. That is why we decided to not display the number of people walking along particular paths and instead internally used this information to comparatively determine which routes had the most and least number of people.
Accomplishments that we're proud of
Implementing a full-scale react native application! Before the competition, our team had no knowledge of how to utilize react native or react js, but in the last few days we have learned to build react native apps and more importantly integrate them with Google Cloud and crucial APIs like those of Google Maps. Moreover, we are most significantly proud of and at the same time excited by the potential of this app to change and potentially save many students’ and peoples’ lives as we look to provide a sense of security and comfort to people’s minds that would be more reassuring.
What we learned
- Building consistent UIs and reducing latency
- To better customize UIs and provide the user with more power in decision making by showing them all the possible paths they can take
- Considering the real-world aspects of how this functionality would be implemented as well as the practical risks roadblocks that may need to be avoided or overcome
What's next for CalSafe
We designed our app to be generalizable to other locations. This app in itself would be useful for not only UC Berkeley students but everyone in the Berkeley area. Just given crime data for a new city such as New York, we could easily expand our app to work here as well. This way, we can make CalSafe a nation-wide app for nighttime safety.
Moreover, we’d look to make use of other fields in the dataset such as time of the crime to add further functionality in helping users to predict the safety of future trips using machine learning to generate predictions. For example, if someone was planning to walk somewhere later in the night they would be able to plan ahead and accordingly determine the safest path to walk along during that time.

Log in or sign up for Devpost to join the conversation.