Skip to content

Latest commit

ย 

History

70 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Email Microservice - [EMAIL]

๐Ÿš€ ๐ŸŸง Email Microservice ๐ŸŸง ๐Ÿš€

Email Microservice of an Email Messenger System based on @MichelliBrito's classes

|ย ย  Overviewย ย ย |ย ย ย  Technologiesย ย ย |ย ย ย  Projectย ย ย |ย ย  Routesย ย ย |ย ย ย  Runย ย ย |ย ย  Authorย ย ย |ย ย ย 


| ๐Ÿ›ฐ๏ธ About:

This application is an implementation of a Microservices Architecture using RabbitMQ for queue communication and the best practices of Clean Architecture, SOLID and DDD, all documented. Use Docker to handle the entire system structure.

:octocat: | User Microservice: [ https://github.com/Samuel-Ricardo/ems_user ]


| ๐Ÿ—๏ธ - Technologies and Concepts Studied:


  • Spring Framework
  • RabbitMQ
  • PostgreSQL
  • Docker
  • Microservice
  • Communication Between Microservices
  • Email SMTP
  • Maven
  • REST
  • Swagger
  • Validation
  • Lombok
  • Environment
  • Clean Architeture
  • DDD
  • JUnit
  • H2 Database
  • Error Handler

Among Others...


๐Ÿ’ป | Application:


Giving an overview, this architecture is divided into User Microservice and Email Microservice, each with its own databases, communication between them occurs through a broker which in this case is based on asynchronous queues managed by RabbitMQ


๐Ÿ•บ | User

:shipit: | Repository: [ https://github.com/Samuel-Ricardo/ems_user ]


The main function of User Microservice is to list and register users in a database. When a user is saved in this MS, it publishes this event to the broker.


๐Ÿ“ง | Email

:shipit: | Repository: [ https://github.com/Samuel-Ricardo/ems_email ]


The main function of the Email Microservice is to send a welcome email to new users, for this it listens to the broker, when a created user event is published this MS consumes this event and sends an email to this new created user welcoming .


๐Ÿ“ฎ | Broker

The broker is an intermediary between microservices, it receives events and store in a Queue Data Structure that is triggered and can be consumed by other microservices that are waiting for it to react.


๐ŸŒฑ | Example


๐Ÿ‘จโ€๐Ÿ’ป | How to use


Open your Git Terminal and clone this repository

  $ git clone "git@github.com:Samuel-Ricardo/ems_email.git"

Make Pull

  $ git pull "git@github.com:Samuel-Ricardo/ems_email.git"

This application use Docker so you dont need to install and cofigurate anything other than docker on your machine.


Navigate to project folder and run it using docker-compose

  # After setup docker environment just run this commmand on root project folder:

  $ docker-compose up --build   # For First Time run this command

  $ docker-compose up           # to run project

  #Apps Running on:

  $ USER: http://localhost:8080 - [MICROSERVICE] | [USER]
  $ EMAIL: http://localhost:8081 - [MICROSERVICE] | [EMAIL]
  
  $ SWAGGER: http://localhost:8080/swagger-ui/index.html - [DOCS]


  $ PostgreSQL: http://localhost:5431 - [DATABASE] | [USER]
  $ PostgreSQL: http://localhost:5432 - [DATABASE] | [EMAIL]
  
  $ PGAdmin: http://localhost:5050 - [DATABASE] | [VIEW]


  $ RabbitMQ: :5672 - [BROKER]  
  $ RabbitMQ: http://localhost:15672 - [BROKER] | [VIEW]

  See more: docker-compose.yaml

:octocat: | Author:


- Samuel Ricardo


๐Ÿ“š | Deep-Dive Documentation


Extended technical documentation โ€” generated from a full codebase analysis. The sections above remain the canonical project README; this section complements it with engineering deep-dives.

flowchart LR
    U[๐Ÿ‘ค ems_user<br/>8080] -- "user.created event<br/>(JSON โ†’ EmailDTO)" --> Q[(๐Ÿฐ RabbitMQ<br/>queue: default.email)]
    Q --> L[๐Ÿ“ฌ RabbitMQEmailConsumer]
    L --> S[โš™๏ธ EmailService]
    S --> M[โœ‰๏ธ SMTP<br/>Gmail :587]
    S --> DB[(๐Ÿ˜ PostgreSQL<br/>TB_EMAILS :5432)]
Loading

Tech at a Glance

Java Spring Boot RabbitMQ PostgreSQL Docker CI

Java 17 ยท Spring Boot 3.2.0 (Web, Data JPA, AMQP, Mail, Validation) ยท RabbitMQ ยท PostgreSQL / H2 ยท Lombok ยท springdoc-openapi ยท Maven ยท Docker ยท GitHub Actions + cosign

๐Ÿ“„ Documentation Index

# Doc Content
00 Docs Index navigation hub
01 Overview context, features, system scope
02 Architecture C4 views, layers, patterns
03 Messaging RabbitMQ contract, EmailDTO payload
04 Data Model entity, status machine, schema
05 Configuration env vars, profiles, secrets
06 Testing strategy, gaps, coverage gate
07 Deployment Docker, compose, CI/CD, K8s
08 Security findings & hardening
09 Development build, run, conventions
10 Improvement Backlog prioritized enhancements
โ€” ADRs architecture decision records

โš ๏ธ Security Notice

Rotate the SMTP credentials historically present in .env โ€” see docs/08-security.md.

About

Email Microsservice for a email service application with RabbitMQ and Spring Framewrok

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages