Skip to content

i3-Market-V3-Public-Repository/SP4-Notification-Manager

Repository files navigation

[i3-market] Notification Manager & Alert Subscription

This service integrates both the service of subscribing users to i3m offering categories to receive alerts (notifications) when an offer to which they are subscribed is created, also the creation, storage, modification and deletion of notifications.

More info about API here:

Getting stated / Use

This service is developed in python using the Apiflask library to automatically generate the documentation for the API methods.

The docker deployment is done using gunicorn. For more information on how to create the image see dockerfile

To use this service, clone the repository, edit de env variables:

cp env-example .env
nano .env

It is also possible to run the service by setting environment variables within the docker-compose file.

After that, then run the main.py file inside the src folder or deploy it using docker as explained in the following section and access the Swagger interface via web browser: http://localhost:10010

Environment variables

FLASK_PORT: This port is specified to test methods locally through Swagger.

NM_NODE1: Node 1 where the service is deployed, example:http://localhost:10010

NM_NODE2: Node 2 where the service is deployed

NM_NODE3: Node 3 where the service is deployed

How to deploy it

To deploy the service we can do it using the previously created image (registry.hopu.eu/i3-market/notification-manager) or create our own.

To build a new image we use the docker docker build command from the root of this repository where the Dockerfile is located.

docker build -t test_repository:notification_manager:0.1 .

Once the image is built we can deploy it simply by using the docker run command or by using docker-compose, there is an example of a docker-compose.yml file

version: "3.2"
services:
  notification-manager:
    image: registry.hopu.eu/i3-market/notification-manager:v1.0
    ports:
      - 10010:10010
    environment:
      - WEB_UI=http://192.168.1.48:10010
      - FLASK_PORT=10010
      - NM_NODE1=http://localhost:10010
      - NM_NODE2=http://localhost:10010
      - NM_NODE3=http://localhost:10010
    volumes:
      - ./data/:/app/data

Testing

Tests are under Test folder, you can also execute the run_tests.sh file to run all the tests.

Known Issues

The execution of the tests sometimes fails, in case of failure run again.

The cause is currently unknown but we are aware of it.

Credits

Contributing

Pull requests are always appreciated.

License

You can find the licence here

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages