Giter Club home page Giter Club logo

birthday-notif's Introduction

Birthday Notif

Birthday Notif is an application to send birthday notification to the user at 9 am on their local time.

Design

The API server using Express.

The API consist of:

  • GET /user -- to show all users (without paginate).

  • POST /user -- to add user, with following body as example:

    {
        "firstName": "Timber",
        "lastName": "Lake",
        "birthday": "1990-05-10",
        "timezone": "Asia/Singapore"
    }

    firstName should be exists, birthday format is YYYY-MM-DD, and timezone is to store current user location's timezone. Additionally it also create task to schedule nontification based on current year and birthday month and current user timezoe. If birthday this year already passed, it will create for the next year.

  • DELETE /user/:id -- to remove user.

  • PUT /user/:id -- to update user with body similar with add user.

    Currently updating birthday and timezone does not effect existing scheduled task.

  • GET /task -- list available task/schedule

  • POST /task/schedule -- hitted by hourly cron to start sending notification for task that already passed and with READY status.

    Additional X-Now: YYYY-MM-DD HH:mm Z header may be use to force some tasks to be processed. This endpoint will collect all READY past tasks and will send email to: [email protected]. If success, the task status will be DONE, and next occurence task (next year) will be created. If failed, it will retry within next randomly 10-30 minutes, until 5 attempts before it status FAIL.

The database ORM using TypeORM with sqlite3 driver.

The Database connsist of:

  • User table, to store user information
  • Task table, to store scheduler information and failed attempts

Development

Install dependency:

$ npm install

Running test:

$ npm run test

Running dev server:

$ npm run dev

birthday-notif's People

Contributors

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