docs: add copilot instructions

This commit is contained in:
Fabian @ Blax Software 2026-04-16 08:27:28 +02:00
parent 859fcb6f89
commit 3d41c81a48
1 changed files with 24 additions and 0 deletions

24
.github/copilot-instructions.md vendored Normal file
View File

@ -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