From 3d41c81a48340b6cc7fbf86047e02dfa487f7277 Mon Sep 17 00:00:00 2001 From: "Fabian @ Blax Software" Date: Thu, 16 Apr 2026 08:27:28 +0200 Subject: [PATCH] docs: add copilot instructions --- .github/copilot-instructions.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/copilot-instructions.md diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..286e38f --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,24 @@ +# laravel-websockets + +## Overview +WebSocket server for Laravel, Pusher-compatible. Ratchet-based, runs as a long-lived artisan command via supervisor. + +## Architecture +- `src/Server/WebSocketHandler.php` — main Ratchet handler (onOpen/onMessage/onClose/onError) +- `src/Websocket/Handler.php` — higher-level handler with app verification, channel management +- `src/Server/Loggers/` — decorator loggers (HttpLogger, ConnectionLogger, WebSocketsLogger) +- `src/Console/Commands/StartServer.php` — artisan command that boots the event loop + +## Logging +- Auto-registers a `websocket` log channel (daily, `storage/logs/websocket.log`, 7-day retention) +- `wsLog()` helper in WebSocketHandler for structured server-side logging +- Logger base class persists to file via `fileLog()` in addition to console output + +## Configuration +- PUSHER_APP_KEY should always be `websocket` — generic identifier, not environment-specific +- Port 6001 (supervisor), Traefik terminates TLS in front +- Config at `config/websockets.php`, apps defined via env vars + +## Conventions +- Improvements go here (the package), not in consumer vendor/ folders +- Commit, push, then `composer update` in the consumer project