A production-ready real-time dashboard application built with Blazor Server and gRPC server-streaming for low-latency data updates, featuring Syncfusion Blazor Charts for data visualization, comprehensive error handling, and authentication support.
- Real-time streaming: Server pushes data updates to browser via gRPC
- HTTP/2 with TLS: Secure, always-open connection with compression
- Interactive UI: Start/stop streaming with live status updates and error handling
- Data visualization: Syncfusion Blazor Charts for real-time line charts
- Responsive design: Bootstrap-based layout with live data table
- Authentication: JWT-based authentication with development fallback
- Error handling: Comprehensive error handling with retry logic and user feedback
- Health monitoring: Built-in health checks and connection monitoring
- Performance optimized: Data batching, memory management, and load testing support
RealTimeDashboard/
ββ DashboardApp/ # Blazor Server UI
β ββ Components/
β β ββ Pages/
β β β ββ LiveData.razor # Real-time data display with charts
β β ββ Layout/
β ββ Program.cs
β ββ appsettings.json
ββ DashboardGrpc/ # gRPC backend service
β ββ Services/
β β ββ DashboardStreamService.cs # Server-streaming implementation
β ββ Protos/
β β ββ dashboard.proto # Protocol buffer definitions
β ββ Program.cs
β ββ appsettings.json
ββ load-test.js # k6 load testing script
ββ TROUBLESHOOTING.md # Comprehensive troubleshooting guide
ββ RealTimeDashboard.sln
- .NET 9.0 SDK or later
- HTTPS development certificate (needed for HTTP/2 + TLS in dev)
- Syncfusion Blazor Charts license (free community license available)
-
Clone the repository:
git clone https://github.com/ChameeraD/RealTimeDashboard.git cd RealTimeDashboard -
Trust the development certificate:
dotnet dev-certs https --trust
-
Restore packages:
dotnet restore
-
Start the gRPC server:
cd DashboardGrpc dotnet runThe gRPC server will start on
https://localhost:5001 -
Start the Blazor application (in a new terminal):
cd DashboardApp dotnet runThe Blazor app will start on
http://localhost:5011 -
Access the dashboard:
- Navigate to the Blazor app URL
- Click "Live Data" in the navigation menu
- Click "Start" to begin streaming data
- View real-time charts and data table
- Uses a simple development authentication handler
- Automatically authenticates as "dev-user"
- No JWT tokens required
- JWT Bearer token authentication
- Configurable issuer, audience, and signing key
- Secure HTTPS communication with HTTP/2
Update appsettings.json in both projects:
{
"Jwt": {
"Issuer": "https://your-domain.com",
"Audience": "https://your-domain.com",
"Key": "your-super-secret-key-with-at-least-32-characters"
}
}- HTTP/2 with TLS for secure communication
- Server-streaming pattern for continuous data flow
- Authentication middleware with JWT support
- Health checks at
/healthendpoint - Compression enabled for optimal performance
- Comprehensive logging and error handling
- Typed gRPC client with retry policies
- Real-time data binding and UI updates
- Error handling with user-friendly messages
- Connection monitoring and health checks
- Performance optimization with data point limiting
{
"Grpc": {
"MaxReceiveMessageSize": 1048576,
"MaxSendMessageSize": 1048576,
"EnableDetailedErrors": true,
"ResponseCompressionAlgorithm": "gzip",
"ResponseCompressionLevel": "Fastest"
}
}{
"Grpc": {
"ServerUrl": "https://localhost:5001"
}
}- Connection uptime tracking
- Message count monitoring
- Real-time status updates
- Error rate tracking
Use the included k6 load test script:
# Install k6
brew install k6 # macOS
choco install k6 # Windows
# Install gRPC extension
k6 install xk6-grpc
# Run load test
k6 run load-test.js --vus 100 --duration 30s# Monitor .NET performance counters
dotnet-counters monitor --process-id <PID>
# Check health endpoint
curl https://localhost:5001/health- HTTPS Certificate Errors: Run
dotnet dev-certs https --trust - Connection Refused: Verify gRPC server is running on port 5001
- Authentication Errors: Check JWT configuration in production
- Performance Issues: Monitor data point limits and compression
Enable detailed logging in appsettings.Development.json:
{
"Logging": {
"LogLevel": {
"Default": "Debug",
"Grpc": "Debug",
"DashboardGrpc": "Debug"
}
}
}- Check the Troubleshooting Guide
- Review console logs for detailed error messages
- Verify .NET version compatibility
- Check package references and dependencies
- SSL Certificates: Use valid SSL certificates
- Firewall Rules: Open required ports (5001 for gRPC)
- Load Balancer: Ensure HTTP/2 support
- Environment Variables: Set production JWT keys
- Monitoring: Implement application monitoring and alerting
The application can be containerized using standard .NET Docker images. Ensure your container environment supports HTTP/2 and TLS.
- gRPC for .NET Documentation
- Blazor Server Documentation
- Syncfusion Blazor Charts
- k6 Load Testing
- HTTP/2 and TLS with Kestrel
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with .NET 9.0
- UI components from Syncfusion Blazor
- Load testing with k6
- Real-time communication via gRPC