GithubHelp home page GithubHelp logo

fpaupier / notifymask Goto Github PK

View Code? Open in Web Editor NEW
2.0 0.0 0.0 35 KB

Send an email notification to the system administrator upon consuming an alert message from a Kafka topic.

License: MIT License

Go 94.24% Dockerfile 2.71% HTML 3.05%
kafka kafka-consumer golang go email email-sender

notifymask's Introduction

Go Report Card

Notification service

Subscribe to a Kafka topic of notifications to be sent (alert for someone not wearing their mask), fetch the alert from a Cloud SQL instance, send an email to a system administrator and record that the alert has been sent in the database.

Setup your email provider

Sending email programmatically is hard.

If you don't want to land in the spam folder of your recipient, I advise you use an email service provider. Services like mailgun or mailjet can help with that.

For this project, I used mailjet and its email API, free tier. (the free offer limit is 6,000 emails per month and 200 emails per day which is more than enough for this project)

Running on local

  1. Install locally
go install .
  1. Run the service:
$GOPATH/bin/notifyMask

Deploying to Google Cloud Platform (GCP)

I assume you already have an existing GCP project.

  1. First build and publish the image to Google cloud (make sure the storage bucket write access on your project)
gcloud builds submit --tag gcr.io/YOUR_PROJECT_NAME/notify-mask
  1. Then, create a Cloud Compute Engine instance using the image you just published. Create a permanent IP address instead of using an ephemeral one.

  2. Copy the instance external IP address and go to your Cloud SQL instance dashboard.

  3. Go to the connection tab, click + Add network and paste your instance IP address.

Related Projects

This repository hosts the code for the last part of the project; notifying an admin that someone is not wearing their mask. The previous projects are:

  • pi-mask-detection focuses on the detection of whether someone is wearing their mask or not, as seen per the Raspberry Pi.

  • alertDispatcher is a Go module designed to run at the edge, especially a Raspberry Pi 4 B with 4Go of RAM. The alertDispatcher polls the local SQLite event store and publishes them to a Kafka topic.

  • alertIngress is a Go module designed to run on a server, consuming from a Kafka topic where edge devices pushes their events. For each event consumed, the alert Ingress archives it in PostgresSQL and publishes a message to be consumed by the notification service.

notifymask's People

Contributors

fpaupier avatar

Stargazers

Dwi Wahyu Santoso avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.