Notification micro service


Cette application est un microservice en charge de l'envois des notification (emails, sms, push notifications).

Technologies utilisées

  • Python 3.8+
  • Celery 5+
  • Redis
  • Django rest framework

Procédure d'Installation

  1. Clonage du projet en local

git clone git@gitlab.com:cryptoechangeur/microservices/notification-service.git.

  1. Installation des dépendances

cd notification_service
pip install -r requirements.txt

  1. Configuration des variables d'environement
    Créer un fichier .env à la racine du projet et ajouter le SECRET_KEY, le CELERY_BROKER_REDIS_URL.
  • Le SECRET_KEY correspond à la clé secrete de l'application django. généré par la commande:
    python -c "import secrets; print(secrets.token_urlsafe())".

  • Le CELERY_BROKER_REDIS_URL correspond à l'URL de Redis server installé au préalable sur la machine.

Exemple de fichier .env :
DEBUG=True
SECRET_KEY = 'bfQspVSh90eG3yrQo8lBZjKLfkDCsjwXvA9Gmc12cUo'
CELERY_BROKER_REDIS_URL='redis://127.0.0.1:6379'

Démarage du service

python manage.py makemigrations
python manage.py migrate
python manage.py runserver

Démarage Celery

celery -A notification_service worker -l INFO -P eventlet

Routes URL

http://localhost:8000/apis/v1/notifications/email/singup/
http://localhost:8000/apis/v1/notifications/email/singnin/
http://localhost:8000/apis/v1/notifications/email/password-reset/request/

Tous est ready!