Skip to content

hakimj96/paypulse

Repository files navigation

PayPulse

A comprehensive uptime monitoring and incident management platform built with Laravel 12. Monitor your websites, APIs, and services with real-time alerts, beautiful status pages, and detailed analytics.

Features

Core Monitoring

  • Multi-Protocol Monitoring - HTTP/HTTPS, TCP/UDP ports, DNS records, SSL certificates, and ping checks
  • Flexible Check Intervals - Configure monitoring intervals from 1 minute to 24 hours
  • Response Assertions - Validate response status codes, body content, headers, and response times
  • SSL Certificate Monitoring - Track certificate expiration with configurable warning thresholds

Alerting & Notifications

  • Multiple Alert Channels - Email, Slack, Discord, Microsoft Teams, Telegram, PagerDuty, and webhooks
  • Alert Policies - Create custom escalation policies with configurable thresholds
  • Smart Alerting - Avoid alert fatigue with confirmation checks before triggering incidents

Incident Management

  • Automatic Incident Creation - Incidents are created automatically when monitors fail
  • Incident Timeline - Track all updates and status changes throughout an incident's lifecycle
  • Manual Incidents - Create manual incidents for maintenance or planned outages

Status Pages

  • Public Status Pages - Beautiful, customizable public-facing status pages
  • Custom Domains - Use your own domain for status pages
  • Component Groups - Organize monitors into logical groups
  • Subscriber Notifications - Allow users to subscribe for incident updates

Analytics & Reporting

  • Uptime Statistics - Track uptime percentage over various time periods
  • Response Time Metrics - Monitor performance trends with detailed charts
  • Scheduled Reports - Automated daily, weekly, or monthly reports via email
  • Export Capabilities - Export data for further analysis

Administration

  • Multi-Tenant Architecture - Organizations with team member management
  • Role-Based Access - Admin and member roles with appropriate permissions
  • Subscription Plans - Built-in billing and plan management
  • Audit Logging - Track all system changes for compliance

Tech Stack

  • Framework: Laravel 12
  • Frontend: Livewire 3, Alpine.js, Tailwind CSS 4
  • Database: MySQL/PostgreSQL/SQLite
  • Queue: Laravel Horizon with Redis
  • Search: Laravel Scout with Meilisearch
  • Real-time: Laravel Echo with Pusher/Soketi

Requirements

  • PHP 8.2+
  • Composer
  • Node.js 18+ & NPM
  • MySQL 8.0+ / PostgreSQL 14+ / SQLite
  • Redis (recommended for queues and caching)
  • Meilisearch (optional, for search functionality)

Installation

1. Clone the Repository

git clone https://github.com/yourusername/paypulse.git
cd paypulse

2. Quick Setup

Run the setup script which handles everything automatically:

composer setup

This command will:

  • Install PHP dependencies
  • Create .env file from example
  • Generate application key
  • Run database migrations
  • Install NPM dependencies
  • Build frontend assets

3. Manual Setup (Alternative)

If you prefer manual installation:

# Install PHP dependencies
composer install

# Copy environment file
cp .env.example .env

# Generate application key
php artisan key:generate

# Configure your database in .env, then run migrations
php artisan migrate

# Install and build frontend assets
npm install
npm run build

4. Configure Environment

Edit your .env file with appropriate values:

APP_NAME=PayPulse
APP_URL=http://localhost

# Database
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=paypulse
DB_USERNAME=root
DB_PASSWORD=

# Queue (recommended: redis)
QUEUE_CONNECTION=redis
REDIS_HOST=127.0.0.1

# Mail Configuration
MAIL_MAILER=smtp
MAIL_HOST=smtp.example.com
MAIL_PORT=587
MAIL_USERNAME=your-username
MAIL_PASSWORD=your-password
MAIL_FROM_ADDRESS=alerts@yourdomain.com

# Optional: Real-time Updates
BROADCAST_CONNECTION=pusher
PUSHER_APP_ID=your-app-id
PUSHER_APP_KEY=your-app-key
PUSHER_APP_SECRET=your-app-secret

5. Create Admin User

php artisan tinker
$org = \App\Models\Organization::create(['name' => 'Your Company']);
\App\Models\User::create([
    'name' => 'Admin',
    'email' => 'admin@example.com',
    'password' => bcrypt('password'),
    'organization_id' => $org->id,
    'role' => 'admin',
    'email_verified_at' => now(),
]);

Running the Application

Development

Start all services concurrently with a single command:

composer dev

This starts:

  • Laravel development server
  • Queue worker
  • Log viewer (Pail)
  • Vite dev server

Access the application at http://localhost:8000

Production

# Build assets for production
npm run build

# Optimize Laravel
php artisan optimize

# Start queue workers (use Supervisor or Horizon)
php artisan horizon

Scheduled Tasks

PayPulse uses Laravel's scheduler for automated tasks. Add this cron entry to your server:

* * * * * cd /path-to-paypulse && php artisan schedule:run >> /dev/null 2>&1

Scheduled Commands

Command Schedule Description
monitors:check Every minute Runs all due monitor checks
stats:aggregate Daily at 00:15 Aggregates daily statistics
data:purge Weekly (Sunday 3 AM) Purges old monitoring data
horizon:snapshot Every 5 minutes Captures Horizon metrics
queue:retry all Daily at 04:00 Retries failed jobs
queue:prune-failed Daily Removes old failed jobs
reports:send Every minute Sends scheduled reports

API Documentation

PayPulse provides a RESTful API for programmatic access. Full documentation is available at /docs/api when logged in.

Authentication

All API requests require a Bearer token:

curl -H "Authorization: Bearer YOUR_API_TOKEN" \
     https://your-domain.com/api/v1/monitors

Key Endpoints

  • GET /api/v1/monitors - List all monitors
  • POST /api/v1/monitors - Create a new monitor
  • GET /api/v1/monitors/{id} - Get monitor details
  • PUT /api/v1/monitors/{id} - Update a monitor
  • DELETE /api/v1/monitors/{id} - Delete a monitor
  • GET /api/v1/incidents - List incidents
  • GET /api/v1/status - Get current system status

Project Structure

paypulse/
├── app/
│   ├── Console/Commands/     # Artisan commands
│   ├── Http/Controllers/     # HTTP controllers
│   ├── Jobs/                 # Queue jobs
│   ├── Livewire/            # Livewire components
│   ├── Models/              # Eloquent models
│   ├── Notifications/       # Notification classes
│   └── Services/            # Business logic services
├── config/                  # Configuration files
├── database/
│   ├── migrations/          # Database migrations
│   └── seeders/            # Database seeders
├── resources/
│   ├── css/                # Stylesheets
│   ├── js/                 # JavaScript files
│   └── views/              # Blade templates
├── routes/
│   ├── api.php             # API routes
│   ├── console.php         # Scheduled tasks
│   └── web.php             # Web routes
└── tests/                  # Test files

Key Models

Model Description
Organization Multi-tenant organization
User User accounts
Monitor Uptime monitors
MonitorCheck Individual check results
Incident Incident records
AlertChannel Notification channels
AlertPolicy Escalation policies
StatusPage Public status pages
ScheduledReport Automated reports

Testing

# Run all tests
composer test

# Or directly with artisan
php artisan test

# Run with coverage
php artisan test --coverage

Queue Workers

For production, use Laravel Horizon with Redis:

php artisan horizon

Or use Supervisor to manage queue workers:

[program:paypulse-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /path-to-paypulse/artisan queue:work --queue=alerts,monitors,default --sleep=3 --tries=3
autostart=true
autorestart=true
numprocs=4
redirect_stderr=true
stdout_logfile=/path-to-paypulse/storage/logs/worker.log

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Security

If you discover a security vulnerability, please send an email to security@yourdomain.com. All security vulnerabilities will be promptly addressed.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Simple Website API Tracker

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages