Skip to content

devansh193/better-uptime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Better Uptime

A comprehensive uptime monitoring system built with modern web technologies. Monitor your websites, APIs, servers, and infrastructure with real-time alerts and detailed analytics.

Untitled-2025-04-08-2109 excalidraw

🚀 Features

🔍 Multi-Type Monitoring

  • HTTP/HTTPS Monitoring - Monitor websites and APIs with custom headers, JSON path validation, and TLS error handling
  • Ping Monitoring - Network connectivity monitoring with packet loss and response time tracking
  • Port Monitoring - Check if specific ports are open and responding
  • Page Speed Monitoring - Performance monitoring for web pages
  • Docker Container Monitoring - Container health and status monitoring

🎯 Core Capabilities

  • Real-time Monitoring - Continuous monitoring with customizable intervals (default: 5 minutes)
  • Smart Alerting - Configurable alert thresholds with intelligent notification system
  • Uptime Analytics - Detailed uptime percentage tracking and historical data
  • User Authentication - Secure Google OAuth integration with session management
  • Modern UI - Beautiful, responsive interface with dark/light theme support

🛠️ Technical Features

  • Background Job Processing - Redis-powered queue system for scalable monitoring
  • Database Migrations - Automated database schema management with Drizzle ORM
  • Type Safety - Full TypeScript support across the entire stack
  • API-First Design - tRPC-powered type-safe API layer
  • Responsive Design - Mobile-first UI built with Tailwind CSS and Radix UI

🏗️ Architecture

This is a monorepo built with Turborepo containing three main applications:

my-better-t-app/
├── apps/
│   ├── server/     # Backend API server (Hono + tRPC)
│   ├── web/        # Frontend web application (Next.js)
│   └── worker/     # Background job processor (BullMQ)
└── packages/       # Shared packages and utilities

📦 Technology Stack

Backend (apps/server)

  • Runtime: Bun
  • Framework: Hono.js
  • API: tRPC for type-safe APIs
  • Database: PostgreSQL with Drizzle ORM
  • Authentication: Better Auth with Google OAuth
  • Job Queue: Redis with BullMQ
  • Validation: Zod schemas

Frontend (apps/web)

  • Framework: Next.js 15 with App Router
  • UI Components: Radix UI + Tailwind CSS
  • State Management: TanStack Query (React Query)
  • Forms: React Hook Form with Zod validation
  • Charts: Recharts for analytics visualization
  • Theming: Next Themes with dark/light mode

Worker (apps/worker)

  • Runtime: Bun
  • Queue Processing: BullMQ workers
  • Monitoring Services: HTTP, Ping, Port, and Docker monitoring
  • Data Storage: MongoDB for results, Redis for job queue

🚀 Getting Started

Prerequisites

  • Node.js 18+ or Bun 1.2+
  • PostgreSQL database
  • Redis server
  • MongoDB (for monitoring results)
  • Google OAuth credentials (for authentication)

Environment Setup

  1. Clone the repository

    git clone <repository-url>
    cd my-better-t-app
  2. Install dependencies

    bun install
  3. Environment Configuration

    Create .env files in each app directory:

    apps/server/.env

    # Database
    DATABASE_URL="postgresql://username:password@localhost:5432/better_uptime"
    
    # Redis
    REDIS_URL="redis://localhost:6379"
    
    # MongoDB
    MONGODB_URI="mongodb://localhost:27017/better_uptime"
    
    # Authentication
    GOOGLE_CLIENT_ID="your-google-client-id"
    GOOGLE_CLIENT_SECRET="your-google-client-secret"
    GOOGLE_REDIRECT_URI="http://localhost:3000/api/auth/callback/google"
    
    # CORS
    CORS_ORIGIN="http://localhost:3001"

    apps/web/.env.local

    NEXT_PUBLIC_API_URL="http://localhost:3000"

    Create .env files in each app directory:

    apps/worker/.env

    # Redis
    REDIS_URL="redis://localhost:6379"
    
    # MongoDB
    MONGODB_URI="mongodb://localhost:27017/better_uptime"

Development

Start all applications in development mode:

# Start all services
bun dev

# Or start individual services
bun dev:server    # Backend API (port 3000)
bun dev:web       # Frontend (port 3001)
bun dev:worker    # Background worker

Production Build

# Build all applications
bun build

# Start production servers
bun start

🛠️ Development

Project Structure

apps/server/src/
├── db/
│   ├── schema/          # Database schemas
│   └── migrations/      # Database migrations
├── lib/                 # Shared utilities
├── trpc/               # API routes and procedures
├── scheduler/          # Job scheduling logic
└── types.ts            # TypeScript definitions

apps/web/src/
├── app/                # Next.js App Router pages
├── components/         # Reusable UI components
├── modules/           # Feature-specific components
├── lib/               # Client-side utilities
└── hooks/             # Custom React hooks

apps/worker/src/
├── service/           # Monitoring service implementations
├── repository/        # Data access layer
└── lib/              # Worker utilities

Built with ❤️ using modern web technologies for reliable uptime monitoring.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published