Skip to content

mrfr8nk/Zero-Ping

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

65 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

⚑ Zero Ping Uptime Monitor

Keep Your Services Alive 24/7

License: MIT Node.js MongoDB React

A full-stack uptime monitoring service that automatically pings your services to keep them alive. Built with modern web technologies for maximum reliability.

Features β€’ Tech Stack β€’ Installation β€’ Deployment β€’ API


✨ Features

  • 🌐 Unlimited Services - Add as many services as you need
  • ⏰ Custom Intervals - Configure ping intervals from 1-30 minutes
  • πŸ“Š Real-time Monitoring - Live status updates every 10 seconds
  • ⚑ Response Time Tracking - Monitor service performance
  • πŸ“ˆ Uptime Percentage - Track service reliability
  • πŸ”„ Auto-Ping System - Automatic pinging every minute
  • ⏸️ Pause/Resume - Control services without deletion
  • πŸ’Ύ MongoDB Integration - Persistent data storage
  • 🎨 Beautiful UI - Modern, responsive design with dark mode
  • πŸ“± Mobile Friendly - Works seamlessly on all devices

πŸ› οΈ Tech Stack

Frontend

Technology Purpose
React UI Framework
Vite Build Tool
TailwindCSS Styling
Axios HTTP Client
Lucide Icons

Backend

Technology Purpose
Node.js Runtime
Express Web Framework
MongoDB Database
Node-Cron Task Scheduler

πŸ“ Project Structure

uptime-monitor/
β”œβ”€β”€ πŸ“‚ backend/          # Node.js/Express API
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ models/      # MongoDB models
β”‚   β”‚   β”œβ”€β”€ routes/      # API routes
β”‚   β”‚   β”œβ”€β”€ jobs/        # Cron jobs for pinging
β”‚   β”‚   └── server.js    # Main server file
β”‚   └── package.json
β”œβ”€β”€ πŸ“‚ frontend/         # React application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   └── App.jsx
β”‚   └── package.json
└── πŸ“„ README.md

πŸš€ Installation

Prerequisites

  • βœ… Node.js 18+ installed
  • βœ… MongoDB Atlas account (or local MongoDB)
  • βœ… Git

Quick Start

  1. Clone the repository
git clone <your-repo-url>
cd uptime-monitor
  1. Backend Setup
cd backend
npm install

Create a .env file in the backend directory:

MONGODB_URI=your_mongodb_connection_string_here
PORT=5000
NODE_ENV=production
  1. Start the Application

From the root directory:

npm run start

This will:

  • βœ… Start the backend server on port 5000
  • βœ… Serve the pre-built frontend files
  • βœ… Your app will be available at http://localhost:5000

For development with hot-reload:

npm run dev

🌐 Deployment

Deploy to Replit (Recommended)

This application is optimized for Replit deployment as a single web service.

Option 1: Using render.yaml (Recommended)

  1. πŸ“€ Push your code to GitHub
  2. πŸ”— Go to Render Dashboard
  3. βž• Click "New +" β†’ "Blueprint"
  4. πŸ”Œ Connect your GitHub repository
  5. 🎯 Render will auto-detect the render.yaml file
  6. πŸ” Add environment variables:
    • MONGODB_URI: Your MongoDB Atlas connection string
  7. βœ… Click "Apply" to deploy

Option 2: Manual Deployment

  1. πŸ“€ Push your code to GitHub
  2. πŸ”— Go to Render Dashboard
  3. βž• Click "New +" β†’ "Web Service"
  4. βš™οΈ Configure:
    • Name: zero-ping-uptime-monitor
    • Environment: Node
    • Build Command:
      npm install && cd frontend && npm install && npm run build && cd ../backend && npm install
    • Start Command:
      cd backend && node src/server.js
    • Environment Variables:
      • MONGODB_URI: Your MongoDB Atlas connection string
      • NODE_ENV: production
      • PORT: 10000
  5. πŸš€ Click "Create Web Service"
  6. ⏳ Wait for deployment to complete
  7. πŸŽ‰ Your app will be live!

How It Works

  • The backend Express server serves both:
    • πŸ”Œ API endpoints at /api/*
    • 🎨 Static frontend files from / (built React app)
  • βœ… All requests handled by a single service on one domain
  • 🚫 No CORS issues or separate domain management needed

πŸ” Environment Variables

Development (Local)

Backend (.env):

MONGODB_URI=your_mongodb_connection_string
PORT=5000
NODE_ENV=production

Production (Render)

Set these in your Render dashboard under Environment tab:

  • MONGODB_URI: Your MongoDB Atlas connection string
  • NODE_ENV: production
  • PORT: 10000 (or your preferred port)

πŸ“‘ API Endpoints

Services

Method Endpoint Description
GET /api/services Get all services
GET /api/services/:id Get single service
POST /api/services Create new service
PUT /api/services/:id Update service
DELETE /api/services/:id Delete service
GET /api/services/:id/stats Get service statistics

Health Check

Method Endpoint Description
GET /api/health API health status

Example: Create Service

POST /api/services
{
  "name": "My Service",
  "url": "https://example.com",
  "interval": 5
}

πŸ’‘ How It Works

  1. πŸ“ Add Services - Enter service name, URL, and ping interval
  2. ⏰ Automatic Pinging - Cron job runs every minute checking which services need pinging
  3. πŸ“Š Status Updates - Each ping updates status (online/offline), response time, and uptime
  4. πŸ”„ Real-time Dashboard - Frontend auto-refreshes every 10 seconds
  5. πŸ’Ύ Persistent Storage - All data stored in MongoDB for persistence

πŸ’‘ Usage Tips

  • ⏱️ Use intervals of 5-15 minutes for most services to avoid rate limiting
  • ⏸️ Services can be paused/resumed without deleting them
  • πŸ“ˆ System tracks last 100 pings for each service
  • 🐌 Monitor response times to identify slow services

πŸ› Troubleshooting

Backend won't start

  • βœ… Check MongoDB connection string is correct
  • βœ… Ensure MongoDB Atlas allows connections from your IP
  • βœ… Verify all dependencies are installed: npm install

Frontend can't connect to backend

  • βœ… Check VITE_API_URL in frontend .env
  • βœ… Ensure backend is running
  • βœ… Check CORS settings in backend

Services not pinging

  • βœ… Check backend logs for errors
  • βœ… Verify the service URL is accessible
  • βœ… Ensure cron job is running (check console logs)

🀝 Contributing

Feel free to submit issues and pull requests!

πŸ“„ License

MIT License - see the LICENSE file for details

πŸ‘¨β€πŸ’» Developer

Built with ❀️ by Mr Frank (Darrell Mucheri)

GitHub WhatsApp Email

πŸ’¬ Support

For issues and questions, please open a GitHub issue or contact the developer directly.


⭐ Star this repo if you find it helpful!

Made with πŸ’™ using React, Node.js & MongoDB

About

An Uptime service created to monitor all your free deployed instances that sleep after inactivity & keep them uptimed 24/7 with ping requests at regular intervals

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors