Skip to content

About

A Reminder & Notification microservice built with Node.js, Express, MySQL, RabbitMQ, Nodemailer, and Cron Jobs to process asynchronous events and send automated email notifications in a microservices architecture.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reminder Service

A Notification & Reminder microservice responsible for processing asynchronous events and sending automated email notifications. The service consumes messages from RabbitMQ, stores notification requests, and uses scheduled cron jobs to send emails reliably.

Features

  • Email Notification Service
  • RabbitMQ Message Consumer
  • Event-Driven Architecture
  • Scheduled Email Processing
  • Automated Reminder System
  • MySQL Database Integration
  • Sequelize ORM
  • Nodemailer Email Service
  • Cron Job Scheduling
  • Notification Status Tracking

Tech Stack

  • Node.js
  • Express.js
  • MySQL
  • Sequelize ORM
  • RabbitMQ
  • amqplib
  • Nodemailer
  • Node Cron
  • dotenv

Architecture

Booking Service
        |
        |  (RabbitMQ Event)
        v
Reminder Service
        |
        |---- Store Notification
        |
        |---- Cron Job Scheduler
        |
        |---- Send Email
        |
        v
     MySQL

The service listens to events generated by other microservices, stores notification requests, and periodically processes pending notifications.


Workflow

Notification Flow

  1. Another microservice publishes an event.
  2. RabbitMQ forwards the event to Reminder Service.
  3. Notification request is stored in the database.
  4. Cron Job periodically fetches pending notifications.
  5. Email is sent using Nodemailer.
  6. Notification status is updated.

Core Functionalities

Event Consumption

  • RabbitMQ Consumer
  • Queue Binding
  • Event Processing
  • Message Parsing

Notification Management

  • Create Notification Ticket
  • Track Notification Status
  • Update Delivery Status
  • Store Pending Notifications

Email Service

  • Automated Email Sending
  • Gmail SMTP Integration
  • Scheduled Processing
  • Delivery Tracking

Database Model

NotificationTicket

  • id
  • subject
  • content
  • recepientEmail
  • status
  • notificationTime
  • createdAt
  • updatedAt

Installation

Clone the repository:

git clone <repository-url>

Install dependencies:

npm install

Configure environment variables:

PORT=3003

DB_HOST=localhost
DB_USER=root
DB_PASSWORD=password
DB_NAME=notification_db

EMAIL_ID=your_email@gmail.com
EMAIL_PASS=your_app_password

MESSAGE_BROKER_URL=amqp://localhost
EXCHANGE_NAME=BOOKING_EXCHANGE

Run migrations:

npx sequelize-cli db:migrate

Start the server:

npm start

Project Structure

src/
│
├── config/
├── controller/
├── services/
├── repository/
├── models/
├── migrations/
├── util/
│   ├── job.js
│   └── messageQueue.js
└── index.js

Key Concepts Implemented

  • Microservices Architecture
  • Event-Driven Architecture
  • RabbitMQ Messaging
  • Asynchronous Processing
  • Background Jobs
  • Email Automation
  • Cron Scheduling
  • Notification Systems
  • Repository Pattern
  • Service Layer Pattern

Future Improvements

  • SMS Notifications
  • Push Notifications
  • Retry Mechanism
  • Dead Letter Queues
  • Notification Templates
  • Email Queue Prioritization
  • Redis Integration
  • Docker Deployment

Author

Developed as a notification microservice for handling asynchronous communication and automated email reminders within a scalable flight booking ecosystem.

About

A Reminder & Notification microservice built with Node.js, Express, MySQL, RabbitMQ, Nodemailer, and Cron Jobs to process asynchronous events and send automated email notifications in a microservices architecture.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages