Download the PHP package hamzi/corewatch without Composer
On this page you can find all versions of the php package hamzi/corewatch. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hamzi/corewatch
More information about hamzi/corewatch
Files in hamzi/corewatch
Package corewatch
Short Description Production-ready embedded DevOps dashboard for Laravel β server metrics, log streaming, safe ops panel, and alerting without external daemons.
License MIT
Homepage https://github.com/hamdyelbatal122/CoreWatch
Informations about the package corewatch
Laravel CoreWatch π‘οΈ
Embedded DevOps dashboard for Laravel β monitor, debug, and operate your server without leaving your app
Quick Start Β· Why CoreWatch? Β· Developer API Β· Architecture Β· Filament Β· Troubleshooting
[!IMPORTANT] CoreWatch is a zero-dependency, self-contained server monitoring utility built for production Laravel systems. No Netdata, no Grafana agent, no external daemon β just
composer requireand you have a full DevOps terminal inside your admin panel.
π€ Why CoreWatch?
| Problem | CoreWatch Solution |
|---|---|
| "I need server metrics but don't want another daemon" | Reads /proc directly β zero external processes |
| "Log files are 5GB and crash my log viewer" | O(1) memory backward-seeking parser streams any file size |
| "I'm afraid of RCE in admin panels" | Whitelisted command keys only β no raw shell input |
| "I use Filament/Nova and need embedded monitoring" | Livewire component + modular Blade partials |
| "I need alerts when CPU/RAM spikes" | Scheduled sentinel with Slack, Telegram, or custom events |
| "Load balancer needs a health endpoint" | GET /corewatch/api/health returns 200/503 |
CoreWatch vs. Alternatives
| Feature | CoreWatch | Netdata | Laravel Telescope | Grafana Agent |
|---|---|---|---|---|
| Zero external daemon | β | β | β | β |
| Server metrics (CPU/RAM/Disk) | β | β | β | β |
| Log file streaming | β | β | β | β |
| Safe ops panel | β | β | β | β |
| Laravel-native install | β | β | β | β |
| Filament/Livewire embed | β | β | β | β |
| Built-in alerting | β | β | β | β |
β‘ Quick Start (30 seconds)
Open /corewatch in your browser. That's it.
For production, add auth middleware in config/corewatch.php and schedule health checks:
πΊοΈ System Architecture Flowchart
The following diagram illustrates how CoreWatch isolates data collection, streams log buffers, routes controller requests, and schedules alerting triggers:
ποΈ Package Architecture (Clean Architecture)
CoreWatch follows layered architecture with clear separation of concerns:
| Layer | Responsibility | Example |
|---|---|---|
| Contracts | Define abstractions | SystemMetricsCollectorInterface |
| Domain | Pure business logic | HealthThresholdEvaluator |
| Application | Orchestrate use cases | GetServerMetricsAction |
| Infrastructure | External I/O | LogFileRepository, CpuMetricsCollector |
| Http | HTTP boundary | DashboardController (thin) |
π§± Modular @include Partial Architecture
CoreWatch separates all diagnostics into elegant, self-contained monospace tables inside resources/views/partials/. This modular structure allows clients to easily publish views and include specific tables anywhere inside their custom dashboards:
| Partial Blade View Path | Diagnostic Target | Layout Display Style | Customization Purpose |
|---|---|---|---|
partials.cpu |
CPU Cores & Load averages | Monospace UNIX Table | Monitor core load thresholds (1M, 5M, 15M) |
partials.ram |
Physical Memory (RAM) Allocation | Monospace Memory Table | Track active, free, and cached allocation bytes |
partials.disk |
Disk Storage Saturated Volumes | Saturated Space Table | Monitor root storage partition size limits |
partials.processes |
Active CPU Top Linux Processes | Live CLI System Table | Identify high CPU usage processes (PID, User) |
partials.database |
Database Engine & Schema size | Monospace DB Status Table | Track table counts and database file sizes |
partials.app-checks |
Operational Application Integrity | Status Indicator List | Verify Cache, Queue, and Security modes |
partials.specifications |
OS Kernel & Laravel specifications | Static Specs Table | Quick access to PHP, OS, and server version info |
partials.services |
Whitelisted system task controls | Command Action Table | Safe execution of authorized terminal commands |
partials.logs |
Live chunked stream terminal view | Cyberpunk Log Console | View and filter real-time logs with pagination |
β‘ Key Highlights
- Stealthy & Dynamic UI: Self-contained Blade views styled with a premium Cyberpunk DevOps dark theme. Uses lightweight Tailwind CSS & AlpineJS for dynamic reactivity without bundler dependencies.
- Zero-overhead Log Viewer: An advanced, memory-efficient backward-seeking chunked file parser that streams Laravel/Nginx/Apache logs without memory exhaustion even on multi-gigabyte files.
- Advanced System Diagnostics: Native
/procfilesystem parsing coupled with fast system command fallbacks to deliver instant CPU, RAM, Disk, and system uptime metrics. - Pre-Whitelisted Services Controller: Safe administrative triggers (e.g. queue restart, redis flush, cache clearing) mapping to strict command keys preventing arbitrary RCE vulnerabilities.
- Top Active CPU Processes: Live sorted process statistics terminal displaying CPU load, RAM allocation, PID, user, and running commands on Linux hosts.
- Database Telemetry Widget: Direct schema capacity details, connection indicators, and tables count monitoring for MySQL, PostgreSQL, and SQLite database connection engines.
- App Integrity Checks: Automated operational verification for Cache drivers, Artisan Queue connections, Environment status, and Security debug mode states.
- Livewire Embed Support: Built-in dynamic Livewire component (
livewire:corewatch-dashboard) for drag-and-drop embedding inside administrative panels like Filament and Laravel Nova. - Continuous Sentinel Daemon: Scheduled console monitor (
corewatch:check-health) that alerts your DevOps channels (Slack & Telegram) when resource thresholds are breached. - Developer Facade API:
CoreWatch::metrics(),CoreWatch::health(), andThresholdBreachedevents for custom integrations. - One-Command Install:
php artisan corewatch:installpublishes config and prints your production checklist. - Health Probe Endpoint:
GET /corewatch/api/healthfor uptime monitors, load balancers, and Kubernetes liveness probes.
π οΈ Installation & Setup
Production Install (Packagist)
Publish Views (Optional β for customization)
Local Development (Path Repository)
π Flexible Dashboard Integration Options
CoreWatch is designed to fit seamlessly wherever your administration operations are managed:
[!TIP] Make sure to wrap any custom page elements that use these modular tables inside the parent AlpineJS data controller:
<div x-data="corewatchDashboard()">...</div>.
Option A: Standalone Routed View
Once active, navigate directly to /corewatch to view the comprehensive Cyberpunk DevOps terminal.
Option B: Modular Table Includes
Publish the views and embed specific partial views inside your existing administrative panels:
Option C: Blade Custom Component Embeds
Embed the full dashboard seamlessly:
Option D: Livewire Drag-and-Drop
Embed the Livewire component in Filament dashboards or custom panels:
βοΈ Threshold Sentinel alerts Alerting
Enable real-time warnings on Slack or Telegram by configuring your host .env:
Register heartbeat and health checks in routes/console.php:
π¨βπ» Developer API (Programmatic Access)
CoreWatch exposes a Facade and Manager for use in your own code, jobs, and custom admin panels:
Health Endpoint (Uptime Monitors / K8s Probes)
Returns 200 when healthy, 503 when thresholds are breached. Configure in .env:
Prometheus (Grafana / Monitoring)
Arabic Localization
Publish translations: php artisan vendor:publish --tag=corewatch-lang
Custom Alert Channels (Events)
Hook into threshold breaches in your AppServiceProvider:
| Guide | Description |
|---|---|
| Architecture | Layer diagram, data flow, and extension guide |
| Filament Integration | Embed in Filament admin panels |
| Troubleshooting | Common issues and fixes |
| Deployment | Production checklist |
| Contributing | Development workflow and coding standards |
| Security | Vulnerability reporting policy |
π Security Practices & Fallbacks
- RCE Protection: CoreWatch never accepts raw input strings to execute shell commands. It maps requests to rigid keys registered in
config/corewatch.phpand blocks any unauthorized requests. - Memory Safety: The Log Parser uses direct
fseekbackward seeking to stream logs in 64KB blocks, maintaining a strict $O(1)$ memory consumption profile regardless of log file size. - Graceful Fallbacks: If commands like
execorproc_openare disabled inphp.ini, the package falls back to parsing native/procdirect files and displays interactive notifications.
π License
The MIT License (MIT). Please see License File for more information.