
# Building LifeLine: A Personal Information & Emergency Continuity System with AWS SAM and LocalStack
Important documents are easy to collect and surprisingly difficult to act on. LifeLine turns scattered documents into structured information, attention signals, and emergency action plans using a serverless AWS architecture that can also be developed locally in GitHub Codespaces.
Building LifeLine: From Important Documents to Actionable Information
Important information is everywhere.
Insurance policies, certificates, warranties, receipts, identity documents, and other records often end up scattered across folders and devices. Finding a document is one problem. Knowing what matters in it, what needs attention, and what to do when something goes wrong is another.
That was the problem we explored with LifeLine, our project for the WeMakeDevs × AWS First Commit hackathon.
LifeLine follows a simple pipeline:
COLLECT → UNDERSTAND → PRIORITIZE → RESPOND
The goal is not to replace human decisions. Instead, LifeLine organizes information and prepares useful next steps so people can act faster when it matters.
What is LifeLine?
LifeLine is a personal information and emergency continuity system.
Users can upload important documents and have LifeLine extract useful information such as document type, provider, important dates, amounts, expiry information, metadata, and extraction confidence.
Instead of leaving users with another folder full of PDFs, LifeLine converts the information into structured data.
A deterministic priority engine then identifies information that requires attention. For example, an upcoming expiry can be surfaced on the dashboard without requiring the user to manually search through every document.
LifeLine also maintains provenance by connecting extracted information back to its source document.
Emergency Mode
The most important part of LifeLine is what happens when something goes wrong.
A user can describe an emergency scenario such as:
"I lost my wallet."
LifeLine uses the user's stored information to prepare a structured action plan containing practical next steps and references to relevant source documents.
This is intentionally a decision-support system. LifeLine does not autonomously contact organizations, move money, provide medical treatment, or make decisions for the user. The human remains in control.
Architecture
LifeLine is designed around a serverless AWS architecture consisting of:
- AWS Lambda for backend compute
- Amazon API Gateway for the HTTP API
- Amazon S3 for original document storage
- Amazon DynamoDB for structured application data
- Amazon Cognito for authentication
- Amazon Bedrock for AI-powered document understanding and emergency-plan generation
- Amazon EventBridge for scheduled attention processing
- AWS Amplify for frontend hosting
- AWS SAM for infrastructure definition and deployment
The architecture keeps document processing, storage, authentication, reminders, and emergency workflows modular.
Why AWS SAM?
We kept the infrastructure definition in a single
template.yaml .It defines the Lambda functions, API, DynamoDB table, S3 bucket, authentication resources, permissions, scheduled processing, and deployment configuration.
This gives us one source of truth for the infrastructure and makes the project easier to reproduce and understand.
Instead of manually configuring every resource, a developer can inspect the SAM template and see how the application is assembled.
Building Locally with AWS SAM and LocalStack
A major requirement of our workflow was being able to develop completely inside GitHub Codespaces without depending on an AWS account.
Our local-first setup uses AWS SAM CLI and LocalStack.
The local environment runs:
- LocalStack
- DynamoDB
- S3
- The Lambda backend through
sam local start-api
- The React/Vite frontend
LocalStack provides AWS-compatible local infrastructure for services such as S3 and DynamoDB, while SAM CLI runs the Lambda-based backend locally.
This allowed us to test the core application workflow without requiring AWS credentials.
Keeping Local Development Reproducible
Some managed AWS services cannot be reproduced identically in an offline Codespaces environment.
For example, Amazon Bedrock requires access to AWS foundation models, while Amazon Cognito is a managed AWS identity service.
Rather than pretending these services were running locally, we created explicit local equivalents behind the same application interfaces.
The local environment uses an offline deterministic reasoning engine for document understanding and emergency plans, and a local JWT implementation for authentication.
The production architecture remains mapped to Bedrock and Cognito.
This separation allowed us to demonstrate a complete working application locally while keeping a clear path to the real AWS services.
Document Processing and Prioritization
LifeLine processes uploaded documents, extracts text from PDFs, and uses OCR when required.
The resulting information is validated and converted into structured application data.
Original documents are stored in S3, while structured metadata is stored in DynamoDB.
The priority engine evaluates document information and produces attention signals based on factors such as upcoming dates and document state.
Because the priority layer is deterministic, the same input produces the same classification, making the system easier to test and debug.
Event-Driven Reminders
LifeLine also includes a scheduled attention workflow.
In the production architecture, Amazon EventBridge can trigger a Lambda function on a schedule. The function performs an attention sweep against stored information and creates the appropriate attention events.
For local development, the same workflow can be triggered manually so that the event-driven behaviour can be demonstrated without maintaining a continuously running server.
Security and Testing
Personal information requires careful handling.
LifeLine uses user-scoped access so that documents belonging to one user cannot simply be retrieved by another user.
The production architecture uses Cognito authentication and API Gateway JWT authorization. The local environment uses its own JWT implementation for development.
The backend also includes automated tests covering:
- Schema validation
- PDF extraction
- Document processing
- Priority classification
- Conflict detection
- Emergency-plan generation
- Authentication
- Per-user data isolation
- DynamoDB operations
- Reminder sweeps
- Local AI behaviour
- API validation
This allowed us to repeatedly test application logic inside Codespaces without requiring a deployed AWS environment.
What We Learned
The biggest lesson from building LifeLine was that architecture is not only about choosing cloud services. It is also about deciding how the same system will be developed, tested, demonstrated, and eventually deployed.
AWS SAM gave us a reproducible infrastructure definition.
LocalStack made local AWS-compatible development practical.
Lambda encouraged us to separate backend responsibilities into focused functions.
DynamoDB fit naturally with the user-centric data model.
EventBridge provided a clean event-driven approach for scheduled processing.
Designing local equivalents for Bedrock and Cognito also forced us to think carefully about interfaces and dependencies instead of tightly coupling the application to a single environment.
What We Would Improve
The local-first approach also exposed some challenges.
The biggest was the gap between managed AWS services and completely local development. Bedrock requires AWS configuration and model access, while a fully equivalent local Cognito environment is difficult to reproduce.
We therefore created local implementations for development while preserving the production service interfaces.
AWS SAM was valuable, but the complete setup requires dependencies such as Docker and the SAM CLI. A more streamlined Codespaces onboarding experience could reduce initial setup time for new builders.
These limitations helped us think about deployment portability rather than treating deployment as something that happens only at the end.
The Bigger Idea
LifeLine started with a simple observation:
Having information is not the same as being able to act on it.
A folder can contain everything a person needs, but it does not necessarily tell them:
- What expires soon?
- What needs attention?
- Which document contains the relevant information?
- What should I do when something unexpected happens?
LifeLine attempts to bridge that gap by taking existing information, structuring it, prioritizing it, and turning it into human-readable next steps.
The AWS architecture provides a path from a local hackathon prototype toward a scalable serverless application, while the local development environment keeps the project reproducible for builders working in Codespaces.
What's Next?
The current version focuses on:
Collect → Understand → Prioritize → Respond
Future improvements include richer document extraction, improved OCR, additional emergency scenarios, stronger provenance and audit trails, deeper Bedrock integration, full Cognito-based production authentication, expanded notifications, and more granular privacy controls.
The core idea remains simple:
When something important happens, the information you need should already be organized and ready to help you act.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article