GithubHelp home page GithubHelp logo

islamoashraf / uptime-monitoring-api-server Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 75 KB

An uptime monitoring RESTful API service that allows authorized users to monitor URLs and receive detailed reports on their availability, average response time, and total uptime/downtime.

Shell 0.78% JavaScript 99.22%

uptime-monitoring-api-server's Introduction

Backend Assessment

Build an uptime monitoring RESTful API server that allows authenticated users to monitor URLs, and get detailed uptime reports about their availability, average response time, and total uptime/downtime.

Overview

  • Signup with email verification.
  • CRUD operations for URL checks (GET, PUT and DELETE can be called only by the user user who created the check).
  • Authenticated users can receive a notification whenever one of their URLs goes down or up again:
    • Email.
    • Webhook (optional).
  • Authenticated users can get detailed uptime reports about their URLs availability, average response time, and total uptime/downtime.
  • Authenticated users can group their checks by tags and get reports by tag.

Acceptance Criteria

  • APIs should be consuming and producing application/json.
  • Authenication should be stateless.
  • Each URL check may have the following options:
    • name: The name of the check.
    • url: The URL to be monitored.
    • protocol: The resource protocol name HTTP, HTTPS, or TCP.
    • path: A specific path to be monitored (optional).
    • port: The server port number (optional).
    • webhook: A webhook URL to receive a notification on (optional).
    • timeout (defaults to 5 seconds): The timeout of the polling request (optional).
    • interval (defaults to 10 minutes): The time interval for polling requests (optional).
    • threshold (defaults to 1 failure): The threshold of failed requests that will create an alert (optional).
    • authentication: An HTTP authentication header, with the Basic scheme, to be sent with the polling request (optional).
      • authentication.username
      • authentication.password
    • httpHeaders: A list of key/value pairs custom HTTP headers to be sent with the polling request (optional).
    • assert: The response assertion to be used on the polling response (optional).
      • assert.statusCode: An HTTP status code to be asserted.
    • tags: A list of the check tags (optional).
    • ignoreSSL: A flag to ignore broken/expired SSL certificates in case of using the HTTPS protocol.
  • Each report may have the following information:
    • status: The current status of the URL.
    • availability: A percentage of the URL availability.
    • outages: The total number of URL downtimes.
    • downtime: The total time, in seconds, of the URL downtime.
    • uptime: The total time, in seconds, of the URL uptime.
    • responseTime: The average response time for the URL.
    • history: Timestamped logs of the polling requests.

Evaluation Criteria

  • Code quality.
  • Code scalability as we should be able to add a new alerting notification channel like Slack, Firebase, SMS, etc.. with the minimum possible changes.
  • Unit tests.

Bonus

  • API documentation.
  • Docker and Docker Compose.
  • Pushover integration to receive alerts on mobile devices.

Try your best to implement as much as you can from the given requirements and feel free to add more if you want to.

uptime-monitoring-api-server's People

Contributors

islamoashraf avatar mohllal avatar

Watchers

 avatar

uptime-monitoring-api-server's Issues

refactor main function

A main function that invoked intervalley based on the server setup, once it invoked it'll generate a full report and start monitoring the specified URL.

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.