Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

A reference .NET application implementing an eCommerce site. Enhanced for FME feature flag evaluation

License

Notifications You must be signed in to change notification settings

splitio-examples/eShop

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

343 Commits
343 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

eShop Reference Application - "AdventureWorks"

A reference .NET application implementing an e-commerce website using a services-based architecture using .NET Aspire.

eShop Reference Application architecture diagram

eShop homepage screenshot

Getting Started

This version of eShop is based on .NET 9.

Previous eShop versions:

Prerequisites

Windows with Visual Studio

  • Install Visual Studio 2022 version 17.10 or newer.
    • Select the following workloads:
      • ASP.NET and web development workload.
      • .NET Aspire SDK component in Individual components.
      • Optional: .NET Multi-platform App UI development to run client apps

Or

  • Run the following commands in a Powershell & Terminal running as Administrator to automatically configure your environment with the required tools to build and run this application. (Note: A restart is required and included in the script below.)
install-Module -Name Microsoft.WinGet.Configuration -AllowPrerelease -AcceptLicense -Force
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
get-WinGetConfiguration -file .\.configurations\vside.dsc.yaml | Invoke-WinGetConfiguration -AcceptConfigurationAgreements

Or

  • From Dev Home go to Machine Configuration -> Clone repositories. Enter the URL for this repository. In the confirmation screen look for the section Configuration File Detected and click Run File.

Mac, Linux, & Windows without Visual Studio

Or

  • Run the following commands in a Powershell & Terminal running as Administrator to automatically configuration your environment with the required tools to build and run this application. (Note: A restart is required after running the script below.)
Install Visual Studio Code and related extensions
install-Module -Name Microsoft.WinGet.Configuration -AllowPrerelease -AcceptLicense  -Force
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
get-WinGetConfiguration -file .\.configurations\vscode.dsc.yaml | Invoke-WinGetConfiguration -AcceptConfigurationAgreements

Note: These commands may require sudo

Note: When running on Mac with Apple Silicon (M series processor), Rosetta 2 for grpc-tools.

Running the solution

Warning

Remember to ensure that Docker is started

  • (Windows only) Run the application from Visual Studio:
  • Open the eShop.Web.slnf file in Visual Studio
  • Ensure that eShop.AppHost.csproj is your startup project
  • Hit Ctrl-F5 to launch Aspire
  • Or run the application from your terminal:
dotnet run --project src/eShop.AppHost/eShop.AppHost.csproj

then look for lines like this in the console output in order to find the URL to open the Aspire dashboard:

Login to the dashboard at: http://localhost:19888/login?t=uniquelogincodeforyou

You may need to install ASP.NET Core HTTPS development certificates first, and then close all browser tabs. Learn more at https://aka.ms/aspnet/https-trust-dev-cert

Azure Open AI

When using Azure OpenAI, inside eShop.AppHost/appsettings.json, add the following section:

  "ConnectionStrings": {
    "OpenAi": "Endpoint=xxx;Key=xxx;"
  }

Replace the values with your own. Then, in the eShop.AppHost Program.cs, set this value to true

bool useOpenAI = false;

Here's additional guidance on the .NET Aspire OpenAI component.

Use Azure Developer CLI

You can use the Azure Developer CLI to run this project on Azure with only a few commands. Follow the next instructions:

  • Install the latest or update to the latest Azure Developer CLI (azd).
  • Log in azd (if you haven't done it before) to your Azure account:
azd auth login
  • Initialize azd from the root of the repo.
azd init
  • During init:

    • Select Use code in the current directory. Azd will automatically detect the .NET Aspire project.
    • Confirm .NET (Aspire) and continue.
    • Select which services to expose to the Internet (exposing webapp is enough to test the sample).
    • Finalize the initialization by giving a name to your environment.
  • Create Azure resources and deploy the sample by running:

azd up

Notes:

  • The operation takes a few minutes the first time it is ever run for an environment.
  • At the end of the process, azd will display the url for the webapp. Follow that link to test the sample.
  • You can run azd up after saving changes to the sample to re-deploy and update the sample.
  • Report any issues to azure-dev repo.
  • FAQ and troubleshoot for azd.

Contributing

For more information on contributing to this repo, read the contribution documentation and the Code of Conduct.

Sample data

The sample catalog data is defined in catalog.json. Those product names, descriptions, and brand names are fictional and were generated using GPT-35-Turbo, and the corresponding product images were generated using DALL·E 3.

eShop on Azure

For a version of this app configured for deployment on Azure, please view the eShop on Azure repo.

harness_favicon Harness Feature Management & Experimentation (FME)

This version of eShop includes a gRPC backend microservice that evaluates Harness FME feature flags.

To evaluate feature flags in code:

  1. Sign up to Harness for free and choose the Feature Management & Experimentation tile.
  2. Find your Harness FME server-side SDK API key value (take note of the associated Environment).
  3. On your machine, create a YOUR_SDK_KEY environment variable and set the value to be the API key value. The FME microservice will use this value for authentication.
  4. Create two FME feature flags named display_product_rating and display_discount.
  5. Create definitions for each feature flag in the FME Environment that matches your API key, as follows:
  • display_product_rating
    • choose css color keywords as treatment names
  • display_discount
    • choose the percentage discount amounts (e.g. 30, 50, etc.) as treatment names
    • set up an attribute-based targeting rule: IF city is in list new_york (you can type 'city' and 'new_york' directly in the input boxes)

When the site is running, you will see feature flag impressions (evaluations) showing up on the Live tail tab of your feature flags or of Data Hub in Harness FME.

For implementation details, look in the repo commit history. If you have questions, reach out to us at support@split.io (the support email continues to be used by the team at Harness FME).

Harness is a modern software delivery platform.

Anonymous user login

This version of eShop allows users to add items to the cart before signing in to the eShop site.

Coming Enhancements

There are some coming enhancements to provide a seamless user experience across user logins, when using FME feature flags. If you are interested in seamless feature flag evaluations and experimentation across user logins, add a watch to this repo.

About

A reference .NET application implementing an eCommerce site. Enhanced for FME feature flag evaluation

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 83.5%
  • HTML 8.6%
  • CSS 6.8%
  • Other 1.1%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.