/Notification-Service

A very lightweight and powerful notification service

Primary LanguageGoMIT LicenseMIT

# Description
This is a notification service. You can create templates and send notifications using these templates. Currently you can send Push notifications, Email notifications and SMS notifications.
The service is using a database to store all templates and already sent notifications. It's also using RabbitMQ *(OPTIONAL)* to manage heavier loads.

___
# How to start?
### Requirements
If you want to run the application standalone you will need
\- golang

If you want to run the full package you will need
\- docker

### Commands
Run the example docker-compose
```
$ git clone https://github.com/TheDeveloper10/Notification-Service
$ cd ./Notification-Service/example/
$ sudo docker compose up
```

___
# Configuration
You can configure the entire service by cloning `config/service_config_example.yaml` and naming it `config/service_config.yaml`.
This is the primary configuration file - you can setup connections to other services, turn on/off services like HTTP server, RabbitMQ, SMTP client, Push client and perform other configurations.

___
# Used Services
### MySQL
The database is responsible for storing the list of templates and sent notifications. By default the used database is MySQL and you can change that by editing the `scripts/docker/docker-compose.yaml` file and `config/service_config.yaml`. It is being auto-configured by the files in `scripts/sql/`.

### RabbitMQ
RabbitMQ was added because it's a good and stable message queue which can help the service scale better.

### SMTP
This is used for Email Notifications. You can use any SMTP service but in this case the preconfigured one is GMail. You can change the SMTP configuration or turn it off in `config/service_config.yaml`.

### Firebase Cloud Messaging
This is used for Push Notifications. In order to configure it you have to get your private key from the Firebase console and put it in `config/adc_config.json`. You can see an example in `config/adc_config_example.json`. If you want to turn it off you can do that in `config/service_config.yaml`.