AWS Builder Center
AERA: From Motion Signals to Emergency Response — Building a Local-First Safety Companion

AERA: From Motion Signals to Emergency Response — Building a Local-First Safety Companion

AERA is a mobile safety companion designed to make journeys safer by detecting unusual movement, monitoring trip context, and escalating to a trusted emergency response circle when a user cannot check in. Built with Expo/React Native, device sensors, location tracking, persistent trip history, and a cloud-ready backend, AERA focuses on one principle: safety systems should continue working even when connectivity is imperfect.

Most safety applications are reactive. They ask the user to press a button, make a call, or manually share their location after something has already gone wrong. But in a real emergency, the user may be disoriented, injured, unable to reach their phone, or simply unable to react quickly enough.
That question became the starting point for AERA:
What if a safety application could pay attention to the journey itself and intervene when the user cannot?
AERA is our attempt to build that kind of safety companion.

The problem we wanted to solve

During a commute, late-night journey, solo drive, or unfamiliar route, a person may encounter sudden braking, unusual movement, an accident-like event, or another situation where assistance could be needed.
The traditional model depends heavily on manual action.
We wanted to explore a more proactive model:
sense → analyze → verify → escalate
Instead of treating SOS as the beginning of the system, AERA treats it as the final escalation step.

How AERA works

When a trip begins, AERA monitors the journey using the phone’s available motion and location signals.
The current implementation uses native accelerometer, gyroscope, and foreground location data during active trips. Trip state, response countdowns, completed trips, and emergency-contact information are managed through a shared mobile state layer, while key local information is persisted using AsyncStorage.
The flow is intentionally human-centered. When unusual motion is detected, AERA does not immediately assume that an emergency has occurred. Instead, it can enter an analysis and check-in flow:
Unusual movement detected → analyze the event → ask the user to confirm they are safe → escalate only when needed.
This reduces unnecessary escalation while still creating a path to emergency assistance and the user can also trigger SOS manually at any time.

Designing for failure, not only the happy path

One of the most important architectural choices in AERA was making the first mobile experience local-first.
Emergency contacts and completed trips can persist locally, allowing the core user experience to continue even before a remote gateway is configured. The app also retains local motion-threshold logic as a fallback when remote prediction services are unavailable. That matters because safety software should not become useless simply because the network becomes unreliable.
Rather than assuming perfect connectivity, we designed AERA around graceful degradation.
The application can continue to:
  • monitor an active trip,
  • track elapsed time, distance, and location,
  • maintain trusted emergency contacts,
  • record trip and event history,
  • support manual SOS,
  • preserve local safety state.
Cloud-backed prediction and alert calls can then extend this experience when connectivity is available. The codebase exposes an optional API-gateway configuration for prediction, alert, and contact operations.

Making safety understandable

We did not want AERA to become a black box that simply displays “AI detected something.”
The interface is designed around visible states:
Monitoring → Analyzing → Risk Detected → User Check-In → Emergency Response → Trip Summary
Users can see sensor-health status, trip metrics, alerts, emergency events, trip history, and safety summaries rather than receiving an unexplained classification.
This makes the system easier to understand and easier to demonstrate, debug, and improve.
The Technical Architecture
The current repository is structured as a TypeScript workspace and combines a mobile application with backend services. The mobile application is built with Expo Router, while the backend stack includes Express 5, PostgreSQL, Drizzle ORM, Zod-based validation, and generated API interfaces.
At a high level:
Mobile layer
  • Expo / React Native
  • Expo Router
  • accelerometer and gyroscope
  • foreground GPS
  • local trip and contact persistence
  • emergency and check-in flows
Application/backend layer
  • TypeScript
  • Express
  • validation through Zod
  • PostgreSQL + Drizzle ORM
  • generated API integration
Cloud integration boundary
  • optional gateway for prediction, alert, and contact services
  • local fallback behavior when remote services are unavailable.
That separation lets us iterate on the mobile safety experience without tightly coupling every user interaction to a network request.

What we learned

Building AERA changed the way we thought about safety applications.
The most difficult part was not simply detecting movement.
It was managing state and uncertainty.
A safety system has to answer questions such as:
  • Is this movement actually abnormal?
  • Should the user be interrupted?
  • How long should the app wait for confirmation?
  • What happens if the network disappears?
  • What information should be preserved after a trip?
  • When should an alert become an emergency?
  • How do we avoid making the experience frightening when nothing is wrong?
Those questions pushed the project beyond a simple hackathon prototype.
They required us to think about sensor reliability, fallbacks, persistence, navigation, emergency state transitions, map/location handling, and user experience as one system.

Where we want to take AERA next

The prototype establishes the core loop, but there is much more we want to explore.
Future directions include stronger motion-event classification, richer contextual models, better route-aware risk analysis, configurable escalation policies, stronger cloud event processing, and improved emergency-location sharing.
We also want to improve how safety scores are derived so that they become explainable indicators rather than arbitrary numbers.

Closing thought

AERA is built around a simple belief:
A safety system should not wait for the user to become capable of asking for help.
By combining device sensors, location context, local-first resilience, user confirmation, and controlled emergency escalation, we are exploring how mobile applications can move from passive tools toward proactive safety companions.
For us, the most valuable part of building AERA was not adding more features.
It was designing a system that knows when to observe, when to ask, and when to act.
That is the direction we want to keep building toward.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article