Project Info
Inspiration
According to the Stanford Open Policing Project, police in the United States pull over more than 50,000 drivers in a typical day. Black and Hispanic drivers are stopped and searched more often than white drivers; for instance, in 2020 black drivers were stopped at a rate of 0.10 per capita by state patrols, compared to 0.07 for white drivers. Such disparities highlight the critical need for a tool that empowers drivers with knowledge about their rights and offers a measure of accountability in police interactions. Our app, "Power to the People," is designed to meet this essential need, providing reliable information and support to drivers during these often stressful and uncertain encounters.
What it does
"Power to the People" is a streamlined mobile app designed for use during police traffic stops. With a simple press and hold of the "I'm Being Pulled Over" button, the app displays legal guidelines, starts recording the interaction using both front and rear cameras, and securely saves the footage to the device for future review. We were also working on an emergency contacts feature that would notify contacts by text when the "I'm Being Pulled Over" button is activated. Given more time, we would've implemented this feature along with cloud backups, video sharing, and location tagging. We were also planning on implementing a database with varying laws for different states.
How we built it
The app uses Swift and SwiftUI as well as a variety of iOS frameworks including AVFoundation and SwiftData. We also utilized a Python script using the smtplib library as an experimental way to send messages to the emergency contacts.
Challenges we ran into
For the native app, we spent a lot of time figuring out how to use AVFoundation to record video. One core feature of the app is that it will record using the front and back cameras simultaneously, which we had to account for. Other than that, it was a matter of managing recordings stored in the app container and defining our data types through SwiftData. For the emergency contact messaging, we ran into problems running the Python script through serverless Applications like Azure and Cloudflare Workers. Our current solution (currently not connected to the app) is to call a website that runs the Python script that sends it to predetermined users since we were unable to connect the emergency contacts to the message script.
Accomplishments we're proud of
We're proud of the Figma design and Swift-based interface for the app. We're also proud of the native technologies we learned while making the app, which we previously didn't have experience with.
What we learned
We learned how to work with iOS native frameworks including AVFoundation and SwiftData. We also experimented with different ways of creating a backend for our app, although we didn't get to integrating it with the app.
What's next
We hope to implement more accessibility-related features such as audio recordings containing basic information and answers to frequently asked questions in cases where users are not able to speak due to the stressful nature of the situation. More implementations include real-time storing and processing of recorded videos into databases, and automatic delivery of said recordings to the emergency contacts at the completion of the recording.
PowerToThePeople
A CruzHacks 2024 project created by Brendan, David, Jacob, and Patrick. This repository contains code for the native iOS app.
Running the code
To build and run the project, you'll need a Mac with Xcode 15.x installed. To use the video recording feature, you'll need a physical iPhone running iOS 17.x.
Clone the repository and open the .xcodeproj file. You'll most likely be asked to select a development team, which you can do under "Signing and Capabilities" under the project settings.
If you haven't already, enable development mode on your iPhone.
Connect your iPhone and select from the device menu (located on the top); then, run Cmd + R to install and run the app.
Analysis
View
Metric
- 106
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- SwiftIn code
- PythonClaimed
1 of 2 appear in the indexed code. 1 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
36 KB
Source files
17
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
brendan-ch/PowerToThePeople
28 files · 16.4 MB · @ c9777f8
Structure
Interface
11 files · 39%Screens, components and styles rendered to the user.
Application logic
11 files · 39%Domain rules, services and shared utilities.
+1 moreData & schema
3 files · 11%Schema definitions, migrations and data access.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- Swift97%
- Markdown3%
Share of indexed source by file size. Binary and vendored files are excluded.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.