Beacon - Project Story

Inspiration

On the fourth day of a backpacking trip in British Columbia, we found ourselves in a sketchy situation. Thunder & Lightning off to the distance, and the threat of torrential downpour put us at serious risk of flash flooding in our campsite which was at the bottom of a mountain and next to a lake. With no cellular service we could not access weather forecasts. That got us thinking about: what if we could get real-time weather through Apple's satellite messaging?

What it does

Beacon transforms satellite-capable iPhones into emergency AI assistants. Users text questions to our system via satellite and receive compressed, actionable intelligence:

  • Real-time weather updates by coordinates using OpenWeatherMap API
  • Active wildfire alerts with evacuation directions from NOAA/NWS
  • AI-powered emergency guidance for medical, survival, and navigation questions via OpenAI

Whether you need to know if a storm is approaching, which direction a wildfire is moving, or how to treat hypothermia symptoms, Beacon delivers critical answers optimized for satellite constraints.

How we built it

Backend Infrastructure (AWS + Twilio):

  • AWS Lambda functions process incoming SMS messages with routing logic to determine request type (weather, wildfire, or AI)
  • API Gateway serves as the webhook endpoint for Twilio SMS integration
  • Twilio SMS API handles bidirectional messaging between users and our system

API Integrations:

  • OpenWeatherMap API for real-time weather data by latitude/longitude coordinates
  • NOAA/NWS Alerts API for active wildfire warnings, red flag alerts, and evacuation guidance
  • Gemini for emergency medical, survival, and navigation questions with prompts optimized for concise, actionable responses

Compression:

  • Satelitte messages are capped at 250 characters in length so we created a primitive yet effective way of shortening messages.
  • Implemented dictionary-based compression replacing common words with abbreviations (e.g., "temperature" → "temp", "emergency" → "emerg")

iOS App (Swift/SwiftUI):

  • Built with swiftUI
  • Direct SMS integration launching Messages app with pre-filled compressed text

Challenges we ran into

1. API Gateway Integration Issues: Twilio sends form-encoded data, but API Gateway was trying to parse it as JSON, causing BadRequestException errors. We solved this by enabling Lambda Proxy Integration and implementing robust parsing logic to handle URL-encoded webhook payloads.

2. Compression Without Breaking Context: Our initial compression was too aggressive, making responses unintelligible. We had to carefully balance character savings with readability, implementing word-boundary regex patterns to avoid partial matches (e.g., "you" → "u" shouldn't affect "your").

3. iOS Full-Screen Background Images: Getting images to properly cover the entire iPhone screen (including notch and safe areas) required playing with GeometryReader, .scaledToFill(), and .clipped() modifiers in SwiftUI.

4. Multi-API Coordination: Routing logic needed to intelligently detect whether a message was asking for weather, wildfire alerts, or general AI assistance. We built a priority system checking for wildfire keywords first (most urgent), then weather, then defaulting to AI.

5. Real-Time Testing: Testing the complete flow required coordinating AWS Lambda logs, Twilio message delivery, and actual SMS on physical devices—debugging required monitoring CloudWatch, Twilio Console, and our phones simultaneously.

Accomplishments that we're proud of

  • End-to-end production system deployed on AWS for the first time ever
  • Native iOS app a really good looking UI
  • Multi-modal intelligence combining three different APIs into one unified interface
  • Built in 24 hours from concept to fully functional prototype

What we learned

Technical Skills:

  • AWS Lambda cold start optimization and environment variable management
  • API Gateway webhook configuration and Lambda Proxy Integration
  • SwiftUI layout system with GeometryReader, ZStack, and safe area handling
  • Twilio SMS API rate limits, error handling, and webhook security
  • Form-encoded data parsing and URL parameter extraction in Python
  • Regex-based text compression while preserving semantic meaning

What's next for Beacon

Short-term (Next 3 months):

  • CI/CD Pipeline Implementation: Currently to update lambda functions I would create a zip then upload it to the console, I need to setup some sort of Github actions for automatic deployment to a development site
  • Launch Beta: Requires we add in the ability to handle multiple messages being sent concurrently from different numbers
  • Rate limiting: Protect against abuse with per-user message caps
  • Historical logs: DynamoDB integration to store user conversations for follow-up questions, as of right now the conversation is not context aware, meaning you cannot ask a follow up question

Medium-term (6-12 months):

  • Multi-language support: Expand beyond English for international expeditions
  • Custom emergency protocols: Pre-configured response templates for specific activities (mountaineering, sailing, search & rescue)
  • Predictive intelligence: Allow users to set their trip ahead of time, and what data they want to receive. eliminating the need to ask for weather updates, instead they can just connect to the satellite and receive a message right away.
Share this project:

Updates