A lightweight, self-hosted monitoring tool for tracking the uptime and performance of your web services. Built with Go and React, it's designed to run on your own infrastructure without any external dependencies.
Uptime Sentinel continuously monitors your websites and APIs by making HTTP requests at regular intervals. For each check, it records the response status code and latency, giving you real-time insight into service health. The dashboard displays all your monitored endpoints with visual status indicators (green for healthy, red for issues) and performance metrics.
Think of it as a simple, no-frills alternative to services like Pingdom or StatusCake, but running entirely on your own server.
- Self-Hosted: Your monitoring data stays on your infrastructure
- Lightweight: Uses SQLite for storage, no complex database setup required
- Simple Setup: One backend binary and a static frontend
- Real-Time Updates: Dashboard auto-refreshes every 10 seconds
- Concurrent Checks: Uses Go routines to check multiple URLs in parallel
Backend:
- Go with standard library
net/http(no heavy frameworks) - SQLite for data persistence
- Structured logging with
slog
Frontend:
- React + TypeScript
- Vite for development and building
- Tailwind CSS for styling
- SWR for API polling
You'll need:
- Go 1.21 or higher
- Node.js 18 or higher
- npm (comes with Node.js)
1. Clone the repository
git clone https://github.com/heyitsmohdd/uptime-sentinel.git
cd uptime-sentinel2. Install Go dependencies
go mod download3. Install frontend dependencies
cd web
npm install
cd ..Option 1: Development Mode
Start the backend server:
go run cmd/server/main.goThe API will be available at http://localhost:8080.
In a separate terminal, start the frontend:
cd web
npm run devThe dashboard will open at http://localhost:5173.
Option 2: Production Build
Build the backend:
go build -o uptime-server cmd/server/main.go
./uptime-serverBuild the frontend:
cd web
npm run buildThe production files will be in web/dist/. Serve them with any static file server.
Once both servers are running, open http://localhost:5173 in your browser.
Adding a monitor:
- Enter a URL in the "Add New Monitor" section
- Click "Add Monitor"
- The system will start checking that URL every 60 seconds
Viewing status:
- Green badge = HTTP 200-299 (healthy)
- Red badge = Any other status or timeout
- Latency is shown in milliseconds
Returns the latest check results for all monitored URLs.
Example response:
[
{
"id": 1,
"url": "https://example.com",
"status_code": 200,
"latency": 142,
"created_at": "2024-01-18T00:00:00Z"
}
]Adds a new URL to the monitoring list.
Request body:
{
"url": "https://yoursite.com"
}Response:
{
"status": "added"
}uptime-sentinel/
├── cmd/server/ # Main entry point for the HTTP server
├── internal/
│ ├── db/ # Database layer (SQLite operations)
│ └── monitor/ # Monitoring service (polling logic)
├── web/ # React frontend
│ └── src/
│ └── components/ # UI components
├── go.mod # Go dependencies
└── README.md
Backend Flow:
- On startup, the monitor service loads any existing URLs from the database
- A ticker fires every 60 seconds to trigger checks
- For each URL, a goroutine makes an HTTP request with a 10-second timeout
- Results (status code, latency) are saved to SQLite
- The API serves the latest check for each URL
Frontend Flow:
- Dashboard fetches
/api/statusevery 10 seconds using SWR - Results are displayed in a responsive grid
- Users can add new URLs via a form that POSTs to
/api/monitor
By default:
- Backend runs on port
8080 - Frontend dev server runs on port
5173 - Check interval is
60 seconds - HTTP timeout is
10 seconds
To change these, modify the constants in the respective files:
- Backend:
cmd/server/main.goandinternal/monitor/service.go - Frontend:
web/vite.config.tsandweb/src/App.tsx
All check results are stored in an SQLite database file (uptime.db) created in the directory where you run the server. The schema includes:
id: Auto-incrementing primary keyurl: The monitored endpointstatus_code: HTTP response statuslatency: Response time in millisecondscreated_at: Timestamp of the check
This is a straightforward project built with standard tools. If you find bugs or want to add features, feel free to open issues or submit pull requests.
MIT License - feel free to use this in your own projects.
- Historical uptime graphs
- Email/Slack notifications on downtime
- Configurable check intervals per URL
- Multi-user authentication
- Export data to CSV or JSON