Code Monkey home page Code Monkey logo

igp-iw's Introduction

IGP iw

Running/usage

To run everything needed for the application, run this in the root of the repository

docker-compose up -d

This builds the API service, the notifications service and runs Postgres and Kafka. To be able to send emails edit docker-compose and set these environment variables with eg. Mailtrap plain credentials

SMTP_HOST: enterHost
SMTP_PORT: 587
SMTP_USERNAME: smtppw
SMTP_PASSWORD: smtpu

API

API service provides the following endpoints:


POST /register

{
  email: string,
  password: string
}

GET /verify/:email/:code


POST /login

{
  email: string,
  password: string
}

GET /protected


Features

  • Email verification using notification service with notification sent over Kafka. After registration another email notification is sent- Welcome email
  • Auth using JWT and a test endpoint /protected that is protected route and checks JWT provided in the header

Notifications

Notification service accepts messages over a Kafka topic (any MQ or Pubsub can be implemented) and in a consumer group processes these notifications. Currently Email notification is implemented and SMS notifications mocked. Any new notification type processor can be implemented.

Features

  • Simple SMTP u/p based auth email service
  • Compilation of HTML templates that are sent in the mail
  • Horizontally scalable with the Kafka consumer group

Further improvements

  • Unit tests are not written at this time, but the code is written with tests in mind and everything should be easily testable.
  • Notifications are currently written as one notification type per Kafka message. Ability to send the same notification over multiple processors can be added. For instance: -> User preferences set to receive notifications over both Email and SMS. -> Produce a notification (eg. Welcome message with additional metadata in the message being First name and Last name) -> Notification is sent as only one Kafka message alongside user preferences -> Both SMS and email is sent
  • While notifications being in another service brings operational complexity and need for orchestration of the services. On the other hand it brings us the ability to separately scale/deploy the service and persist the notification messages with using Kafka

igp-iw's People

Contributors

fabijanzulj avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.