A demonstration application showcasing OpenFeature Remote Evaluation Protocol (OFREP) capabilities in a .NET environment with React frontend. This application manages a collection of Le Mans winner cars.
This demo showcases how to implement feature flags using OpenFeature and the OFREP (OpenFeature Remote Evaluation Protocol) in a full-stack .NET application with React frontend. Key features include:
- OFREP Integration: Remote feature flag evaluation using the standardized protocol
- OpenFeature SDK: Industry-standard feature flagging for both .NET backend and React frontend
- flagd Provider: Using flagd as the feature flag evaluation engine with OFREP
- Dynamic Configuration: Real-time feature flag updates without redeployment
- Full-Stack Implementation: Feature flags working seamlessly across React UI and .NET API
- Kill Switches: Safely toggle features in production environments
- Garage.Web: React + Vite frontend for managing car collections
- Garage.ApiService: REST API for car data with Entity Framework Core
- Garage.ServiceDefaults: Shared services including feature flag implementations
- Garage.Shared: Common models and DTOs
- Garage.AppHost: .NET Aspire orchestration and service discovery
- PostgreSQL: Database for storing car collection data
- Redis: Caching layer for improved performance
- flagd: OpenFeature-compliant feature flag evaluation engine
This application includes comprehensive telemetry support through .NET Aspire:
- Distributed Tracing: Track requests across services
- Metrics Collection: Monitor application performance and feature flag usage
- Logging: Centralized log aggregation
Note: When deployed, telemetry will work for the API service but not for the web frontend.
The demo demonstrates these feature flags:
| Flag | Type | Purpose | Default |
|---|---|---|---|
enable-database-winners |
bool |
Toggle data source (DB vs JSON) | true |
winners-count |
int |
Control number of winners shown | 100 |
enable-stats-header |
bool |
Show/hide statistics header | true |
enable-tabs |
bool |
Enable tabbed interface (with targeting) | false |
- .NET 10.0 SDK or later
- Visual Studio, Visual Studio Code with C# extension or JetBrains Rider
- Git for version control
- Docker Desktop (for containerized dependencies)
git clone https://github.com/open-feature/openfeature-dotnet-workshop.git
cd openfeature-dotnet-workshopdotnet restorecd src/Garage.AppHost
dotnet run- Web Frontend: https://localhost:7070
- API Service: https://localhost:7071
- Aspire Dashboard: https://localhost:15888
The application will start with flagd running as a container, providing OFREP endpoints for both the React frontend and .NET API service to consume feature flags.
- OpenFeature Documentation
- OFREP Specification
- flagd Documentation
- .NET Aspire Documentation
- Feature Flag Best Practices
This project is licensed under the MIT License.