Skip to content

Altinn platform microservice for handling notifications (mail, sms, etc)

License

Notifications You must be signed in to change notification settings

Altinn/altinn-notifications

Repository files navigation

Altinn Notifications

Altinn platform microservice for handling notifications (mail, sms, etc) This component handles the functionality related to registering and sending notifications.

Project organization

This is a backend WebAPI solution written in .NET / C# following the clean architecture principles. The solution is into four projects, each with their associated test project.

Altinn.Notifications

The API layer that consumes services provided by Altinn.Notifications.Core

Relevant implementations:

  • Controllers
  • Program.cs

Altinn.Notifications.Core

The domain and application layer that implements the business logic of the system.

Relevant implementations:

  • Interfaces for external dependencies implemented by infrastructure and repository layer
  • Domain models
  • Services

Altinn.Notifications.Integrations

The infrastructure layer that implements the interfaces defined in Altinn.Notifications.Core for integrations towards 3rd-party libraries and systems.

Relevant implementations:

  • Kafka producer and consumer implementation
  • Clients for communicating with Altinn Platform components

Altinn.Notifications.Persistance

The persistance layer that implements repository logic.

Getting started

  1. .NET 8.0 SDK
  2. Newest Git
  3. A code editor - we like Visual Studio Code
  4. Podman or another container tool such as Docker Desktop
  5. PostgreSQL
  6. pgAdmin

Setting up PostgreSQL

Ensure that both PostgreSQL and pgAdmin have been installed and start pgAdmin.

In pgAdmin

  • Create database notificationsdb
  • Create the following users with password: Password (see privileges in parentheses)
    • platform_notifications_admin (superuser, canlogin)
    • platform_notifications (canlogin)
  • Create schema notifications in notificationsdb with owner platform_notifications_admin

A more detailed description of the database setup is available in our developer handbook

Cloning the application

Clone Altinn Notifications repo and navigate to the folder.

git clone https://github.com/Altinn/altinn-notifications
cd altinn-notifications

Setting up Kafka broker and visualization

Ensure that Docker has been installed and is running.

In a terminal navigate to the root of this repository and run command podman compose -f setup-kafka.yml up -d

Kafdrop is now available at http://localhost:9000.

Running the application with .NET

The Notifications components can be run locally when developing/debugging. Follow the install steps above if this has not already been done.

  • Navigate to src/Altinn.Notifications, and build and run the code from there, or run the solution using you selected code editor

    cd src/Notifications
    dotnet run

The notifications solution is now available locally at http://localhost:5090/. To access swagger use http://localhost:5090/swagger.

About

Altinn platform microservice for handling notifications (mail, sms, etc)

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages