Skip to content

A simple demonstraion of notification service in golang with various purpose such as sending emails etc

Notifications You must be signed in to change notification settings

ardimr/go-notification-service

Repository files navigation


Golang Notification Service

A simple notification service which can send email notification to users. This notification service is developed with event-driven pattern and written in Golang.


Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

This project is a simple notification service implemented in Golang, designed to efficiently deliver notifications to users using an event-driven pattern. This service is built with event drivent architecture where it consumes notification events from message queue/bus, ensuring timely and reliable delivery of notifications. In the example, the notification service focuses on sending emails to users, but it can be easily extended to support other notification methods.

In this example, we demonstrate a user registration which needs an email verification process. The flow is as follow:

  1. A service, for example, user management service receives a user registration request.
  2. The user management service generates a OTP code for email verification and wants to send it to the user’s registered email
  3. The user management service publishes an event to message broker alongside the information to be sent
  4. The event is queued in the message broker and waits to be consumed
  5. The Notification Service consume the event and proceed the event
  6. The Notification service send an email to the user

Overall Architecture

The overall architecture is shown on the image below:

(back to top)

Built With

  • Golang
  • Postgres
  • Redis
  • RabbitMQ

(back to top)

Getting Started

Prerequisites

  • Golang
  • Make
  • Redis
  • PostgreSQL
  • RabbitMQ

Installation

  1. Clone the repo
    git clone https://github.com/ardimr/go-project-template
  2. Install Go packages
    go mod install
  3. Run the program
    make run_app

(back to top)

Usage Examples

User Registration

{
    "fullname" : "John Doe",
    "email" : "john.doe@mail.com",
    "password" : "john.doe#wir321"
}

OTP Request

{
    "email" : "john.doe@mail.com"
}

Check the email's inbox and it should have email like this

(back to top)

Roadmap

  • Add authentication and authorization

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Rizky Ardi Maulana - rizkyardimaulana@gmail.com

Project Link: *

(back to top)

About

A simple demonstraion of notification service in golang with various purpose such as sending emails etc

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages