Problem Statement
Children’s safety isn’t just a personal concern, it affects the mental well-being of parents globally. In India, a child goes missing every 8 minutes, according to the National Crime Records Bureau (NCRB).

More than 47,000 children were reported missing recently, and 71.4% of them were minor girls. While location-tracking apps exist, most fail to offer real-time emergency alerting, crime mapping, or safe route guidance.

There’s a clear gap for an application that combines live location tracking, instant panic alerts, and intelligent safety indicators — all in one.

Image description

My Motivation
As a mother of two beautiful children, this project is deeply personal. I know the fear of losing sight of your child even for a moment, and I built CareNest to help parents like me.

With the help of Amazon Web Services, I created a real-time, responsive, and scalable system that can actually make a difference.

This isn't just a tech solution, it's a safety companion born out of love and necessity.

What is CareNest?
CareNest is a browser-based child safety application designed to

  • Track a child’s real-time location using the browser’s geolocation API and LeafletJS.
  • Allow a child to trigger an emergency alert via a panic button.
  • Identify poorly lit streets, safe zones, and nearby facilities like hospitals or police stations.
  • Use AWS serverless services to process and deliver real-time alerts.
  • Offer a lightweight, scalable, and cost-efficient solution using cloud-native architecture.

Refer this live demo - https://sundus-hussain.github.io/MDBot_Alert_/

Image description

AWS Architecture

Frontend which is hosted on Github pages is a A responsive UI built with HTML, CSS, JavaScript, and LeafletJS. Javascript is used to add the functionality as with ease it can be collaborated with HTML and CSS.

Geolocation API-Tracks the child’s live coordinates from the browser.The Geolocation API is a built-in browser feature that allows web applications to access a device's current physical location using GPS, Wi-Fi, or cellular networks. In CareNest, this API is used to continuously track the child's live coordinates, including latitude and longitude and directly from their device.Once the permission is granted by the user, the app monitors their real-time movement and updates their position on the map using LeafletJS. This forms the backbone of live location tracking, ensuring that the child’s location is always visible and accurate for the parent to monitor from any device.

Image description

Amazon API Gateway Securely exposes backend endpoints to receive panic alert data. Amazon API Gateway acts as the secure entry point for all incoming requests from the CareNest frontend. When the panic button is pressed by the child, the browser sends a POST request containing the current location coordinates to the API Gateway endpoint. API Gateway then validates, formats, and forwards this data to an AWS Lambda function for processing.

Image description

It ensures that the communication between the web app and backend remains secure, scalable, and efficient. With features like throttling, monitoring, and request validation, API Gateway helps prevent misuse and provides a highly available interface for the application to trigger critical emergency workflows. It’s also configured with CORS settings, which are essential for allowing cross-origin communication from the GitHub Pages frontend to AWS services.

AWS Lambda (Node.js)-Processes the alert, fetches address using LocationIQ, and sends the message. AWS Lambda is the serverless compute service that powers the backend logic of CareNest. Written in Node.js, the Lambda function is triggered automatically whenever the API Gateway receives a panic alert request from the frontend. It extracts the child’s location data which including latitude, longitude, and timestamp and then performs two critical tasks.

Image description

First, it calls the LocationIQ API to perform reverse geocoding, converting the raw coordinates into a human-readable address. This makes it easier for parents to understand exactly where the child is.

Image description

Second, the Lambda function prepares an emergency message that includes the child’s ID, the exact time of the alert, the location address, and a direct Google Maps link. This message is then published to an Amazon SNS topic, which delivers it to subscribed parents via SMS or email.

Image description

Because it’s serverless, there's no need to manage infrastructure — Lambda automatically scales with demand and stays cost-efficient, only running when needed.

LocationIQ API-Converts latitude/longitude into a readable address (reverse geocoding).

Amazon SNS-Sends emergency alerts via SMS and email to registered contacts.Amazon SNS is a fully managed messaging service that enables CareNest to send real-time emergency alerts to parents or guardians. Once the AWS Lambda function processes the panic alert and generates the message, it uses SNS to deliver this alert through multiple channels — typically SMS and email.

Image description

In the CareNest setup, a specific SNS topic is created and subscribed to by the parent’s phone number and email address. When the child triggers the panic button, the SNS topic is immediately published with the alert message. This message contains the child’s ID, timestamp, live location, and a Google Maps link pointing to the exact coordinates.

SNS ensures that parents receive these notifications almost instantly, providing peace of mind and enabling faster response times during emergencies. The service is highly scalable, reliable, and integrated seamlessly with Lambda, making it ideal for a serverless, event-driven architecture like CareNest.

CORS + HTTPS-Ensures secure, cross-origin requests from the frontend.n web applications like CareNest that rely on frontend-backend communication, CORS (Cross-Origin Resource Sharing) and HTTPS are essential for both functionality and security.

Since the CareNest frontend is hosted on GitHub Pages (a different domain from the AWS backend), the browser treats requests between them as cross-origin. Without proper CORS configuration, these requests would be blocked by the browser. To enable this securely, CORS headers are configured in Amazon API Gateway, including Access-Control-Allow-Origin, Access-Control-Allow-Headers, and support for OPTIONS preflight requests. This allows the frontend to send data (like location and emergency alerts) to the backend Lambda function without errors.

In addition, all communication between the browser, API Gateway, and SNS is done over HTTPS, which ensures that sensitive data — such as location coordinates and emergency messages — is encrypted during transmission, preventing unauthorized access or tampering.

Together, CORS and HTTPS make sure that CareNest’s real-time alerts are both safe and reliable.

Image description

Functionality

Front end will display live location of the child, panic button and child profile. In the backend AWS Lambda is used for serverless function for emergency alert handling. Amazon API gateway is used to expose Lambda as secure HTTP endpoint. Amazon SNS is used to real time emergency alerts to registered contacts. LocationIQ API is used for reverse geocoding is used to convert latitude and longitude to human-readable address. GitHub Pages (Static Frontend) is used to host the live frontend of the application. CORS Configuration, HTTPS ensures secure data transmission and cross-origin request control. For Future Scope Government APIs / OpenStreetMap Crime, Light, Safety Data will be used for marking safe places, crimes, and light/dark streets.​

Image description

Image description

Advantages​
It is Lightweight and cost-effective due to serverless setup​.

emergency alerts via SNS​ which is instantly sent to the parents or any other family memnber who all are registered under the appliaction.

Parents can relax and concentrate on their work which increases their day to day to productivity and peace of mind.

easily scalable as no backend server needs to be managed.

It is quite fast and responsive, in future according to the need and number of users the downtime can be taken care of with AWS.

Challenges & Learnings​
Faced CORS issues on API Gateway — fixed with proper OPTIONS method and headers.​

Understood how SNS topics and subscriptions work, as Amazon web services is a pay as you go model it can easily be used my any user.

Learned to use LeafletJS and geolocation together.​

Gained insights into serverless application design in depth like the use of AWS Lambda.

Future scope is kept to measure the Risk Zone Prediction with Machine Learning​

Battery Health Monitoring​ can also be achieved through Machine learning and AI.

Multi-Channel Alerts Integration​ is also important as now a days various platforms are used by people.

Debugging
First Issue
it took many hours of debugging and knowing the real issue why application is not able to handle certain commands.
After deploying the Lambda function and triggering the emergency alert, the alert didn’t reach the parent via SMS or email. On checking the Amazon SNS console, the subscription status was showing as “Pending Confirmation.”

I assumed SNS would immediately send messages after subscribing the number/email. I tested repeatedly but no alerts were being delivered.

Later I realized that for email subscriptions, the recipient must manually confirm the subscription from the AWS-generated confirmation email. After clicking the confirmation link, the status changed to “Confirmed”, and alerts started working. For SMS, direct confirmation isn't required if the number is added correctly.

Second Issue
When the Lambda function tried to publish the emergency message via SNS, it failed with an error
"AccessDeniedException: User is not authorized to perform: SNS:Publish".

I reviewed my code and retried with different SNS topic ARNs, assuming the issue was with the ARN format or message syntax.

Then the actual problem was with IAM permissions. I updated the Lambda’s execution role by attaching the AmazonSNSFullAccess policy. After that, Lambda had the rights to publish messages to the SNS topic, and the error was resolved.

Third Issue

When I tried to trigger the panic button, everything looked correct — I had given all the necessary permissions, and my Lambda function and API Gateway were configured. But still, I kept getting the dreaded browser error:
“CORS preflight request doesn't pass access control check.”

I double-checked all CORS headers, ensured that Access-Control-Allow-Origin was set to "*", and even re added methods like OPTIONS and POST to API Gateway. Despite all this, the error kept showing up, and I was genuinely anxious and confused.

Image description
After almost an hour of frustration, suddenly the request started working successfully, no code change, no config update. It turned out API Gateway changes can sometimes take a few minutes to propagate across regions. The moment I saw “Alert sent successfully”, my happiness was on cloud nine.
And as they say: “If it’s working, don’t touch it.” I took the advice to heart and let it be.

Fourth issue
During early testing, I occasionally got errors like "Location not found" or "Invalid lat/lon" from LocationIQ.
I added a retry block and logged all responses but still got failures for some valid-looking coordinates.
I discovered that the API would sometimes fail if the coordinates were passed as strings instead of numbers, or if the rate limit was exceeded. I corrected the format (parseFloat(lat)), and implemented a check to avoid overloading the API with too many rapid requests. I also added a fallback message like "Address not found" to gracefully handle API failures.

Image description

Future Scope
CareNest has laid the foundation for a real-time child safety solution, but its potential goes far beyond basic location tracking. In the future, we aim to integrate machine learning models to predict high-risk zones based on past movement patterns, time of day, and known crime data. This would allow the app to proactively suggest safer alternative routes and notify parents if the child enters a risky area.

We also plan to implement battery health monitoring on the child’s device. Parents would receive alerts if the battery level is critically low, ensuring that location tracking doesn’t fail unexpectedly.

To make CareNest even more accessible, we envision building a dedicated mobile app using React Native, enabling real-time notifications, background location tracking, and an improved user interface for both children and parents.

Lastly, we plan to expand alerting options by integrating WhatsApp, Telegram, or other messaging services via AWS Pinpoint or third-party APIs. This would ensure that emergency alerts reach parents on the platforms they use the most, making response times even faster.

References
AWS Documentation
https://docs.aws.amazon.com/lambda/latest/dg/welcome.html
https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-cors.html
AWS Whitepapers
Serverless Architectures with AWS Lambda
https://docs.aws.amazon.com/whitepapers/latest/serverless-architectures-lambda/serverless-architectures-lambda.pdf

Security Best Practices for AWS Lambda
https://docs.aws.amazon.com/lambda/latest/dg/best-practices.html

Overview of Amazon Web Services (Well-Architected Framework)
https://docs.aws.amazon.com/whitepapers/latest/aws-overview/aws-overview.pdf

LeafletJS Mapping Library
https://leafletjs.com/

LocationIQ API (Reverse Geocoding)
https://locationiq.com/docs

OpenStreetMap (Safe Zone Data)
https://www.openstreetmap.org/

Thankyou Note
This journey has been incredibly meaningful not just as a developer, but as a mother who deeply understands the importance of child safety. I’m thankful to the AWS Community Day Bengaluru Blogathon for giving me the opportunity to bring my idea to life using cloud-native technologies.

Special thanks to the AWS tools and documentation, which empowered me to create a real-world impact with zero infrastructure management. This project has truly shown me how technology, when used with purpose, can protect what matters most.

If you’ve made it this far, thank you for reading, and I hope CareNest inspires more solutions that combine compassion with innovation.