Giter Site home page Giter Site logo

notification-service's Introduction

Rate-Limited Notification Service

This project shows an implementation of a Rate-limited notification service. It was developed using a local cache and has no persistence for the rate limit rules. Please do not use it in Production since it was only created as an MVP.

Running the project can be done as described below.

Using dotnet command

Pre-reqs:
- dotnet 8 installed

If you have dotnet 8 installed on your machine, you can just run dotnet run --project src/notification/api/Notification.Api.csproj command. And, it will run the project. Swagger can be found on http://localhost:5281/swagger/index.html.

Using MakeFile

Pre-reqs:
- make installed
- dotnet 8 installed

A Makefile was created to make it easy to run locally. If you have dotnet 8 installed on your machine, you can just run make run-api command. And, it will run the project. Swagger can be found on http://localhost:5281/swagger/index.html.

Using docker

Pre-reqs:
- docker installed

To run using docker you have to follow the following steps:

Build docker image

You can run using docker build . -t <you choose the name>.

Running the image

To run the image please use docker run -d -p <you choose a port number>:80 -e ASPNETCORE_ENVIRONMENT=Development <your image chosen name>. After that, you can find swagger on the following route http://localhost:<chosen port number>/swagger/index.html. A docker port can be either 80 if it is not being used in your machine or another you want, since it's available.

!! Important Note

In order to help customers to write expiration time expression easily, it has a time expression parser. Expiration time expression should be written as describred below:

  • 1 hour -> "1h"
  • 1 hour and 30 minutes -> "1h:30m"
  • 2 days and 2 hours -> "2d:2h"

Time Symbols:

  • Days -> d
  • hours -> h
  • minutes -> m
  • seconds -> s

Example with every symbol: "1d:2h:30m:14s"

Note that the time expression should not contain a repeated identifier. Otherwise it will not be able to register the rule.

notification-service's People

Contributors

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