Giter Club home page Giter Club logo

notification-service's Introduction

Back-End Engineer technical task

What I Do and Why

This application purpose is to send Messages to the Customer over several channels: mail, push notifications and SMS.

I've decided to choose symfony framework as a base, because OTB it provides services such as mailer or messenger, which were crucial for this implementation. Also, I know it quite well, so it was easy for me to spin everything up.

As for architecture I've decided to implement Domain Driven Design and Command Query Responsibility Segregation pattern. Unfortunately this provides quite a bit overhead in case of the amount of code and classes that have to be created, is time-consuming. Nevertheless, I wanted present my skills in this matter even though I was aware that there is not enough time to make it fully work.

Assumptions

There is a Customer entity (in plain PHP as no DB implementation was done) in the system which is registered by email address, so this is the thing that always will be present. Then Customer may add phone number or register the device (this wasn't implemented also) and based on that Notification Service chooses method to deliver the Message.

Trade-offs

SmsNotifier is missing. Application has interface for it, but I didn't have time to proper implement it. Also, implementation of Pushy is very sketchy. I just pasted the code from the docs and tweak it a little just to make it work, but it requires for sure proper implementation.
I wanted application to react on some event in the system and then send notification to the user. Didn't have time to implement an actual event dispatching and subscribing. Also, no database was used to store anything and although Domain is prepared for language adjustments I didn't have time to implement translator in infrastructure layer. Application is prepared to run asynchronously (using redis), but this also wasn't implement.

Not all tests were written.

I've also noticed that in symfony 5.2 they've changed registration of AppExtension which I've always used to provide custom configuration for my applications. I didn't have time to deeply dig into it on how this suppose to be done now. In the past I've simply created AppExtension and Configuration and register Extension in the Kernel. No I saw that Container::registerExtension method is no longer there, so I was unable to provide my custom config. I wanted to use this for switching on and off the channels in NotificationService. For now configuration of channels is not perfect (as done simply on constants) and placed in the NotificationService.

Installation

Requirements:

Make sure all requirements are met in your operating system and accessible in PATH.

File .env.local should contain Postmark API Key and Pushy API Key:

MAILER_DSN=postmark+api://POSTMARK_API_KEY@default
PUSHY_API_KEY=SECRET_API_KEY

Then just run:

make start

notification-service's People

Contributors

kubarocks avatar

Watchers

 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.