Notification service built with Django. It laverages Redis for rate limiting and PostgreSQL for persistant storage. The service protects recipients from getting too many emails, either due to system errors or due to abuse by implementing a rate-limit based on a time windows and the number of repetitions.
Ensure to Install
- Docker
- Dockercompose
- make
cp .env.template .env
The .env file is copied into the container to access env vars like database configuration
make migrate
This command will create the empty tables on the DB
make superuser
Creates a super user to access django admin.
http://localhost:8001/admin/
Access django admin with the credentials of the superuser created to add more notification types and rules
make tests
make populate_database
This will trigger a command that creates some notification types with rules.
To send a notification, follow these steps:
- Access to:
http://localhost:8001/notifications/solution
- Fill
User ID
,Message
,Notification Type
. - Click
Send
. If the notification is sent correctly, the page will reload. You will see an error in case the notification is rate limited.
- Additional configurations like versioning and effective dates can be added to the rule logic. This implementation is based on notification type, time window, and repetitions.
- http://localhost:8001/notifications/solution is added for testing purposes.
- Basic gateway implementation is also added for testing purposes.