Skip to content

chankh/gcp-rss-notifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gcp-rss-notifier

This is a serverless solution that retrieves RSS feeds for new items and sends them to a Google Chat webhook URL for notification.

Architecture

The application follows an event-driven, serverless architecture. The components are decoupled, with Pub/Sub acting as the message bus between the different processing stages.

Key Components:

  • Cloud Scheduler: Triggers the check-feeds function at a regular interval.
  • check-feeds Cloud Function: An HTTP-triggered function that fetches all RSS feeds from Firestore, checks for new items, and publishes them to a Pub/Sub topic.
  • chat-app Cloud Function: This function has two primary roles:
    1. Subscription Management: Provides a user interface within Google Chat for users to subscribe and unsubscribe from notifications for different products.
    2. Notification Delivery: Subscribes to the Pub/Sub topic where new items are published. It receives these items, translates them if necessary, and sends them as messages to the subscribed Google Chat spaces.
  • Pub/Sub Topic: A single topic (release-notes-topic) is used to decouple the check-feeds function from the chat-app function.
  • Firestore: Used to store a record of all processed RSS items to prevent duplicates, and to manage subscriptions.

Deployment

The entire GCP infrastructure for this application is defined and managed using Terraform.

Prerequisites

  • Terraform CLI installed.
  • Authenticated gcloud CLI with access to your GCP project.

Steps

  1. Initialize Terraform:

    terraform init
  2. Review the Plan: Before applying any changes, you can preview the planned operations. You will need to provide your GCP project ID.

    terraform plan -var="project_id=your-gcp-project-id"

    Replace your-gcp-project-id with your actual GCP project ID.

  3. Apply the Configuration: Deploy the application using the apply command.

    terraform apply -var="project_id=your-gcp-project-id"

    Replace your-gcp-project-id with your actual GCP project ID. Confirm the deployment by typing yes when prompted.

This will deploy all the necessary Cloud Functions, Pub/Sub topics, Firestore instances, and Cloud Scheduler jobs.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors