Skip to content

โฑ๏ธ Uptime Sentinel: REST API delivering customizable uptime monitoring & powerful stats ๐Ÿ“ˆ

Notifications You must be signed in to change notification settings

rixtrayker/uptime-monitoring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

49 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ Uptime Monitoring API

Node.js Express.js PostgreSQL Docker Swagger

A robust RESTful API service that enables authenticated users to monitor URLs and receive comprehensive uptime reports including availability metrics, response times, and uptime/downtime statistics.

โœจ Features

  • User Authentication: Secure JWT-based authentication system
  • URL Monitoring: Track the status of multiple endpoints simultaneously
  • Detailed Reports: Get insights on:
    • Availability percentage
    • Average response time
    • Total uptime/downtime
    • Historical performance data
  • API Documentation: Complete Swagger documentation
  • Scalable Architecture: Designed for horizontal scaling

๐Ÿ› ๏ธ Tech Stack

  • Backend: Node.js with Express.js
  • Database: PostgreSQL with JSONB support
  • ORM: Knex.js with Objection.js
  • Authentication: JWT (JSON Web Tokens)
  • Documentation: Swagger
  • Testing: Jest
  • Monitoring Engine: Custom-forked ping-monitor package
  • Containerization: Docker

๐Ÿšฆ Getting Started

Prerequisites

  • Node.js (v14+)
  • PostgreSQL
  • Docker (optional)

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd uptime-monitoring
  2. Install dependencies:

    npm install
  3. Set up environment variables:

    cp .env.example .env
    # Edit .env with your configuration
  4. Run database migrations:

    npx knex migrate:latest
  5. Start the server:

    npm start

The API will be available at http://localhost:<PORT> (default: 3000)

๐Ÿ“Š API Documentation

Once the server is running, access the Swagger documentation at:

http://localhost:<PORT>/api-docs

๐Ÿงช Testing

Run the test suite:

npm test

๐Ÿ” Project Insights

Key Implementations

  • Custom Fork: Enhanced the ping-monitor package to meet project requirements
  • Cursor Pagination: Implemented efficient data retrieval for large datasets
  • Event-Driven Architecture: Leveraged Node.js events for asynchronous monitoring
  • JSONB Optimization: Utilized PostgreSQL's JSONB capabilities for flexible data storage

Learning Outcomes

  • Deep dive into Node.js ecosystem and best practices
  • Swagger API documentation implementation
  • Advanced PostgreSQL features including JSONB types and indexing
  • Package forking and contribution workflow
  • Asynchronous programming patterns in Node.js
  • Comparative analysis between Node.js and other backend technologies (PHP, Go)

๐Ÿ”ฎ Future Enhancements

  • TypeScript migration for improved type safety
  • Dependency injection pattern implementation
  • Enhanced error handling with stack traces
  • Comprehensive logging system
  • Kubernetes deployment for auto-scaling
  • Distributed monitoring architecture for large-scale operations
  • Expanded test coverage with integration and load testing
  • ACL implementation with objection-authorize
  • Code refactoring for improved abstraction

๐Ÿงฐ Previous Node.js Experience

  • Custom JWT implementation (2 years ago)
  • Basic CRUD applications (3 years ago)
  • Next.js and Vue.js tutorials (3 years ago)

This project was developed as part of a backend assessment, demonstrating proficiency in building scalable monitoring solutions with Node.js.

About

โฑ๏ธ Uptime Sentinel: REST API delivering customizable uptime monitoring & powerful stats ๐Ÿ“ˆ

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published