Skip to content

MyGovHub-Goodbye-World/notification-greatai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Notification Service (AWS Lambda + MongoDB Atlas)

AWS Lambda function which fetches data from MongoDB, notifying MyGovHub users about upcoming & overdue bill payments or documentation renewal reminders. Setup includes 2 seperate AWS Lambda functions.

© 2025 Goodbye World team, for Great AI Hackathon Malaysia 2025 usage.

Project Structure

lambda_functions/
  get_notification/
	 get_notifications.py
	 requirements.txt
  lambda_notification/
	 lambda_notification.py
	 requirements.txt
.gitignore
README.md
requirements.txt

Lambda Functions

1. lambda_notification

  • Purpose: Scans MongoDB for overdue/upcoming bills and licenses, and inserts notifications.
  • Location: lambda_functions/lambda_notification/lambda_notification.py
  • Handler: lambda_notification.lambda_handler

2. get_notification

  • Purpose: API endpoint to fetch notifications for a user (for frontend).
  • Location: lambda_functions/get_notification/get_notifications.py
  • Handler: get_notifications.lambda_handler

Deployment Steps

  1. Create Lambda Layer

    • Build a layer with pymongo==4.5.0, dnspython==2.4.2, and pytz.
    • Do NOT commit the python/ folder or layer.zip to Git.
    • Attach this layer to both Lambda functions.
  2. Deploy Lambda Functions

    • Zip only the .py file for each function (not the folder).
    • Set the handler as shown above.
    • Set the environment variable MONGO_SECRET_ARN to your Secrets Manager ARN.
  3. API Gateway (for get_notification)

    • Create a REST API.
    • Connect the GET method to the get_notification Lambda.
    • Example endpoint:
      GET /notifications?user_name=Alice%20Tan
      
  4. MongoDB Atlas

    • Store your connection string in AWS Secrets Manager as a JSON key AtlasMongo.
    • Whitelist Lambda’s IP or use 0.0.0.0/0 for testing.

.gitignore

Your .gitignore is set up to ignore:

  • Python cache, virtualenvs
  • Lambda layer build artifacts (python/, layer.zip)
  • OS/editor files

About

A serverless Notification Service on AWS Lambda + MongoDB Atlas, implemented for MyGovHub

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages