Skip to content

sinuoslabs/laravel-notification-system

Repository files navigation

Notification system design

Build notification system with laravel framework. This system will be implemented using redis, memcached for the cache, mailhog for our mail server and pgsql for the database

How to run

First, you have to configure your .env file, following the example below. The host name must contain the name of the service configured in the docker-compose.yml file. The docker management service used is Laravel sail

Cache and Queue

QUEUE_CONNECTION=redis
CACHE_DRIVER=memcached

Redis

REDIS_HOST=redis
REDIS_PASSWORD=null
REDIS_PORT=6379

Memcached

MEMCACHED_HOST=memcached

PostgresSQL

DB_CONNECTION=pgsql
DB_HOST=pgsql
DB_PORT=5432
DB_DATABASE=laravel_notification_system
DB_USERNAME=homestead
DB_PASSWORD=homestead

Mailhog

MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="${APP_NAME}"

Job queue

Laravel allows to generate jobs, while taking into account the queue system. So, we will not set up a service from scratch, we will simply use the one provided by Laravel.

Notification

Although Laravel has a notification system, we are not going to use it here, the idea is to show you how to set up a good system simply with the design pattern, so you could reproduce it more easily with any programming language of your choice.

Architecture design

Our system must be able to send notifications via SMS, push, email and webhook.

Design

img.png

Flow

img.png

Inspiration

ByteByteGo

NotificationAPI

About

Notification system design approach with laravel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages