Project Info
Inspiration
More than 50% of property crimes reported to the University of California involve bicycle theft. This project aims to address this critical issue affecting UC students by providing a discrete theft detection, prevention, and tracking system. By helping students protect their bikes, we're contributing to campus safety and justice, ensuring students can focus on their education without the financial and emotional burden of bike theft.
What it does
Trackstar consists of a hardware device and mobile app: Hardware Device: A small, discrete device that attaches to your bike and monitors for unauthorized movement Mobile App: Receive instant alerts when unexpected movement is detected and remotely trigger an alarm to deter thieves Real-time Tracking: When theft is detected, the device automatically sends GPS coordinates so you can track your bike's location How It Works Pair Your Device: Scan a QR code to pair the hardware device with your phone Activate Watch Mode: After parking your bike, activate "Watch" mode through the app Get Alerts: If your bike detects unexpected movement, you'll receive a push notification from the app Track & Deter: View your bike's real-time location on an integrated map and trigger an alarm to deter thieves
How we built it
We built Trackstar as a fullstack IoT system with three main components working together: Hardware Development: We started with an ESP32 microcontroller and integrated sensors for motion detection (MPU-6050 accelerometer) and GPS tracking (GT U7 module). The firmware uses Arduino and implements a state machine to manage Idle, Watch, and Theft Detected modes. We optimized power consumption by keeping GPS inactive until theft is detected, and implemented fast polling intervals for responsive command handling. Backend Architecture: We built a Node.js/Express REST API with PostgreSQL to serve as the central communication hub. The backend authenticates both users (via JWT tokens) and devices (via device ID/secret pairs), stores device state and GPS coordinates, and manages the command queue that devices poll. We integrated Expo's push notification service to send real-time alerts to users when motion is detected. Mobile App: We developed a React Native app using Expo for cross-platform compatibility. The app features a clean, animated UI with dark/light mode support, real-time status updates, and integrated Google Maps for GPS tracking. We implemented custom pulsing animations for status indicators and created a native map modal with a custom bike marker that pulses to match the theft detected state. The entire system communicates via HTTP over WiFi, with the device polling for commands and the app using REST APIs, creating a responsive real-time monitoring experience.
Challenges we ran into
One of the biggest challenges we faced was integrating the hardware and software components by using HTTP requests to communicate between the device and our app. Some of the hardware we used had limited documentation, which required us to do lots of board level debugging. Building a cohesive testing structure on both hardware and software ends was also a necessary challenge we faced to verify the system's behavior.
Trackstar
A discrete bike theft detection and prevention device that sends real-time alerts to your phone with GPS tracking capabilities.
Problem Statement
More than 50% of property crimes reported to the University of California involve bicycle theft. This project aims to address this critical issue affecting UC students by providing a discrete theft detection, prevention, and tracking system. By helping students protect their bikes, we're contributing to campus safety and justice, ensuring students can focus on their education without the financial and emotional burden of bike theft.
Overview
Trackstar consists of a hardware device and mobile app:
- Hardware Device: A small, discrete device that attaches to your bike and monitors for unauthorized movement
- Mobile App: Receive instant alerts when motion is detected, view your bike's location on a map, and remotely trigger an alarm
- Real-time Tracking: When theft is detected, the device automatically sends GPS coordinates so you can track your bike's location
How It Works
- Pair Your Device: Scan a QR code to pair the hardware device with your phone
- Activate Watch Mode: After parking your bike, activate "Watch" mode through the app
- Get Alerts: If your bike detects unexpected movement, you'll receive a push notification from the app
- Track & Deter: View your bike's location on an integrated map and trigger an alarm to deter thieves
Extra Features
- Motion History: View a log of all motion detection events
- Dark/Light Mode: Choose your preferred app theme
- Low Power: Efficient embedded design for extended battery life
App States
Idle
- Device is in low power mode
- Tap the button to activate "Watch" mode when you park your bike
Watch
- Device actively monitors for movement
- If motion is detected, you'll be notified immediately
- View motion detection history anytime
Theft Detected
- You receive an alert when motion is detected
- Confirm if the movement was you or not
- If not you: View GPS location on map and trigger alarm
- Device automatically returns to Watch mode after 10 seconds of no movement
Components
Hardware
- ESP32 microcontroller with WiFi connectivity
- Accelerometer for motion sensing
- GPS module for location tracking
- Buzzer for alarm functionality
- LiPo Battery for portability
Software
- Mobile App: React Native app using Expo for cross-platform compatibility. Handles user authentication, device pairing via QR code scanning, and real-time status monitoring. Features a clean UI with dark/light mode support, push notifications for motion alerts, and integrated Google Maps for GPS tracking with a native map modal that matches the main app UI design.
- Backend: Node.js/Express REST API with PostgreSQL serving as the central communication hub. Authenticates both users and devices (via device ID/secret pairs), stores device state and GPS coordinates, and manages the command queue that devices poll. Handles motion events and GPS coordinates from devices, and integrates Expo's push notification service to send real-time alerts to users when motion is detected.
- Device Firmware: Embedded logic running on the hardware device. Implements motion detection using accelerometer data, manages WiFi connectivity for HTTP communication with the backend, and handles GPS coordinate reading and transmission. Controls device states (Idle/Watch/Theft Detected) and manages alarm activation.
Analysis
View
Metric
- 7
- 1
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
- ExpressIn code
- ReactIn code
- TypeScriptIn code
- CClaimed
- Node.jsClaimed
- PostgreSQLClaimed
3 of 6 appear in the indexed code. 3 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
105 KB
Source files
25
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
mjao1/trackstar
47 files · 3.5 MB · @ 2d7785b
Structure
Interface
9 files · 19%Screens, components and styles rendered to the user.
API & routing
5 files · 11%Request entry points: routes, handlers and controllers.
Application logic
11 files · 23%Domain rules, services and shared utilities.
Data & schema
1 file · 2%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
- TypeScript96%
- Markdown4%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
mobile/package.json
npm · 25- @expo-google-fonts/oxygen
- @expo/vector-icons
- expo
- expo-asset
- expo-auth-session
- expo-camera
- expo-constants
- expo-crypto
- expo-device
- expo-font
- expo-linking
- expo-notifications
- expo-router
- expo-secure-store
- expo-splash-screen
- expo-status-bar
- expo-web-browser
- react
- +7 more
backend/package.json
npm · 16- @prisma/client
- bcryptjs
- cors
- dotenv
- expo-server-sdk
- express
- jsonwebtoken
- zod
- +8 more
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
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.