Coder Social home page Coder Social logo

code-challenge-notification's Introduction

General Overview

The applications stack is react using Next.js and MaterialUI, python using FastApi and Celery, PostgreSQL for the database and redis (required by Celery)

The whole application has been containerized and divided into different services that can interact with each other using docker compose.

The way it works is the frontend makes request to the api in order to retrieve the logs or create messages. The messages are then polled every 6 seconds by a Celery worker and processed one by one in order to send the different types of notifications to every user that matches the criteria of the message.

Before starting the application

You need to have docker and docker compose installed

Docker https://docs.docker.com/desktop/

Docker Compose https://docs.docker.com/compose/install/

Initialize containers

After installing the required tools you just have to run the following commands

docker-compose build
docker-compose up 

if you dont want to see the ouput you can just run

docker-compose up -d

Users

By default the application initializes with 3 users, if you want to add more you can use the following route and payload (inside the body of the request) to add more

POST http://127.0.0.1:8000/users
{
    "name": "Mar",
    "email": "[email protected]",
    "phone_number": "988266356",
    "subscribed": ["Sports"],
    "channels": ["email"]
}

or use the swagger in this URL

http://localhost:8000/docs#/

Unit tests

In order to run the python tests youll need to enter the container with this command

docker-compose exec api bash

and once inside the container just run

pytest

code-challenge-notification's People

Contributors

davidfv7 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.