Skip to content

This is a Proof of Concept (POC) project that demonstrates a simple blog application integrated with an email sending feature and a notification system using RabbitMQ for message broker

Notifications You must be signed in to change notification settings

thenriquedb/blog-with-rabbitmq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Email sender and notification system with RabbitMQ

This is a Proof of Concept (POC) project that demonstrates a simple blog application integrated with an email sending feature and a notification system using RabbitMQ for message broker. The goal is to show how to handle asynchronous tasks such as sending notifications when new blog posts are created.

Requirements

Stack

  • Backend: Node.js, Express and Knex;
  • Message Broker: RabbitMQ;
  • Email Service: Nodemailer and mailcatcher;
  • Database: MySql.

Install

  1. Install dependecies
yarn
  1. Create .env file in blog-api root
DB_HOST=localhost
DB_USERNAME=root
DB_PASSWORD=admin
DB_NAME=blog
DB_PORT=3306
RABBITMQ_HOST=localhost
RABBITMQ_PORT=5672
RABBITMQ_USERNAME=guest
RABBITMQ_PASSWORD=guest
  1. Create .env file in email-cosnumer root
NODEMAILER_SENDER_EMAIL=sender@gmail.com
NODEMAILER_HOST=localhost
NODEMAILER_PORT=1025
RABBITMQ_HOST=localhost
RABBITMQ_PORT=5672
RABBITMQ_USERNAME=guest
RABBITMQ_PASSWORD=guest
  1. Start RabbitMQ and MySql (ensure Docker and Docker Compose is installed)
cd apps/blog-api && docker compose up
  1. Run migrations
yarn nx run blog-api:migrate:latest
  1. Seed database
yarn nx run blog-api:seed:run
  1. Run blog-api
yarn dev:blog-api
  1. Run email-consumer
yarn dev:email-consumer

API Documentation

Swagger API documentation is available at:

http://localhost:3000/api-docs

About

This is a Proof of Concept (POC) project that demonstrates a simple blog application integrated with an email sending feature and a notification system using RabbitMQ for message broker

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published