Running Email services locally (in progress) - ita-social-projects/WhatBackend GitHub Wiki

Running Email services locally

Required steps:

  1. Install software
  2. Add .env files
  3. Start project

Install software

Our messaging services run on RabbitMQ message broker and thus following software is required to be installed:

Add .env files

This projects use DotNetEnv library and reads environment variables from .env files.

In order to run them you need to create and place .env files with the following contents into corresponding folders.

  1. Email Render Project: Location: <RepositoryRootFolder>\WhatBackend.EmailRenderService\WhatBackend.EmailRenderService\

Contents:


# do not commit this file to VCS

# Naming rule: if the path to the secret is root/preRoot/secret, then you must write your secret value as root__preRoot__secret (2 underscores)

# dev remote rabitmq connection string

ConnectionStrings__RabbitMQ=host=kangaroo.rmq.cloudamqp.com;virtualHost=[USERNAME];username=[USERNAME];password=[PASSWORD];prefetchcount=1
  1. Email Sending Project: Location: <RepositoryRootFolder>\WhatBackend.EmailSendingService\WhatBackend.EmailSendingService\

Contents:

# do not commit this file to VCS

# Naming rule: if the path to the secret is root/preRoot/secret, then you must write your secret value as root__preRoot__secret (2 underscores)

# dev local mySql connection string

ConnectionStrings__RabbitMQ=host=kangaroo.rmq.cloudamqp.com;virtualHost=[USER];username=[USER];password=[PASSWORD]

# dev local token

AuthOptions__KEY=[KEY]

SendersSettings__email=[EMAIL]

SendersSettings__password=[PASSWORD]

You may replace SendersSettings__email and SendersSettings__password with a valid credentials of your email account with lowered security settings(SMTP requires this to be able to log in).

In case you want to use localhost instead of currently used remote host, replace connection string with ConnectionStrings__RabbitMQ=host=localhost.

NOTE: .env files contain no filename, only extension.

Start project

Make sure your local API and MySQL instances are up and running.

In this step run both 'EmailRenderService` and 'EnailSendingService'.

Currently notification process is used only to notify user of account when:

  • New account is registred.
  • Account's role have been assigned.
  • Account's password is reset.

Try to use any of those commands using Swagger or Postman to ensure services are working correctly.