This micro-app can be used as a test subscriber and/or test emitter of CloudEvents.
It is very useful in an event-driven architecture to monitor events and test subscriptions in real-time with a unified dashboard interface.
π Full Documentation: https://bvandewe.github.io/events-player/
Zero configuration required - just run and go:
docker run -p 8884:8080 ghcr.io/bvandewe/events-player:latestThen open: http://localhost:8884
!!! warning With great power comes great responsibility!
Running this container with no other configuration will enable ALL features, including the sensitive generator that can emit any events anywhere...
Enable RBAC with AUTH_REQUIRED=true and use a OIDC Provider! See sample docker-compose.
The unmissable demo gif:
Run two instances locally and send events between them:
flowchart LR
A((player:8884)) -->|emits|B((player:8885))
B -->|emits|A
# Instance 1: http://localhost:8884
docker run -d --rm -p 8884:8080 \
-e api_default_generator_gateways='{"urls": ["http://localhost:8884/events/pub", "http://host.docker.internal:8885/events/pub"]}' \
ghcr.io/bvandewe/events-player:latest
# Instance 2: http://localhost:8885
docker run -d --rm -p 8885:8080 \
-e api_default_generator_gateways='{"urls": ["http://localhost:8885/events/pub", "http://host.docker.internal:8884/events/pub"]}' \
ghcr.io/bvandewe/events-player:latestThe app provides a web-based interface that enables users to visualize events as they are received on the POST /events/pub endpoint. The UI provides simple web-form that enables users to generate event(s) and emit/transmit them to a selected customizable event gateway.
It can very easily be deployed locally (included in a docker-compose file) or remotely (in Kubernetes or Docker) and may be configured as a subscriber to an event channel (like Cloud Streams).
- π― Event Generation: Generate CloudEvents with customizable properties and batch support
- π‘ Real-Time Monitoring: Server-Sent Events (SSE) streaming with unified dashboard
- π Event Inspection: Examine CloudEvent structure with syntax-highlighted JSON
- π Unified Dashboard: Single-page view with Streams, Timeline, Metrics, and Analytics
- π Pub/Sub Support: Acts as both publisher and subscriber
- οΏ½ Deep Search: Search anywhere in event payloads with persistence
- π Timeline Visualization: Chart.js timeline with configurable time buckets (1s to 1hr)
- π¨ Interactive Charts: Click-to-filter on sources, types, and subjects
- π Authentication & Authorization: OAuth 2.0/OIDC with RBAC - optional, disabled by default
- πΎ Two-tier Storage: IndexedDB with separate tiers for full events and metadata
- π Request Tracing: Built-in Request ID tracing for debugging
- π₯ Health Monitoring: Health check endpoint for monitoring systems
CloudEvent Player v0.4.0 features a redesigned unified dashboard:
- Single-page View: No more switching between pages
- Real-time Metrics: Total events, avg rate, top types/sources
- Tabs: Streams (event list) and Timeline (visual chart)
- Global Filters: Type, Source, Subject, Time Range affect all views
- Search: Find events by any text in payload
- Analytics: Top sources, types, subjects with click-to-filter
- Storage Indicators: Visualize IndexedDB usage (Tier 1 + Tier 2)
Authentication is disabled by default. The application works out of the box without any authentication configuration.
To enable authentication and authorization, set the auth_required environment variable to "true":
docker run -p 8884:8080 -e auth_required="true" ghcr.io/bvandewe/events-player:latestWhen auth_required=false (default):
- All features accessible without login
- No authentication tokens required
- Admin features (Clear Storage, Current Clients, Manage Tasks) available via gear icon
When auth_required=true:
- OAuth 2.0/OIDC authentication enforced
- Role-based access control (default
roleclaim values:admin,operator,user, seeAUTH_ROLE_*environment variables) - Login required for event generation and admin features
The application automatically detects the authentication mode based on the incoming request:
-
Istio/Proxy Mode: When user is pre-authenticated (JWT injected by OAuth2 Proxy/Istio)
- Frontend detects:
/api/auth/inforeturnsauthenticated: true - No login button shown, user already authenticated
- Token managed server-side by proxy layer
- Frontend detects:
-
OAuth Mode: When OAuth configuration is provided
- Frontend detects: OAuth config present in
/api/auth/inforesponse - Login button shown when not authenticated
- Frontend handles OAuth flow with Keycloak/OIDC provider
- Frontend detects: OAuth config present in
-
No Auth Mode: When authentication is disabled (default)
- All features accessible without login
π Technical Detail: The frontend determines authentication mode from the authentication state, not from backend environment variables. This resilient design works even with minimal backend configuration. See
notes/MODE_DETECTION_CASE_STUDY.mdfor details.
See the full authentication documentation for OAuth/OIDC configuration details.
- No Server-Side Persistence: Refreshing the browser resets client-side state
- Client-Side Storage Only: Events stored in browser IndexedDB (capacity-based FIFO queues)
- Tier 1: Full events (default: 5000 max)
- Tier 2: Metadata (default: 100,000 max)
- Display Limit: Configurable max events rendered in DOM (default: 1000)
The root URL shows the Unified Dashboard with:
- Metrics Row: Real-time event counters and rate statistics
- Streams/Timeline Tabs: Switch between event list and visual timeline
- Search Box: Filter events by any text in payload (persisted)
- Analytics Charts: Top sources, types, subjects (click to filter)
- Storage Indicators: IndexedDB usage visualization
The backend validates and handles CloudEvents via the POST /events/pub endpoint and streams events to all connected clients via SSE.
- Payload must have
Content-Type: application/cloudevents+json - Event must follow CloudEvents Specifications v1.0.2 in JSON Format
When a valid event is received, it's pushed to all connected clients and stored in IndexedDB.
-
Pull and run the Docker image:
docker run --rm -p 8884:8080 ghcr.io/bvandewe/events-player:latest
-
Browse to http://localhost:8884
-
Emit CloudEvent to http://localhost:8884/events/pub
-
Enjoy!
The SSE stream can be accessed at /stream/events using a browser or any SSE client:
curl -N http://localhost:8884/stream/eventsThe stream sends JSON payloads for each received event.
When running the development environment with docker-compose -f docker-compose.debug.yml up -d, Keycloak is available at:
- URL: http://localhost:8090
- Admin Username:
admin - Admin Password:
admin
The master realm is automatically configured to allow HTTP access (development only). See deployments/keycloak/HTTP_CONFIGURATION.md for details.
The API documentation is available via Swagger UI at /api/docs. When Keycloak is configured, Swagger UI includes an "Authorize" button that allows you to authenticate and test protected endpoints.
To authenticate in Swagger UI:
- Navigate to http://localhost:8080/api/docs (or your deployment URL +
/api/docs) - Click the "Authorize" button in the top-right corner
- Select the scopes you want (typically
openid,profile,email) - Click "Authorize" to start the OAuth2 Authorization Code flow
- Log in with your Keycloak credentials
- You'll be redirected back to Swagger UI with an active session
Once authenticated, you can test protected endpoints directly from Swagger UI. The authentication token will be automatically included in all API requests.
Available Security Schemes:
- OAuth2AuthorizationCode: Full OAuth2 authorization code flow with PKCE (recommended for browser use)
- BearerAuth: Direct JWT bearer token (for API clients that already have a token)
