├── .github └── workflows │ └── auto_add_to_project..yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── SECURITY.md ├── SUPPORT.md ├── img └── EN-US_BRK442_Tech.png ├── session-delivery-resources ├── README.md ├── RequirementsAndPreparation.md ├── step-by-step-codespaces.md └── step-by-step-vs2022.md └── src ├── README.md ├── src BackUp ├── 00 initial │ ├── .editorconfig │ ├── DataEntities │ │ ├── DataEntities.csproj │ │ └── Product.cs │ ├── Products │ │ ├── .config │ │ │ └── dotnet-tools.json │ │ ├── Data │ │ │ └── ProductDataContext.cs │ │ ├── Database.db │ │ ├── Database.db-shm │ │ ├── Database.db-wal │ │ ├── Endpoints │ │ │ └── ProductEndpoints.cs │ │ ├── Memory │ │ │ └── MemoryContext.cs │ │ ├── Products.csproj │ │ ├── Products.csproj.user │ │ ├── Products.http │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.json │ │ └── wwwroot │ │ │ └── images │ │ │ ├── product1.png │ │ │ ├── product2.png │ │ │ ├── product3.png │ │ │ ├── product4.png │ │ │ ├── product5.png │ │ │ ├── product6.png │ │ │ ├── product7.png │ │ │ ├── product8.png │ │ │ └── product9.png │ ├── SearchEntities │ │ ├── SearchEntities.csproj │ │ └── SearchResponse.cs │ ├── Store │ │ ├── Components │ │ │ ├── App.razor │ │ │ ├── Layout │ │ │ │ ├── MainLayout.razor │ │ │ │ ├── MainLayout.razor.css │ │ │ │ ├── NavMenu.razor │ │ │ │ └── NavMenu.razor.css │ │ │ ├── Pages │ │ │ │ ├── Home.razor │ │ │ │ ├── Products.razor │ │ │ │ └── Search.razor │ │ │ ├── Routes.razor │ │ │ └── _Imports.razor │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Services │ │ │ └── ProductService.cs │ │ ├── Store.csproj │ │ ├── Store.csproj.user │ │ ├── appsettings.json │ │ └── wwwroot │ │ │ ├── app.css │ │ │ ├── bootstrap │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ │ └── favicon.png │ ├── eShopLite.sln │ └── eShopLite.slnLaunch.user ├── 01 AISearch Code Complete │ ├── .editorconfig │ ├── DataEntities │ │ ├── DataEntities.csproj │ │ └── Product.cs │ ├── Products │ │ ├── .config │ │ │ └── dotnet-tools.json │ │ ├── Data │ │ │ └── ProductDataContext.cs │ │ ├── Database.db │ │ ├── Database.db-shm │ │ ├── Database.db-wal │ │ ├── Endpoints │ │ │ └── ProductEndpoints.cs │ │ ├── Memory │ │ │ └── MemoryContext.cs │ │ ├── Products.csproj │ │ ├── Products.csproj.user │ │ ├── Products.http │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.json │ │ └── wwwroot │ │ │ └── images │ │ │ ├── product1.png │ │ │ ├── product2.png │ │ │ ├── product3.png │ │ │ ├── product4.png │ │ │ ├── product5.png │ │ │ ├── product6.png │ │ │ ├── product7.png │ │ │ ├── product8.png │ │ │ └── product9.png │ ├── SearchEntities │ │ ├── SearchEntities.csproj │ │ └── SearchResponse.cs │ ├── Store │ │ ├── Components │ │ │ ├── App.razor │ │ │ ├── Layout │ │ │ │ ├── MainLayout.razor │ │ │ │ ├── MainLayout.razor.css │ │ │ │ ├── NavMenu.razor │ │ │ │ └── NavMenu.razor.css │ │ │ ├── Pages │ │ │ │ ├── Home.razor │ │ │ │ ├── Products.razor │ │ │ │ └── Search.razor │ │ │ ├── Routes.razor │ │ │ └── _Imports.razor │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Services │ │ │ └── ProductService.cs │ │ ├── Store.csproj │ │ ├── Store.csproj.user │ │ ├── appsettings.json │ │ └── wwwroot │ │ │ ├── app.css │ │ │ ├── bootstrap │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ │ └── favicon.png │ ├── eShopLite.sln │ └── eShopLite.slnLaunch.user ├── 02 Prompty Done │ ├── .editorconfig │ ├── .vscode │ │ └── settings.json │ ├── DataEntities │ │ ├── DataEntities.csproj │ │ └── Product.cs │ ├── Products │ │ ├── .config │ │ │ └── dotnet-tools.json │ │ ├── Data │ │ │ └── ProductDataContext.cs │ │ ├── Database.db │ │ ├── Database.db-shm │ │ ├── Database.db-wal │ │ ├── Endpoints │ │ │ └── ProductEndpoints.cs │ │ ├── Memory │ │ │ └── MemoryContext.cs │ │ ├── Products.csproj │ │ ├── Products.csproj.user │ │ ├── Products.http │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── aisearchresponse.prompty │ │ ├── appsettings.json │ │ └── wwwroot │ │ │ └── images │ │ │ ├── product1.png │ │ │ ├── product2.png │ │ │ ├── product3.png │ │ │ ├── product4.png │ │ │ ├── product5.png │ │ │ ├── product6.png │ │ │ ├── product7.png │ │ │ ├── product8.png │ │ │ └── product9.png │ ├── SearchEntities │ │ ├── SearchEntities.csproj │ │ └── SearchResponse.cs │ ├── Store │ │ ├── Components │ │ │ ├── App.razor │ │ │ ├── Layout │ │ │ │ ├── MainLayout.razor │ │ │ │ ├── MainLayout.razor.css │ │ │ │ ├── NavMenu.razor │ │ │ │ └── NavMenu.razor.css │ │ │ ├── Pages │ │ │ │ ├── Home.razor │ │ │ │ ├── Products.razor │ │ │ │ └── Search.razor │ │ │ ├── Routes.razor │ │ │ └── _Imports.razor │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Services │ │ │ └── ProductService.cs │ │ ├── Store.csproj │ │ ├── Store.csproj.user │ │ ├── appsettings.json │ │ └── wwwroot │ │ │ ├── app.css │ │ │ ├── bootstrap │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ │ └── favicon.png │ ├── eShopLite.sln │ └── eShopLite.slnLaunch.user ├── 03 Aspire │ ├── .editorconfig │ ├── DataEntities │ │ ├── DataEntities.csproj │ │ └── Product.cs │ ├── Products │ │ ├── .config │ │ │ └── dotnet-tools.json │ │ ├── Data │ │ │ └── ProductDataContext.cs │ │ ├── Database.db │ │ ├── Database.db-shm │ │ ├── Database.db-wal │ │ ├── Endpoints │ │ │ └── ProductEndpoints.cs │ │ ├── Memory │ │ │ └── MemoryContext.cs │ │ ├── Products.csproj │ │ ├── Products.csproj.user │ │ ├── Products.http │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── aisearchresponse.prompty │ │ ├── appsettings.json │ │ └── wwwroot │ │ │ └── images │ │ │ ├── product1.png │ │ │ ├── product2.png │ │ │ ├── product3.png │ │ │ ├── product4.png │ │ │ ├── product5.png │ │ │ ├── product6.png │ │ │ ├── product7.png │ │ │ ├── product8.png │ │ │ └── product9.png │ ├── SearchEntities │ │ ├── SearchEntities.csproj │ │ └── SearchResponse.cs │ ├── Store │ │ ├── Components │ │ │ ├── App.razor │ │ │ ├── Layout │ │ │ │ ├── MainLayout.razor │ │ │ │ ├── MainLayout.razor.css │ │ │ │ ├── NavMenu.razor │ │ │ │ └── NavMenu.razor.css │ │ │ ├── Pages │ │ │ │ ├── Home.razor │ │ │ │ ├── Products.razor │ │ │ │ └── Search.razor │ │ │ ├── Routes.razor │ │ │ └── _Imports.razor │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Services │ │ │ └── ProductService.cs │ │ ├── Store.csproj │ │ ├── Store.csproj.user │ │ ├── appsettings.json │ │ └── wwwroot │ │ │ ├── app.css │ │ │ ├── bootstrap │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ │ └── favicon.png │ ├── eShopAppHost │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── appsettings.json │ │ └── eShopAppHost.csproj │ ├── eShopLite-Aspire.sln │ └── eShopServiceDefaults │ │ ├── Extensions.cs │ │ └── eShopServiceDefaults.csproj └── 04 Aspire Ollama │ ├── .editorconfig │ ├── DataEntities │ ├── DataEntities.csproj │ └── Product.cs │ ├── Products │ ├── .config │ │ └── dotnet-tools.json │ ├── Data │ │ └── ProductDataContext.cs │ ├── Database.db │ ├── Endpoints │ │ └── ProductEndpoints.cs │ ├── Memory │ │ └── MemoryContext.cs │ ├── Products.csproj │ ├── Products.csproj.user │ ├── Products.http │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── aisearchresponse.prompty │ ├── appsettings.json │ └── wwwroot │ │ └── images │ │ ├── product1.png │ │ ├── product2.png │ │ ├── product3.png │ │ ├── product4.png │ │ ├── product5.png │ │ ├── product6.png │ │ ├── product7.png │ │ ├── product8.png │ │ └── product9.png │ ├── SearchEntities │ ├── ProductVector.cs │ ├── SearchEntities.csproj │ └── SearchResponse.cs │ ├── Store │ ├── Components │ │ ├── App.razor │ │ ├── Layout │ │ │ ├── MainLayout.razor │ │ │ ├── MainLayout.razor.css │ │ │ ├── NavMenu.razor │ │ │ └── NavMenu.razor.css │ │ ├── Pages │ │ │ ├── Home.razor │ │ │ ├── Products.razor │ │ │ └── Search.razor │ │ ├── Routes.razor │ │ └── _Imports.razor │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Services │ │ └── ProductService.cs │ ├── Store.csproj │ ├── Store.csproj.user │ ├── appsettings.json │ └── wwwroot │ │ ├── app.css │ │ ├── bootstrap │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.css.map │ │ └── favicon.png │ ├── eShopAppHost │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── appsettings.json │ └── eShopAppHost.csproj │ ├── eShopLite-Aspire.sln │ └── eShopServiceDefaults │ ├── Extensions.cs │ └── eShopServiceDefaults.csproj ├── src Demo └── Products │ └── aisearchresponse.prompty └── src ├── .editorconfig ├── DataEntities ├── DataEntities.csproj └── Product.cs ├── Products ├── .config │ └── dotnet-tools.json ├── Data │ └── ProductDataContext.cs ├── Database.db ├── Database.db-shm ├── Database.db-wal ├── Endpoints │ └── ProductEndpoints.cs ├── Memory │ └── MemoryContext.cs ├── Products.csproj ├── Products.csproj.user ├── Products.http ├── Program.cs ├── Properties │ └── launchSettings.json ├── appsettings.json └── wwwroot │ └── images │ ├── product1.png │ ├── product2.png │ ├── product3.png │ ├── product4.png │ ├── product5.png │ ├── product6.png │ ├── product7.png │ ├── product8.png │ └── product9.png ├── SearchEntities ├── SearchEntities.csproj └── SearchResponse.cs ├── Store ├── Components │ ├── App.razor │ ├── Layout │ │ ├── MainLayout.razor │ │ ├── MainLayout.razor.css │ │ ├── NavMenu.razor │ │ └── NavMenu.razor.css │ ├── Pages │ │ ├── Home.razor │ │ ├── Products.razor │ │ └── Search.razor │ ├── Routes.razor │ └── _Imports.razor ├── Program.cs ├── Properties │ └── launchSettings.json ├── Services │ └── ProductService.cs ├── Store.csproj ├── Store.csproj.user ├── appsettings.json └── wwwroot │ ├── app.css │ ├── bootstrap │ ├── bootstrap.min.css │ └── bootstrap.min.css.map │ └── favicon.png ├── eShopLite.sln └── eShopLite.slnLaunch.user /.github/workflows/auto_add_to_project..yml: -------------------------------------------------------------------------------- 1 | name: Add new issues to AI Tour GH Project 2 | 3 | on: 4 | issues: 5 | types: 6 | - opened 7 | 8 | jobs: 9 | add-to-project: 10 | name: Add issue to project 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/add-to-project@v1.0.2 14 | with: 15 | project-url: ${{ secrets.GH_PROJECT_URL }} 16 | github-token: ${{ secrets.ADD_TO_PROJECT }} 17 | label_issues: 18 | runs-on: ubuntu-latest 19 | permissions: 20 | issues: write 21 | steps: 22 | - run: gh issue edit "$NUMBER" --add-label "$LABELS" 23 | env: 24 | GH_TOKEN: ${{ secrets.ADD_TO_PROJECT }} 25 | GH_REPO: ${{ github.repository }} 26 | NUMBER: ${{ github.event.issue.number }} 27 | LABELS: AI Intro 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/bin/** 2 | **/obj/** 3 | **.mono/registry/CurrentUser/** 4 | **/.dtbcache.v2** 5 | **.vsidx 6 | **.suo 7 | **/.vs/** 8 | **.env** 9 | **Database.db-shm 10 | **Database.db-wal 11 | 12 | appsettings.Development.json 13 | .env 14 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Microsoft Open Source Code of Conduct 2 | 3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 4 | 5 | Resources: 6 | 7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) 8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) 9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /SUPPORT.md: -------------------------------------------------------------------------------- 1 | # TODO: The maintainer of this repo has not yet edited this file 2 | 3 | **REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project? 4 | 5 | - **No CSS support:** Fill out this template with information about how to file issues and get help. 6 | - **Yes CSS support:** Fill out an intake form at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work with/help you to determine next steps. 7 | - **Not sure?** Fill out an intake as though the answer were "Yes". CSS will help you decide. 8 | 9 | *Then remove this first heading from this SUPPORT.MD file before publishing your repo.* 10 | 11 | # Support 12 | 13 | ## How to file issues and get help 14 | 15 | This project uses GitHub Issues to track bugs and feature requests. Please search the existing 16 | issues before filing new issues to avoid duplicates. For new issues, file your bug or 17 | feature request as a new Issue. 18 | 19 | For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE 20 | FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER 21 | CHANNEL. WHERE WILL YOU HELP PEOPLE?**. 22 | 23 | ## Microsoft Support Policy 24 | 25 | Support for this **PROJECT or PRODUCT** is limited to the resources listed above. 26 | -------------------------------------------------------------------------------- /img/EN-US_BRK442_Tech.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/img/EN-US_BRK442_Tech.png -------------------------------------------------------------------------------- /session-delivery-resources/RequirementsAndPreparation.md: -------------------------------------------------------------------------------- 1 | # Requirements and Preparation 2 | 3 | The current session demo can be run in 2 scenarios: 4 | - Windows 11 with Visual Studio 2022 5 | - CodeSpaces for non-windows environments 6 | 7 | We advise to run the demo in a Windows environment. Both scenarios have a detailed set of demos in video mode, and a step-by-step document that describes the main actions and talking points for the demos. 8 | 9 | ***Note:** We strongly advise to watch the demos and practice the session before the delivery date.* 10 | 11 | ## Preparation 12 | 13 | The main source code is located in `.\src\`. 14 | 15 | There are also backup projects in: 16 | 17 | - `.\src BackUp\00 initial\`: This is the initial state for the demo. You can copy this to the main source code location `.\src\`, to start a session from scratch. 18 | 19 | - `.\src BackUp\01 AISearch Code Complete\`: This is the complete solution with the AI Search fully implemented. 20 | 21 | - `.\src BackUp\02 Aspire\`: This is the complete solution with the AI Search implementation, and also managed and orchestrated with Aspire. 22 | 23 | ## Requirements 24 | 25 | We only need to set the necessary variables to access the GPT and ADA models in the start demo solution, and in the Aspire complete solution. Follow these steps: 26 | 27 | Navigate to this folder `..\src\Products\` 28 | Run the commands: 29 | 30 | ```bash 31 | dotnet user-secrets init 32 | dotnet user-secrets set "AZURE_OPENAI_MODEL" "gpt-4o" 33 | dotnet user-secrets set "AZURE_OPENAI_ENDPOINT" "https://< end point >.openai.azure.com/" 34 | dotnet user-secrets set "AZURE_OPENAI_APIKEY" "< Api Key >" 35 | dotnet user-secrets set "AZURE_OPENAI_ADA02" "text-embedding-ada-002" 36 | ``` 37 | 38 | Navigate to the folder of the Products projects in the Aspire demo `..\src BackUp\02 Aspire\Products\` 39 | Run the same commands 40 | 41 | ## Demo using Windows Environment 42 | 43 | - Windows 11 44 | - .NET 8 45 | - Visual Studio 2022 and Visual Studio Code 46 | - Keys and Endpoints for GPT-4o and ADA002 47 | 48 | ## Demo using Codespaces 49 | 50 | - GitHub Account, fork the main demo repo 51 | - Create a CodeSpace from the repo 52 | - Keys and Endpoints for GPT-4o and ADA002 53 | - Optional, use VSCode as client for the Codespace -------------------------------------------------------------------------------- /src/README.md: -------------------------------------------------------------------------------- 1 | # Source code 2 | 3 | This folder contains the source code for this lab. 4 | 5 | The main source code is located in `.\src\`. 6 | 7 | There are also backup projects in: 8 | 9 | - `.\src BackUp\00 initial\`: This is the initial state for the demo. You can copy this to the main source code location `.\src\`, to start a session from scratch. 10 | 11 | - `.\src BackUp\01 AISearch Code Complete\`: This is the complete solution with the AI Search fully implemented. 12 | 13 | - `.\src BackUp\02 Aspire\`: This is the complete solution with the AI Search implementation, and also managed and orchestrated with Aspire. -------------------------------------------------------------------------------- /src/src BackUp/00 initial/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | 3 | # CS8602: Dereference of a possibly null reference. 4 | dotnet_diagnostic.CS8602.severity = silent 5 | 6 | # IDE0058: Expression value is never used 7 | dotnet_diagnostic.IDE0058.severity = silent 8 | -------------------------------------------------------------------------------- /src/src BackUp/00 initial/DataEntities/DataEntities.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/src BackUp/00 initial/DataEntities/Product.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace DataEntities; 4 | 5 | public class Product 6 | { 7 | 8 | public Product() 9 | { 10 | Id = 0; 11 | Name = "not defined"; 12 | Description = "not defined"; 13 | Price = 0; 14 | ImageUrl = "not defined"; 15 | } 16 | 17 | [JsonPropertyName("id")] 18 | public int Id { get; set; } 19 | 20 | [JsonPropertyName("name")] 21 | public string? Name { get; set; } 22 | 23 | [JsonPropertyName("description")] 24 | public string? Description { get; set; } 25 | 26 | [JsonPropertyName("price")] 27 | public decimal Price { get; set; } 28 | 29 | [JsonPropertyName("imageUrl")] 30 | public string? ImageUrl { get; set; } 31 | } 32 | 33 | 34 | [JsonSerializable(typeof(List))] 35 | public sealed partial class ProductSerializerContext : JsonSerializerContext 36 | { 37 | } -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Products/.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "dotnet-ef": { 6 | "version": "8.0.0-rc.1.23419.6", 7 | "commands": [ 8 | "dotnet-ef" 9 | ] 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Products/Database.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/00 initial/Products/Database.db -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Products/Database.db-shm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/00 initial/Products/Database.db-shm -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Products/Database.db-wal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/00 initial/Products/Database.db-wal -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Products/Products.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | true 8 | 000aa9d1-8ada-4ab7-9b97-678cf3132ce5 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | all 28 | runtime; build; native; contentfiles; analyzers; buildtransitive 29 | 30 | 31 | 32 | 33 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Products/Products.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | https 5 | 6 | -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Products/Products.http: -------------------------------------------------------------------------------- 1 | @HostAddress = http://localhost:5228 2 | 3 | GET {{HostAddress}}/api/Product 4 | Accept: application/json 5 | 6 | ### 7 | -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Products/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Products.Data; 3 | using Products.Endpoints; 4 | 5 | var builder = WebApplication.CreateBuilder(args); 6 | builder.Services.AddDbContext(options => 7 | options.UseSqlite(builder.Configuration.GetConnectionString("ProductsContext") ?? throw new InvalidOperationException("Connection string 'ProductsContext' not found."))); 8 | 9 | builder.Services.AddSingleton(sp => 10 | { 11 | return builder.Configuration; 12 | }); 13 | 14 | // Add services to the container. 15 | var app = builder.Build(); 16 | 17 | // Configure the HTTP request pipeline. 18 | app.UseHttpsRedirection(); 19 | 20 | app.MapProductEndpoints(); 21 | 22 | app.UseStaticFiles(); 23 | 24 | app.CreateDbIfNotExists(); 25 | 26 | app.Run(); 27 | -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Products/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:49179", 8 | "sslPort": 44375 9 | } 10 | }, 11 | "profiles": { 12 | "http": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "launchBrowser": true, 16 | "launchUrl": "api/Product", 17 | "applicationUrl": "http://localhost:5228", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development" 20 | } 21 | }, 22 | "https": { 23 | "commandName": "Project", 24 | "dotnetRunMessages": true, 25 | "launchBrowser": true, 26 | "launchUrl": "api/Product", 27 | "applicationUrl": "https://localhost:7130;http://localhost:5228", 28 | "environmentVariables": { 29 | "ASPNETCORE_ENVIRONMENT": "Development" 30 | } 31 | }, 32 | "IIS Express": { 33 | "commandName": "IISExpress", 34 | "launchBrowser": true, 35 | "launchUrl": "api/Product", 36 | "environmentVariables": { 37 | "ASPNETCORE_ENVIRONMENT": "Development" 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Products/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "ConnectionStrings": { 10 | "ProductsContext": "Data Source=Database.db" 11 | } 12 | } -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Products/wwwroot/images/product1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/00 initial/Products/wwwroot/images/product1.png -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Products/wwwroot/images/product2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/00 initial/Products/wwwroot/images/product2.png -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Products/wwwroot/images/product3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/00 initial/Products/wwwroot/images/product3.png -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Products/wwwroot/images/product4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/00 initial/Products/wwwroot/images/product4.png -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Products/wwwroot/images/product5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/00 initial/Products/wwwroot/images/product5.png -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Products/wwwroot/images/product6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/00 initial/Products/wwwroot/images/product6.png -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Products/wwwroot/images/product7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/00 initial/Products/wwwroot/images/product7.png -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Products/wwwroot/images/product8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/00 initial/Products/wwwroot/images/product8.png -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Products/wwwroot/images/product9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/00 initial/Products/wwwroot/images/product9.png -------------------------------------------------------------------------------- /src/src BackUp/00 initial/SearchEntities/SearchEntities.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | net9.0 9 | enable 10 | enable 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/src BackUp/00 initial/SearchEntities/SearchResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace SearchEntities; 4 | 5 | public class SearchResponse 6 | { 7 | [JsonPropertyName("id")] 8 | public string? Response { get; set; } 9 | 10 | [JsonPropertyName("products")] 11 | public List? Products { get; set; } 12 | 13 | [JsonPropertyName("elapsedtime")] 14 | public TimeSpan ElapsedTime { get; set; } 15 | } 16 | 17 | 18 | [JsonSerializable(typeof(SearchResponse))] 19 | public sealed partial class SearchResponseSerializerContext : JsonSerializerContext 20 | { 21 | } -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Store/Components/App.razor: -------------------------------------------------------------------------------- 1 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Store/Components/Layout/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 |
4 | 7 | 8 |
9 |
10 | About 11 |
12 | 13 |
14 | @Body 15 |
16 |
17 |
18 | 19 |
20 | An unhandled error has occurred. 21 | Reload 22 | 🗙 23 |
24 | -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Store/Components/Layout/MainLayout.razor.css: -------------------------------------------------------------------------------- 1 | .page { 2 | position: relative; 3 | display: flex; 4 | flex-direction: column; 5 | } 6 | 7 | main { 8 | flex: 1; 9 | } 10 | 11 | .sidebar { 12 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 13 | } 14 | 15 | .top-row { 16 | background-color: #f7f7f7; 17 | border-bottom: 1px solid #d6d5d5; 18 | justify-content: flex-end; 19 | height: 3.5rem; 20 | display: flex; 21 | align-items: center; 22 | } 23 | 24 | .top-row ::deep a, .top-row ::deep .btn-link { 25 | white-space: nowrap; 26 | margin-left: 1.5rem; 27 | text-decoration: none; 28 | } 29 | 30 | .top-row ::deep a:hover, .top-row ::deep .btn-link:hover { 31 | text-decoration: underline; 32 | } 33 | 34 | .top-row ::deep a:first-child { 35 | overflow: hidden; 36 | text-overflow: ellipsis; 37 | } 38 | 39 | @media (max-width: 640.98px) { 40 | .top-row:not(.auth) { 41 | display: none; 42 | } 43 | 44 | .top-row.auth { 45 | justify-content: space-between; 46 | } 47 | 48 | .top-row ::deep a, .top-row ::deep .btn-link { 49 | margin-left: 0; 50 | } 51 | } 52 | 53 | @media (min-width: 641px) { 54 | .page { 55 | flex-direction: row; 56 | } 57 | 58 | .sidebar { 59 | width: 250px; 60 | height: 100vh; 61 | position: sticky; 62 | top: 0; 63 | } 64 | 65 | .top-row { 66 | position: sticky; 67 | top: 0; 68 | z-index: 1; 69 | } 70 | 71 | .top-row.auth ::deep a:first-child { 72 | flex: 1; 73 | text-align: right; 74 | width: 0; 75 | } 76 | 77 | .top-row, article { 78 | padding-left: 2rem !important; 79 | padding-right: 1.5rem !important; 80 | } 81 | } 82 | 83 | #blazor-error-ui { 84 | background: lightyellow; 85 | bottom: 0; 86 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 87 | display: none; 88 | left: 0; 89 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 90 | position: fixed; 91 | width: 100%; 92 | z-index: 1000; 93 | } 94 | 95 | #blazor-error-ui .dismiss { 96 | cursor: pointer; 97 | position: absolute; 98 | right: 0.75rem; 99 | top: 0.5rem; 100 | } 101 | -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Store/Components/Layout/NavMenu.razor: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 31 | -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Store/Components/Pages/Home.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 | Home 4 | 5 |

Home

6 | 7 | Welcome to the best e-commerce platform in the world - eShopLite! 8 | -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Store/Components/Pages/Products.razor: -------------------------------------------------------------------------------- 1 | @page "/products" 2 | @using DataEntities 3 | @using Store.Services 4 | @inject ProductService ProductService 5 | @inject IConfiguration Configuration 6 | @attribute [StreamRendering(true)] 7 | 8 | Products 9 | 10 |

Products

11 | 12 |

Here are some of our amazing outdoor products that you can purchase.

13 | 14 | @if (products == null) 15 | { 16 |

Loading...

17 | } 18 | else 19 | { 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | @foreach (var product in products) 31 | { 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | } 40 | 41 |
ImageNameDescriptionPrice
@product.Name@product.Description@product.Price
42 | } 43 | 44 | @code { 45 | private List? products; 46 | 47 | protected override async Task OnInitializedAsync() 48 | { 49 | // Simulate asynchronous loading to demonstrate streaming rendering 50 | await Task.Delay(500); 51 | products = await ProductService.GetProducts(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Store/Components/Pages/Search.razor: -------------------------------------------------------------------------------- 1 | @page "/search" 2 | 3 | @inject Store.Services.ProductService ProductService 4 | @inject IConfiguration Configuration 5 | @attribute [StreamRendering(true)] 6 | @rendermode InteractiveServer 7 | 8 | Search Products 9 | 10 |

Search Products

11 | 12 |

Search our amazing outdoor products that you can purchase.

13 | 14 |
15 | 16 |
17 | 18 | 19 |
20 |
21 |

@aiResponse

22 | 23 | @* Uncomment this to show elapsed time *@ 24 | @*

Elapsed Time: [@elapsedTime]

*@ 25 |
26 | 27 | @if (products == null) 28 | { 29 |

Loading...

30 | } 31 | else 32 | { 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | @foreach (var product in products) 44 | { 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | } 53 | 54 |
ImageNameDescriptionPrice
@product.Name@product.Description@product.Price
55 | } 56 | 57 | @code { 58 | private string searchTerm = ""; 59 | private List? products; 60 | private string aiResponse = ""; 61 | private string elapsedTime = ""; 62 | 63 | private async Task DoSearch(MouseEventArgs e) 64 | { 65 | await Task.Delay(500); 66 | var response = await ProductService.Search(searchTerm); 67 | aiResponse = response.Response; 68 | products = response.Products; 69 | elapsedTime = response.ElapsedTime.ToString(); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Store/Components/Routes.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Store/Components/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using Microsoft.AspNetCore.Components.Web.Virtualization 7 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 8 | @using Microsoft.JSInterop 9 | @using Store 10 | @using Store.Components 11 | -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Store/Program.cs: -------------------------------------------------------------------------------- 1 | using Store.Components; 2 | using Store.Services; 3 | 4 | var builder = WebApplication.CreateBuilder(args); 5 | 6 | builder.Services.AddSingleton(); 7 | builder.Services.AddHttpClient(c => 8 | { 9 | var url = builder.Configuration["ProductEndpoint"] ?? throw new InvalidOperationException("ProductEndpoint is not set"); 10 | 11 | c.BaseAddress = new(url); 12 | }); 13 | 14 | // Add services to the container. 15 | builder.Services.AddRazorComponents() 16 | .AddInteractiveServerComponents(); 17 | 18 | var app = builder.Build(); 19 | 20 | // Configure the HTTP request pipeline. 21 | if (!app.Environment.IsDevelopment()) 22 | { 23 | app.UseExceptionHandler("/Error", createScopeForErrors: true); 24 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 25 | app.UseHsts(); 26 | } 27 | 28 | app.UseHttpsRedirection(); 29 | 30 | app.UseStaticFiles(); 31 | app.UseAntiforgery(); 32 | 33 | app.MapRazorComponents() 34 | .AddInteractiveServerRenderMode(); 35 | 36 | app.Run(); 37 | -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Store/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:38240", 8 | "sslPort": 44332 9 | } 10 | }, 11 | "profiles": { 12 | "http": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "launchBrowser": true, 16 | "applicationUrl": "http://localhost:5158", 17 | "environmentVariables": { 18 | "ASPNETCORE_ENVIRONMENT": "Development" 19 | } 20 | }, 21 | "https": { 22 | "commandName": "Project", 23 | "dotnetRunMessages": true, 24 | "launchBrowser": true, 25 | "applicationUrl": "https://localhost:7085;http://localhost:5158", 26 | "environmentVariables": { 27 | "ASPNETCORE_ENVIRONMENT": "Development" 28 | } 29 | }, 30 | "IIS Express": { 31 | "commandName": "IISExpress", 32 | "launchBrowser": true, 33 | "environmentVariables": { 34 | "ASPNETCORE_ENVIRONMENT": "Development" 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Store/Services/ProductService.cs: -------------------------------------------------------------------------------- 1 | using SearchEntities; 2 | using DataEntities; 3 | using System.Text.Json; 4 | 5 | namespace Store.Services; 6 | 7 | public class ProductService 8 | { 9 | HttpClient httpClient; 10 | private readonly ILogger _logger; 11 | 12 | public ProductService(HttpClient httpClient, ILogger logger) 13 | { 14 | _logger = logger; 15 | this.httpClient = httpClient; 16 | } 17 | public async Task> GetProducts() 18 | { 19 | List? products = null; 20 | try 21 | { 22 | var response = await httpClient.GetAsync("/api/product"); 23 | var responseText = await response.Content.ReadAsStringAsync(); 24 | 25 | _logger.LogInformation($"Http status code: {response.StatusCode}"); 26 | _logger.LogInformation($"Http response content: {responseText}"); 27 | 28 | if (response.IsSuccessStatusCode) 29 | { 30 | var options = new JsonSerializerOptions 31 | { 32 | PropertyNameCaseInsensitive = true 33 | }; 34 | 35 | products = await response.Content.ReadFromJsonAsync(ProductSerializerContext.Default.ListProduct); 36 | } 37 | } 38 | catch (Exception ex) 39 | { 40 | _logger.LogError(ex, "Error during GetProducts."); 41 | } 42 | 43 | return products ?? new List(); 44 | } 45 | 46 | public async Task Search(string searchTerm) 47 | { 48 | try 49 | { 50 | // call the AI Endpoint 51 | var response = await httpClient.GetAsync($"/api/aisearch/{searchTerm}"); 52 | 53 | // var response = await httpClient.GetAsync($"/api/product/search/{searchTerm}"); 54 | 55 | var responseText = await response.Content.ReadAsStringAsync(); 56 | 57 | _logger.LogInformation($"Http status code: {response.StatusCode}"); 58 | _logger.LogInformation($"Http response content: {responseText}"); 59 | 60 | if (response.IsSuccessStatusCode) 61 | { 62 | return await response.Content.ReadFromJsonAsync(); 63 | } 64 | } 65 | catch (Exception ex) 66 | { 67 | _logger.LogError(ex, "Error during Search."); 68 | } 69 | 70 | return new SearchResponse { Response = "No response" }; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Store/Store.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | preview 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Store/Store.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | https 5 | 6 | -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Store/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft.AspNetCore": "Warning" 7 | } 8 | }, 9 | "AllowedHosts": "*", 10 | "ProductEndpoint": "http://localhost:5228/", 11 | "ProductEndpointHttps": "" 12 | } 13 | -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Store/wwwroot/app.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 3 | } 4 | 5 | h1:focus { 6 | outline: none; 7 | } 8 | 9 | a, .btn-link { 10 | color: #0071c1; 11 | } 12 | 13 | .btn-primary { 14 | color: #fff; 15 | background-color: #1b6ec2; 16 | border-color: #1861ac; 17 | } 18 | 19 | .btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus { 20 | box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb; 21 | } 22 | 23 | .content { 24 | padding-top: 1.1rem; 25 | } 26 | 27 | .valid.modified:not([type=checkbox]) { 28 | outline: 1px solid #26b050; 29 | } 30 | 31 | .invalid { 32 | outline: 1px solid red; 33 | } 34 | 35 | .validation-message { 36 | color: red; 37 | } 38 | 39 | .blazor-error-boundary { 40 | background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121; 41 | padding: 1rem 1rem 1rem 3.7rem; 42 | color: white; 43 | } 44 | 45 | .blazor-error-boundary::after { 46 | content: "An error has occurred." 47 | } 48 | -------------------------------------------------------------------------------- /src/src BackUp/00 initial/Store/wwwroot/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/00 initial/Store/wwwroot/favicon.png -------------------------------------------------------------------------------- /src/src BackUp/00 initial/eShopLite.slnLaunch.user: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Name": "New Profile", 4 | "Projects": [ 5 | { 6 | "Path": "Products\\Products.csproj", 7 | "Action": "Start" 8 | }, 9 | { 10 | "Path": "Store\\Store.csproj", 11 | "Action": "Start" 12 | } 13 | ] 14 | } 15 | ] -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | 3 | # CS8602: Dereference of a possibly null reference. 4 | dotnet_diagnostic.CS8602.severity = silent 5 | 6 | # IDE0058: Expression value is never used 7 | dotnet_diagnostic.IDE0058.severity = silent 8 | -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/DataEntities/DataEntities.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/DataEntities/Product.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace DataEntities; 4 | 5 | public class Product 6 | { 7 | 8 | public Product() 9 | { 10 | Id = 0; 11 | Name = "not defined"; 12 | Description = "not defined"; 13 | Price = 0; 14 | ImageUrl = "not defined"; 15 | } 16 | 17 | [JsonPropertyName("id")] 18 | public int Id { get; set; } 19 | 20 | [JsonPropertyName("name")] 21 | public string? Name { get; set; } 22 | 23 | [JsonPropertyName("description")] 24 | public string? Description { get; set; } 25 | 26 | [JsonPropertyName("price")] 27 | public decimal Price { get; set; } 28 | 29 | [JsonPropertyName("imageUrl")] 30 | public string? ImageUrl { get; set; } 31 | } 32 | 33 | 34 | [JsonSerializable(typeof(List))] 35 | public sealed partial class ProductSerializerContext : JsonSerializerContext 36 | { 37 | } -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Products/.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "dotnet-ef": { 6 | "version": "8.0.0-rc.1.23419.6", 7 | "commands": [ 8 | "dotnet-ef" 9 | ] 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Products/Database.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/01 AISearch Code Complete/Products/Database.db -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Products/Database.db-shm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/01 AISearch Code Complete/Products/Database.db-shm -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Products/Database.db-wal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/01 AISearch Code Complete/Products/Database.db-wal -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Products/Products.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | true 8 | 000aa9d1-8ada-4ab7-9b97-678cf3132ce5 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | all 32 | runtime; build; native; contentfiles; analyzers; buildtransitive 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | PreserveNewest 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Products/Products.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | https 5 | 6 | -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Products/Products.http: -------------------------------------------------------------------------------- 1 | @HostAddress = http://localhost:5228 2 | 3 | GET {{HostAddress}}/api/Product 4 | Accept: application/json 5 | 6 | ### 7 | -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Products/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Products.Data; 3 | using Products.Endpoints; 4 | using Products.Memory; 5 | 6 | var builder = WebApplication.CreateBuilder(args); 7 | builder.Services.AddDbContext(options => 8 | options.UseSqlite(builder.Configuration.GetConnectionString("ProductsContext") ?? throw new InvalidOperationException("Connection string 'ProductsContext' not found."))); 9 | 10 | builder.Services.AddSingleton(sp => 11 | { 12 | return builder.Configuration; 13 | }); 14 | 15 | // add memory context 16 | builder.AddSemanticKernel(); 17 | 18 | builder.AddAzureAI(); 19 | 20 | // Add services to the container. 21 | var app = builder.Build(); 22 | 23 | // Configure the HTTP request pipeline. 24 | app.UseHttpsRedirection(); 25 | 26 | app.MapProductEndpoints(); 27 | 28 | app.UseStaticFiles(); 29 | 30 | app.CreateDbIfNotExists(); 31 | 32 | // init semantic memory 33 | await app.InitSemanticMemoryAsync(); 34 | 35 | app.Run(); 36 | -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Products/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:49179", 8 | "sslPort": 44375 9 | } 10 | }, 11 | "profiles": { 12 | "http": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "launchBrowser": true, 16 | "launchUrl": "api/Product", 17 | "applicationUrl": "http://localhost:5228", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development" 20 | } 21 | }, 22 | "https": { 23 | "commandName": "Project", 24 | "dotnetRunMessages": true, 25 | "launchBrowser": true, 26 | "launchUrl": "api/Product", 27 | "applicationUrl": "https://localhost:7130;http://localhost:5228", 28 | "environmentVariables": { 29 | "ASPNETCORE_ENVIRONMENT": "Development" 30 | } 31 | }, 32 | "IIS Express": { 33 | "commandName": "IISExpress", 34 | "launchBrowser": true, 35 | "launchUrl": "api/Product", 36 | "environmentVariables": { 37 | "ASPNETCORE_ENVIRONMENT": "Development" 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Products/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "ConnectionStrings": { 10 | "ProductsContext": "Data Source=Database.db" 11 | } 12 | } -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Products/wwwroot/images/product1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/01 AISearch Code Complete/Products/wwwroot/images/product1.png -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Products/wwwroot/images/product2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/01 AISearch Code Complete/Products/wwwroot/images/product2.png -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Products/wwwroot/images/product3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/01 AISearch Code Complete/Products/wwwroot/images/product3.png -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Products/wwwroot/images/product4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/01 AISearch Code Complete/Products/wwwroot/images/product4.png -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Products/wwwroot/images/product5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/01 AISearch Code Complete/Products/wwwroot/images/product5.png -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Products/wwwroot/images/product6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/01 AISearch Code Complete/Products/wwwroot/images/product6.png -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Products/wwwroot/images/product7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/01 AISearch Code Complete/Products/wwwroot/images/product7.png -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Products/wwwroot/images/product8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/01 AISearch Code Complete/Products/wwwroot/images/product8.png -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Products/wwwroot/images/product9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/01 AISearch Code Complete/Products/wwwroot/images/product9.png -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/SearchEntities/SearchEntities.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | net9.0 9 | enable 10 | enable 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/SearchEntities/SearchResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace SearchEntities; 4 | 5 | public class SearchResponse 6 | { 7 | [JsonPropertyName("id")] 8 | public string? Response { get; set; } 9 | 10 | [JsonPropertyName("products")] 11 | public List? Products { get; set; } 12 | 13 | [JsonPropertyName("elapsedtime")] 14 | public TimeSpan ElapsedTime { get; set; } 15 | } 16 | 17 | 18 | [JsonSerializable(typeof(SearchResponse))] 19 | public sealed partial class SearchResponseSerializerContext : JsonSerializerContext 20 | { 21 | } -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Store/Components/App.razor: -------------------------------------------------------------------------------- 1 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Store/Components/Layout/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 |
4 | 7 | 8 |
9 |
10 | About 11 |
12 | 13 |
14 | @Body 15 |
16 |
17 |
18 | 19 |
20 | An unhandled error has occurred. 21 | Reload 22 | 🗙 23 |
24 | -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Store/Components/Layout/MainLayout.razor.css: -------------------------------------------------------------------------------- 1 | .page { 2 | position: relative; 3 | display: flex; 4 | flex-direction: column; 5 | } 6 | 7 | main { 8 | flex: 1; 9 | } 10 | 11 | .sidebar { 12 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 13 | } 14 | 15 | .top-row { 16 | background-color: #f7f7f7; 17 | border-bottom: 1px solid #d6d5d5; 18 | justify-content: flex-end; 19 | height: 3.5rem; 20 | display: flex; 21 | align-items: center; 22 | } 23 | 24 | .top-row ::deep a, .top-row ::deep .btn-link { 25 | white-space: nowrap; 26 | margin-left: 1.5rem; 27 | text-decoration: none; 28 | } 29 | 30 | .top-row ::deep a:hover, .top-row ::deep .btn-link:hover { 31 | text-decoration: underline; 32 | } 33 | 34 | .top-row ::deep a:first-child { 35 | overflow: hidden; 36 | text-overflow: ellipsis; 37 | } 38 | 39 | @media (max-width: 640.98px) { 40 | .top-row:not(.auth) { 41 | display: none; 42 | } 43 | 44 | .top-row.auth { 45 | justify-content: space-between; 46 | } 47 | 48 | .top-row ::deep a, .top-row ::deep .btn-link { 49 | margin-left: 0; 50 | } 51 | } 52 | 53 | @media (min-width: 641px) { 54 | .page { 55 | flex-direction: row; 56 | } 57 | 58 | .sidebar { 59 | width: 250px; 60 | height: 100vh; 61 | position: sticky; 62 | top: 0; 63 | } 64 | 65 | .top-row { 66 | position: sticky; 67 | top: 0; 68 | z-index: 1; 69 | } 70 | 71 | .top-row.auth ::deep a:first-child { 72 | flex: 1; 73 | text-align: right; 74 | width: 0; 75 | } 76 | 77 | .top-row, article { 78 | padding-left: 2rem !important; 79 | padding-right: 1.5rem !important; 80 | } 81 | } 82 | 83 | #blazor-error-ui { 84 | background: lightyellow; 85 | bottom: 0; 86 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 87 | display: none; 88 | left: 0; 89 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 90 | position: fixed; 91 | width: 100%; 92 | z-index: 1000; 93 | } 94 | 95 | #blazor-error-ui .dismiss { 96 | cursor: pointer; 97 | position: absolute; 98 | right: 0.75rem; 99 | top: 0.5rem; 100 | } 101 | -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Store/Components/Layout/NavMenu.razor: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 31 | -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Store/Components/Pages/Home.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 | Home 4 | 5 |

Home

6 | 7 | Welcome to the best e-commerce platform in the world - eShopLite! 8 | -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Store/Components/Pages/Products.razor: -------------------------------------------------------------------------------- 1 | @page "/products" 2 | @using DataEntities 3 | @using Store.Services 4 | @inject ProductService ProductService 5 | @inject IConfiguration Configuration 6 | @attribute [StreamRendering(true)] 7 | 8 | Products 9 | 10 |

Products

11 | 12 |

Here are some of our amazing outdoor products that you can purchase.

13 | 14 | @if (products == null) 15 | { 16 |

Loading...

17 | } 18 | else 19 | { 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | @foreach (var product in products) 31 | { 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | } 40 | 41 |
ImageNameDescriptionPrice
@product.Name@product.Description@product.Price
42 | } 43 | 44 | @code { 45 | private List? products; 46 | 47 | protected override async Task OnInitializedAsync() 48 | { 49 | // Simulate asynchronous loading to demonstrate streaming rendering 50 | await Task.Delay(500); 51 | products = await ProductService.GetProducts(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Store/Components/Pages/Search.razor: -------------------------------------------------------------------------------- 1 | @page "/search" 2 | 3 | @inject Store.Services.ProductService ProductService 4 | @inject IConfiguration Configuration 5 | @attribute [StreamRendering(true)] 6 | @rendermode InteractiveServer 7 | 8 | Search Products 9 | 10 |

Search Products

11 | 12 |

Search our amazing outdoor products that you can purchase.

13 | 14 |
15 | 16 |
17 | 18 | 19 |
20 |
21 |

@aiResponse

22 | 23 | @* Uncomment this to show elapsed time *@ 24 | @*

Elapsed Time: [@elapsedTime]

*@ 25 |
26 | 27 | @if (products == null) 28 | { 29 |

Loading...

30 | } 31 | else 32 | { 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | @foreach (var product in products) 44 | { 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | } 53 | 54 |
ImageNameDescriptionPrice
@product.Name@product.Description@product.Price
55 | } 56 | 57 | @code { 58 | private string searchTerm = ""; 59 | private List? products; 60 | private string aiResponse = ""; 61 | private string elapsedTime = ""; 62 | 63 | private async Task DoSearch(MouseEventArgs e) 64 | { 65 | await Task.Delay(500); 66 | var response = await ProductService.Search(searchTerm); 67 | aiResponse = response.Response; 68 | products = response.Products; 69 | elapsedTime = response.ElapsedTime.ToString(); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Store/Components/Routes.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Store/Components/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using Microsoft.AspNetCore.Components.Web.Virtualization 7 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 8 | @using Microsoft.JSInterop 9 | @using Store 10 | @using Store.Components 11 | -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Store/Program.cs: -------------------------------------------------------------------------------- 1 | using Store.Components; 2 | using Store.Services; 3 | 4 | var builder = WebApplication.CreateBuilder(args); 5 | 6 | builder.Services.AddSingleton(); 7 | builder.Services.AddHttpClient(c => 8 | { 9 | var url = builder.Configuration["ProductEndpoint"] ?? throw new InvalidOperationException("ProductEndpoint is not set"); 10 | 11 | c.BaseAddress = new(url); 12 | }); 13 | 14 | // Add services to the container. 15 | builder.Services.AddRazorComponents() 16 | .AddInteractiveServerComponents(); 17 | 18 | var app = builder.Build(); 19 | 20 | // Configure the HTTP request pipeline. 21 | if (!app.Environment.IsDevelopment()) 22 | { 23 | app.UseExceptionHandler("/Error", createScopeForErrors: true); 24 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 25 | app.UseHsts(); 26 | } 27 | 28 | app.UseHttpsRedirection(); 29 | 30 | app.UseStaticFiles(); 31 | app.UseAntiforgery(); 32 | 33 | app.MapRazorComponents() 34 | .AddInteractiveServerRenderMode(); 35 | 36 | app.Run(); 37 | -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Store/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:38240", 8 | "sslPort": 44332 9 | } 10 | }, 11 | "profiles": { 12 | "http": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "launchBrowser": true, 16 | "applicationUrl": "http://localhost:5158", 17 | "environmentVariables": { 18 | "ASPNETCORE_ENVIRONMENT": "Development" 19 | } 20 | }, 21 | "https": { 22 | "commandName": "Project", 23 | "dotnetRunMessages": true, 24 | "launchBrowser": true, 25 | "applicationUrl": "https://localhost:7085;http://localhost:5158", 26 | "environmentVariables": { 27 | "ASPNETCORE_ENVIRONMENT": "Development" 28 | } 29 | }, 30 | "IIS Express": { 31 | "commandName": "IISExpress", 32 | "launchBrowser": true, 33 | "environmentVariables": { 34 | "ASPNETCORE_ENVIRONMENT": "Development" 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Store/Services/ProductService.cs: -------------------------------------------------------------------------------- 1 | using SearchEntities; 2 | using DataEntities; 3 | using System.Text.Json; 4 | 5 | namespace Store.Services; 6 | 7 | public class ProductService 8 | { 9 | HttpClient httpClient; 10 | private readonly ILogger _logger; 11 | 12 | public ProductService(HttpClient httpClient, ILogger logger) 13 | { 14 | _logger = logger; 15 | this.httpClient = httpClient; 16 | } 17 | public async Task> GetProducts() 18 | { 19 | List? products = null; 20 | try 21 | { 22 | var response = await httpClient.GetAsync("/api/product"); 23 | var responseText = await response.Content.ReadAsStringAsync(); 24 | 25 | _logger.LogInformation($"Http status code: {response.StatusCode}"); 26 | _logger.LogInformation($"Http response content: {responseText}"); 27 | 28 | if (response.IsSuccessStatusCode) 29 | { 30 | var options = new JsonSerializerOptions 31 | { 32 | PropertyNameCaseInsensitive = true 33 | }; 34 | 35 | products = await response.Content.ReadFromJsonAsync(ProductSerializerContext.Default.ListProduct); 36 | } 37 | } 38 | catch (Exception ex) 39 | { 40 | _logger.LogError(ex, "Error during GetProducts."); 41 | } 42 | 43 | return products ?? new List(); 44 | } 45 | 46 | public async Task Search(string searchTerm) 47 | { 48 | try 49 | { 50 | // call the AI Endpoint 51 | var response = await httpClient.GetAsync($"/api/aisearch/{searchTerm}"); 52 | 53 | // var response = await httpClient.GetAsync($"/api/product/search/{searchTerm}"); 54 | 55 | var responseText = await response.Content.ReadAsStringAsync(); 56 | 57 | _logger.LogInformation($"Http status code: {response.StatusCode}"); 58 | _logger.LogInformation($"Http response content: {responseText}"); 59 | 60 | if (response.IsSuccessStatusCode) 61 | { 62 | return await response.Content.ReadFromJsonAsync(); 63 | } 64 | } 65 | catch (Exception ex) 66 | { 67 | _logger.LogError(ex, "Error during Search."); 68 | } 69 | 70 | return new SearchResponse { Response = "No response" }; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Store/Store.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | preview 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Store/Store.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | https 5 | 6 | -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Store/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft.AspNetCore": "Warning" 7 | } 8 | }, 9 | "AllowedHosts": "*", 10 | "ProductEndpoint": "http://localhost:5228/", 11 | "ProductEndpointHttps": "" 12 | } 13 | -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Store/wwwroot/app.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 3 | } 4 | 5 | h1:focus { 6 | outline: none; 7 | } 8 | 9 | a, .btn-link { 10 | color: #0071c1; 11 | } 12 | 13 | .btn-primary { 14 | color: #fff; 15 | background-color: #1b6ec2; 16 | border-color: #1861ac; 17 | } 18 | 19 | .btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus { 20 | box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb; 21 | } 22 | 23 | .content { 24 | padding-top: 1.1rem; 25 | } 26 | 27 | .valid.modified:not([type=checkbox]) { 28 | outline: 1px solid #26b050; 29 | } 30 | 31 | .invalid { 32 | outline: 1px solid red; 33 | } 34 | 35 | .validation-message { 36 | color: red; 37 | } 38 | 39 | .blazor-error-boundary { 40 | background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121; 41 | padding: 1rem 1rem 1rem 3.7rem; 42 | color: white; 43 | } 44 | 45 | .blazor-error-boundary::after { 46 | content: "An error has occurred." 47 | } 48 | -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/Store/wwwroot/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/01 AISearch Code Complete/Store/wwwroot/favicon.png -------------------------------------------------------------------------------- /src/src BackUp/01 AISearch Code Complete/eShopLite.slnLaunch.user: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Name": "New Profile", 4 | "Projects": [ 5 | { 6 | "Path": "Products\\Products.csproj", 7 | "Action": "Start" 8 | }, 9 | { 10 | "Path": "Store\\Store.csproj", 11 | "Action": "Start" 12 | } 13 | ] 14 | } 15 | ] -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | 3 | # CS8602: Dereference of a possibly null reference. 4 | dotnet_diagnostic.CS8602.severity = silent 5 | 6 | # IDE0058: Expression value is never used 7 | dotnet_diagnostic.IDE0058.severity = silent 8 | -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "prompty.currentModelConfiguration": "GPT-4o-mini-CANET" 3 | } -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/DataEntities/DataEntities.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/DataEntities/Product.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace DataEntities; 4 | 5 | public class Product 6 | { 7 | 8 | public Product() 9 | { 10 | Id = 0; 11 | Name = "not defined"; 12 | Description = "not defined"; 13 | Price = 0; 14 | ImageUrl = "not defined"; 15 | } 16 | 17 | [JsonPropertyName("id")] 18 | public int Id { get; set; } 19 | 20 | [JsonPropertyName("name")] 21 | public string? Name { get; set; } 22 | 23 | [JsonPropertyName("description")] 24 | public string? Description { get; set; } 25 | 26 | [JsonPropertyName("price")] 27 | public decimal Price { get; set; } 28 | 29 | [JsonPropertyName("imageUrl")] 30 | public string? ImageUrl { get; set; } 31 | } 32 | 33 | 34 | [JsonSerializable(typeof(List))] 35 | public sealed partial class ProductSerializerContext : JsonSerializerContext 36 | { 37 | } -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Products/.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "dotnet-ef": { 6 | "version": "8.0.0-rc.1.23419.6", 7 | "commands": [ 8 | "dotnet-ef" 9 | ] 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Products/Database.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/02 Prompty Done/Products/Database.db -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Products/Database.db-shm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/02 Prompty Done/Products/Database.db-shm -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Products/Database.db-wal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/02 Prompty Done/Products/Database.db-wal -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Products/Products.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | true 8 | 000aa9d1-8ada-4ab7-9b97-678cf3132ce5 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | all 32 | runtime; build; native; contentfiles; analyzers; buildtransitive 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | PreserveNewest 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Products/Products.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | https 5 | 6 | -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Products/Products.http: -------------------------------------------------------------------------------- 1 | @HostAddress = http://localhost:5228 2 | 3 | GET {{HostAddress}}/api/Product 4 | Accept: application/json 5 | 6 | ### 7 | -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Products/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Products.Data; 3 | using Products.Endpoints; 4 | using Products.Memory; 5 | 6 | var builder = WebApplication.CreateBuilder(args); 7 | builder.Services.AddDbContext(options => 8 | options.UseSqlite(builder.Configuration.GetConnectionString("ProductsContext") ?? throw new InvalidOperationException("Connection string 'ProductsContext' not found."))); 9 | 10 | builder.Services.AddSingleton(sp => 11 | { 12 | return builder.Configuration; 13 | }); 14 | 15 | // add memory context 16 | builder.AddSemanticKernel(); 17 | 18 | builder.AddAzureAI(); 19 | 20 | // Add services to the container. 21 | var app = builder.Build(); 22 | 23 | // Configure the HTTP request pipeline. 24 | app.UseHttpsRedirection(); 25 | 26 | app.MapProductEndpoints(); 27 | 28 | app.UseStaticFiles(); 29 | 30 | app.CreateDbIfNotExists(); 31 | 32 | // init semantic memory 33 | await app.InitSemanticMemoryAsync(); 34 | 35 | app.Run(); 36 | -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Products/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:49179", 8 | "sslPort": 44375 9 | } 10 | }, 11 | "profiles": { 12 | "http": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "launchBrowser": true, 16 | "launchUrl": "api/Product", 17 | "applicationUrl": "http://localhost:5228", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development" 20 | } 21 | }, 22 | "https": { 23 | "commandName": "Project", 24 | "dotnetRunMessages": true, 25 | "launchBrowser": true, 26 | "launchUrl": "api/Product", 27 | "applicationUrl": "https://localhost:7130;http://localhost:5228", 28 | "environmentVariables": { 29 | "ASPNETCORE_ENVIRONMENT": "Development" 30 | } 31 | }, 32 | "IIS Express": { 33 | "commandName": "IISExpress", 34 | "launchBrowser": true, 35 | "launchUrl": "api/Product", 36 | "environmentVariables": { 37 | "ASPNETCORE_ENVIRONMENT": "Development" 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Products/aisearchresponse.prompty: -------------------------------------------------------------------------------- 1 | --- 2 | name: ai_search_detailed_response 3 | description: A prompt that responses a query from an user about a topic in the context of a product. 4 | authors: 5 | - Bruno Capuano 6 | model: 7 | api: chat 8 | configuration: 9 | type: azure_openai 10 | azure_endpoint: ${env:AZURE_OPENAI_ENDPOINT} 11 | azure_deployment: ${env:AZURE_OPENAI_MODEL} 12 | parameters: 13 | max_tokens: 3000 14 | sample: 15 | question: > 16 | What do you suggest for a rainy day in the beach? 17 | productid: > 18 | 10 19 | productname: > 20 | Tent Ultimate plus plus 21 | productdescription: > 22 | This tent is perfect for camping trips and to also be used in the beach in rainy days 23 | productprice: > 24 | 99.99 25 | --- 26 | 27 | system: 28 | You are an intelligent assistant helping Contoso Inc clients with their search about outdoor product. 29 | Use 'you' to refer to the individual asking the questions even if they ask with 'I'. 30 | Answer the questions using only the data provided related to a product in the response below. 31 | Do not include the product id. 32 | Do not return markdown format. Do not return HTML format. 33 | If you cannot answer using the information below, say you don't know. 34 | As the assistant, you generate descriptions using a funny style and even add some personal flair with appropriate emojis. 35 | 36 | # Context 37 | Generate and answer to the question using the information below. 38 | Incorporate the question if provided: {{question}} 39 | Always incorporate the product name, description, and price in the response. 40 | +++++ 41 | product id: {{productid}} 42 | product name: {{productname}} 43 | product description: {{productdescription}} 44 | product price: {{productprice}} 45 | +++++ 46 | 47 | -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Products/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "ConnectionStrings": { 10 | "ProductsContext": "Data Source=Database.db" 11 | } 12 | } -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Products/wwwroot/images/product1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/02 Prompty Done/Products/wwwroot/images/product1.png -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Products/wwwroot/images/product2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/02 Prompty Done/Products/wwwroot/images/product2.png -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Products/wwwroot/images/product3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/02 Prompty Done/Products/wwwroot/images/product3.png -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Products/wwwroot/images/product4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/02 Prompty Done/Products/wwwroot/images/product4.png -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Products/wwwroot/images/product5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/02 Prompty Done/Products/wwwroot/images/product5.png -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Products/wwwroot/images/product6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/02 Prompty Done/Products/wwwroot/images/product6.png -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Products/wwwroot/images/product7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/02 Prompty Done/Products/wwwroot/images/product7.png -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Products/wwwroot/images/product8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/02 Prompty Done/Products/wwwroot/images/product8.png -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Products/wwwroot/images/product9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/02 Prompty Done/Products/wwwroot/images/product9.png -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/SearchEntities/SearchEntities.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | net9.0 9 | enable 10 | enable 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/SearchEntities/SearchResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace SearchEntities; 4 | 5 | public class SearchResponse 6 | { 7 | [JsonPropertyName("id")] 8 | public string? Response { get; set; } 9 | 10 | [JsonPropertyName("products")] 11 | public List? Products { get; set; } 12 | 13 | [JsonPropertyName("elapsedtime")] 14 | public TimeSpan ElapsedTime { get; set; } 15 | } 16 | 17 | 18 | [JsonSerializable(typeof(SearchResponse))] 19 | public sealed partial class SearchResponseSerializerContext : JsonSerializerContext 20 | { 21 | } -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Store/Components/App.razor: -------------------------------------------------------------------------------- 1 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Store/Components/Layout/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 |
4 | 7 | 8 |
9 |
10 | About 11 |
12 | 13 |
14 | @Body 15 |
16 |
17 |
18 | 19 |
20 | An unhandled error has occurred. 21 | Reload 22 | 🗙 23 |
24 | -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Store/Components/Layout/MainLayout.razor.css: -------------------------------------------------------------------------------- 1 | .page { 2 | position: relative; 3 | display: flex; 4 | flex-direction: column; 5 | } 6 | 7 | main { 8 | flex: 1; 9 | } 10 | 11 | .sidebar { 12 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 13 | } 14 | 15 | .top-row { 16 | background-color: #f7f7f7; 17 | border-bottom: 1px solid #d6d5d5; 18 | justify-content: flex-end; 19 | height: 3.5rem; 20 | display: flex; 21 | align-items: center; 22 | } 23 | 24 | .top-row ::deep a, .top-row ::deep .btn-link { 25 | white-space: nowrap; 26 | margin-left: 1.5rem; 27 | text-decoration: none; 28 | } 29 | 30 | .top-row ::deep a:hover, .top-row ::deep .btn-link:hover { 31 | text-decoration: underline; 32 | } 33 | 34 | .top-row ::deep a:first-child { 35 | overflow: hidden; 36 | text-overflow: ellipsis; 37 | } 38 | 39 | @media (max-width: 640.98px) { 40 | .top-row:not(.auth) { 41 | display: none; 42 | } 43 | 44 | .top-row.auth { 45 | justify-content: space-between; 46 | } 47 | 48 | .top-row ::deep a, .top-row ::deep .btn-link { 49 | margin-left: 0; 50 | } 51 | } 52 | 53 | @media (min-width: 641px) { 54 | .page { 55 | flex-direction: row; 56 | } 57 | 58 | .sidebar { 59 | width: 250px; 60 | height: 100vh; 61 | position: sticky; 62 | top: 0; 63 | } 64 | 65 | .top-row { 66 | position: sticky; 67 | top: 0; 68 | z-index: 1; 69 | } 70 | 71 | .top-row.auth ::deep a:first-child { 72 | flex: 1; 73 | text-align: right; 74 | width: 0; 75 | } 76 | 77 | .top-row, article { 78 | padding-left: 2rem !important; 79 | padding-right: 1.5rem !important; 80 | } 81 | } 82 | 83 | #blazor-error-ui { 84 | background: lightyellow; 85 | bottom: 0; 86 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 87 | display: none; 88 | left: 0; 89 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 90 | position: fixed; 91 | width: 100%; 92 | z-index: 1000; 93 | } 94 | 95 | #blazor-error-ui .dismiss { 96 | cursor: pointer; 97 | position: absolute; 98 | right: 0.75rem; 99 | top: 0.5rem; 100 | } 101 | -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Store/Components/Layout/NavMenu.razor: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 31 | -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Store/Components/Pages/Home.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 | Home 4 | 5 |

Home

6 | 7 | Welcome to the best e-commerce platform in the world - eShopLite! 8 | -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Store/Components/Pages/Products.razor: -------------------------------------------------------------------------------- 1 | @page "/products" 2 | @using DataEntities 3 | @using Store.Services 4 | @inject ProductService ProductService 5 | @inject IConfiguration Configuration 6 | @attribute [StreamRendering(true)] 7 | 8 | Products 9 | 10 |

Products

11 | 12 |

Here are some of our amazing outdoor products that you can purchase.

13 | 14 | @if (products == null) 15 | { 16 |

Loading...

17 | } 18 | else 19 | { 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | @foreach (var product in products) 31 | { 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | } 40 | 41 |
ImageNameDescriptionPrice
@product.Name@product.Description@product.Price
42 | } 43 | 44 | @code { 45 | private List? products; 46 | 47 | protected override async Task OnInitializedAsync() 48 | { 49 | // Simulate asynchronous loading to demonstrate streaming rendering 50 | await Task.Delay(500); 51 | products = await ProductService.GetProducts(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Store/Components/Pages/Search.razor: -------------------------------------------------------------------------------- 1 | @page "/search" 2 | 3 | @inject Store.Services.ProductService ProductService 4 | @inject IConfiguration Configuration 5 | @attribute [StreamRendering(true)] 6 | @rendermode InteractiveServer 7 | 8 | Search Products 9 | 10 |

Search Products

11 | 12 |

Search our amazing outdoor products that you can purchase.

13 | 14 |
15 | 16 |
17 | 18 | 19 |
20 |
21 |

@aiResponse

22 | 23 | @* Uncomment this to show elapsed time *@ 24 | @*

Elapsed Time: [@elapsedTime]

*@ 25 |
26 | 27 | @if (products == null) 28 | { 29 |

Loading...

30 | } 31 | else 32 | { 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | @foreach (var product in products) 44 | { 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | } 53 | 54 |
ImageNameDescriptionPrice
@product.Name@product.Description@product.Price
55 | } 56 | 57 | @code { 58 | private string searchTerm = ""; 59 | private List? products; 60 | private string aiResponse = ""; 61 | private string elapsedTime = ""; 62 | 63 | private async Task DoSearch(MouseEventArgs e) 64 | { 65 | await Task.Delay(500); 66 | var response = await ProductService.Search(searchTerm); 67 | aiResponse = response.Response; 68 | products = response.Products; 69 | elapsedTime = response.ElapsedTime.ToString(); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Store/Components/Routes.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Store/Components/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using Microsoft.AspNetCore.Components.Web.Virtualization 7 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 8 | @using Microsoft.JSInterop 9 | @using Store 10 | @using Store.Components 11 | -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Store/Program.cs: -------------------------------------------------------------------------------- 1 | using Store.Components; 2 | using Store.Services; 3 | 4 | var builder = WebApplication.CreateBuilder(args); 5 | 6 | builder.Services.AddSingleton(); 7 | builder.Services.AddHttpClient(c => 8 | { 9 | var url = builder.Configuration["ProductEndpoint"] ?? throw new InvalidOperationException("ProductEndpoint is not set"); 10 | 11 | c.BaseAddress = new(url); 12 | }); 13 | 14 | // Add services to the container. 15 | builder.Services.AddRazorComponents() 16 | .AddInteractiveServerComponents(); 17 | 18 | var app = builder.Build(); 19 | 20 | // Configure the HTTP request pipeline. 21 | if (!app.Environment.IsDevelopment()) 22 | { 23 | app.UseExceptionHandler("/Error", createScopeForErrors: true); 24 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 25 | app.UseHsts(); 26 | } 27 | 28 | app.UseHttpsRedirection(); 29 | 30 | app.UseStaticFiles(); 31 | app.UseAntiforgery(); 32 | 33 | app.MapRazorComponents() 34 | .AddInteractiveServerRenderMode(); 35 | 36 | app.Run(); 37 | -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Store/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:38240", 8 | "sslPort": 44332 9 | } 10 | }, 11 | "profiles": { 12 | "http": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "launchBrowser": true, 16 | "applicationUrl": "http://localhost:5158", 17 | "environmentVariables": { 18 | "ASPNETCORE_ENVIRONMENT": "Development" 19 | } 20 | }, 21 | "https": { 22 | "commandName": "Project", 23 | "dotnetRunMessages": true, 24 | "launchBrowser": true, 25 | "applicationUrl": "https://localhost:7085;http://localhost:5158", 26 | "environmentVariables": { 27 | "ASPNETCORE_ENVIRONMENT": "Development" 28 | } 29 | }, 30 | "IIS Express": { 31 | "commandName": "IISExpress", 32 | "launchBrowser": true, 33 | "environmentVariables": { 34 | "ASPNETCORE_ENVIRONMENT": "Development" 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Store/Services/ProductService.cs: -------------------------------------------------------------------------------- 1 | using SearchEntities; 2 | using DataEntities; 3 | using System.Text.Json; 4 | 5 | namespace Store.Services; 6 | 7 | public class ProductService 8 | { 9 | HttpClient httpClient; 10 | private readonly ILogger _logger; 11 | 12 | public ProductService(HttpClient httpClient, ILogger logger) 13 | { 14 | _logger = logger; 15 | this.httpClient = httpClient; 16 | } 17 | public async Task> GetProducts() 18 | { 19 | List? products = null; 20 | try 21 | { 22 | var response = await httpClient.GetAsync("/api/product"); 23 | var responseText = await response.Content.ReadAsStringAsync(); 24 | 25 | _logger.LogInformation($"Http status code: {response.StatusCode}"); 26 | _logger.LogInformation($"Http response content: {responseText}"); 27 | 28 | if (response.IsSuccessStatusCode) 29 | { 30 | var options = new JsonSerializerOptions 31 | { 32 | PropertyNameCaseInsensitive = true 33 | }; 34 | 35 | products = await response.Content.ReadFromJsonAsync(ProductSerializerContext.Default.ListProduct); 36 | } 37 | } 38 | catch (Exception ex) 39 | { 40 | _logger.LogError(ex, "Error during GetProducts."); 41 | } 42 | 43 | return products ?? new List(); 44 | } 45 | 46 | public async Task Search(string searchTerm) 47 | { 48 | try 49 | { 50 | // call the AI Endpoint 51 | var response = await httpClient.GetAsync($"/api/aisearch/{searchTerm}"); 52 | 53 | // var response = await httpClient.GetAsync($"/api/product/search/{searchTerm}"); 54 | 55 | var responseText = await response.Content.ReadAsStringAsync(); 56 | 57 | _logger.LogInformation($"Http status code: {response.StatusCode}"); 58 | _logger.LogInformation($"Http response content: {responseText}"); 59 | 60 | if (response.IsSuccessStatusCode) 61 | { 62 | return await response.Content.ReadFromJsonAsync(); 63 | } 64 | } 65 | catch (Exception ex) 66 | { 67 | _logger.LogError(ex, "Error during Search."); 68 | } 69 | 70 | return new SearchResponse { Response = "No response" }; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Store/Store.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | preview 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Store/Store.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | https 5 | 6 | -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Store/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft.AspNetCore": "Warning" 7 | } 8 | }, 9 | "AllowedHosts": "*", 10 | "ProductEndpoint": "http://localhost:5228/", 11 | "ProductEndpointHttps": "" 12 | } 13 | -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Store/wwwroot/app.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 3 | } 4 | 5 | h1:focus { 6 | outline: none; 7 | } 8 | 9 | a, .btn-link { 10 | color: #0071c1; 11 | } 12 | 13 | .btn-primary { 14 | color: #fff; 15 | background-color: #1b6ec2; 16 | border-color: #1861ac; 17 | } 18 | 19 | .btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus { 20 | box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb; 21 | } 22 | 23 | .content { 24 | padding-top: 1.1rem; 25 | } 26 | 27 | .valid.modified:not([type=checkbox]) { 28 | outline: 1px solid #26b050; 29 | } 30 | 31 | .invalid { 32 | outline: 1px solid red; 33 | } 34 | 35 | .validation-message { 36 | color: red; 37 | } 38 | 39 | .blazor-error-boundary { 40 | background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121; 41 | padding: 1rem 1rem 1rem 3.7rem; 42 | color: white; 43 | } 44 | 45 | .blazor-error-boundary::after { 46 | content: "An error has occurred." 47 | } 48 | -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/Store/wwwroot/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/02 Prompty Done/Store/wwwroot/favicon.png -------------------------------------------------------------------------------- /src/src BackUp/02 Prompty Done/eShopLite.slnLaunch.user: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Name": "New Profile", 4 | "Projects": [ 5 | { 6 | "Path": "Products\\Products.csproj", 7 | "Action": "Start" 8 | }, 9 | { 10 | "Path": "Store\\Store.csproj", 11 | "Action": "Start" 12 | } 13 | ] 14 | } 15 | ] -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | 3 | # CS8602: Dereference of a possibly null reference. 4 | dotnet_diagnostic.CS8602.severity = silent 5 | 6 | # IDE0058: Expression value is never used 7 | dotnet_diagnostic.IDE0058.severity = silent 8 | -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/DataEntities/DataEntities.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/DataEntities/Product.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace DataEntities; 4 | 5 | public class Product 6 | { 7 | 8 | public Product() 9 | { 10 | Id = 0; 11 | Name = "not defined"; 12 | Description = "not defined"; 13 | Price = 0; 14 | ImageUrl = "not defined"; 15 | } 16 | 17 | [JsonPropertyName("id")] 18 | public int Id { get; set; } 19 | 20 | [JsonPropertyName("name")] 21 | public string? Name { get; set; } 22 | 23 | [JsonPropertyName("description")] 24 | public string? Description { get; set; } 25 | 26 | [JsonPropertyName("price")] 27 | public decimal Price { get; set; } 28 | 29 | [JsonPropertyName("imageUrl")] 30 | public string? ImageUrl { get; set; } 31 | } 32 | 33 | 34 | [JsonSerializable(typeof(List))] 35 | public sealed partial class ProductSerializerContext : JsonSerializerContext 36 | { 37 | } -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Products/.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "dotnet-ef": { 6 | "version": "8.0.0-rc.1.23419.6", 7 | "commands": [ 8 | "dotnet-ef" 9 | ] 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Products/Database.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/03 Aspire/Products/Database.db -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Products/Database.db-shm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/03 Aspire/Products/Database.db-shm -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Products/Database.db-wal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/03 Aspire/Products/Database.db-wal -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Products/Products.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | https 5 | 6 | -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Products/Products.http: -------------------------------------------------------------------------------- 1 | @HostAddress = http://localhost:5228 2 | 3 | GET {{HostAddress}}/api/Product 4 | Accept: application/json 5 | 6 | ### 7 | -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Products/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Products.Data; 3 | using Products.Endpoints; 4 | using Products.Memory; 5 | 6 | var builder = WebApplication.CreateBuilder(args); 7 | 8 | builder.AddServiceDefaults(); 9 | 10 | builder.Services.AddDbContext(options => 11 | options.UseSqlite(builder.Configuration.GetConnectionString("ProductsContext") ?? throw new InvalidOperationException("Connection string 'ProductsContext' not found."))); 12 | 13 | builder.Services.AddSingleton(sp => 14 | { 15 | return builder.Configuration; 16 | }); 17 | 18 | // add memory context 19 | builder.AddSemanticKernel(); 20 | 21 | builder.AddAzureAI(); 22 | 23 | // Add services to the container. 24 | var app = builder.Build(); 25 | 26 | // Configure the HTTP request pipeline. 27 | app.UseHttpsRedirection(); 28 | 29 | app.MapProductEndpoints(); 30 | 31 | app.UseStaticFiles(); 32 | 33 | app.CreateDbIfNotExists(); 34 | 35 | // init semantic memory 36 | await app.InitSemanticMemoryAsync(); 37 | 38 | app.MapDefaultEndpoints(); 39 | 40 | app.Run(); 41 | -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Products/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:49179", 8 | "sslPort": 44375 9 | } 10 | }, 11 | "profiles": { 12 | "http": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "launchBrowser": true, 16 | "launchUrl": "api/Product", 17 | "applicationUrl": "http://localhost:5228", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development" 20 | } 21 | }, 22 | "https": { 23 | "commandName": "Project", 24 | "dotnetRunMessages": true, 25 | "launchBrowser": true, 26 | "launchUrl": "api/Product", 27 | "applicationUrl": "https://localhost:7130;http://localhost:5228", 28 | "environmentVariables": { 29 | "ASPNETCORE_ENVIRONMENT": "Development" 30 | } 31 | }, 32 | "IIS Express": { 33 | "commandName": "IISExpress", 34 | "launchBrowser": true, 35 | "launchUrl": "api/Product", 36 | "environmentVariables": { 37 | "ASPNETCORE_ENVIRONMENT": "Development" 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Products/aisearchresponse.prompty: -------------------------------------------------------------------------------- 1 | --- 2 | name: ai_search_detailed_response 3 | description: A prompt that responses a query from an user about a topic in the context of a product. 4 | authors: 5 | - Bruno Capuano 6 | model: 7 | api: chat 8 | configuration: 9 | type: azure_openai 10 | azure_endpoint: ${env:AZURE_OPENAI_ENDPOINT} 11 | azure_deployment: ${env:AZURE_OPENAI_MODEL} 12 | parameters: 13 | max_tokens: 3000 14 | sample: 15 | question: > 16 | What do you suggest for a rainy day in the beach? 17 | productid: > 18 | 10 19 | productname: > 20 | Tent Ultimate plus plus 21 | productdescription: > 22 | This tent is perfect for camping trips and to also be used in the beach in rainy days 23 | productprice: > 24 | 99.99 25 | --- 26 | 27 | system: 28 | You are an intelligent assistant helping Contoso Inc clients with their search about outdoor product. 29 | Use 'you' to refer to the individual asking the questions even if they ask with 'I'. 30 | Answer the questions using only the data provided related to a product in the response below. 31 | Do not include the product id. 32 | Do not return markdown format. Do not return HTML format. 33 | If you cannot answer using the information below, say you don't know. 34 | As the assistant, you generate descriptions using a funny style and even add some personal flair with appropriate emojis. 35 | 36 | # Context 37 | Generate and answer to the question using the information below. 38 | Incorporate the question if provided: {{question}} 39 | +++++ 40 | product id: {{productid}} 41 | product name: {{productname}} 42 | product description: {{productdescription}} 43 | product price: {{productprice}} 44 | +++++ 45 | 46 | -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Products/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "ConnectionStrings": { 10 | "ProductsContext": "Data Source=Database.db" 11 | } 12 | } -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Products/wwwroot/images/product1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/03 Aspire/Products/wwwroot/images/product1.png -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Products/wwwroot/images/product2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/03 Aspire/Products/wwwroot/images/product2.png -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Products/wwwroot/images/product3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/03 Aspire/Products/wwwroot/images/product3.png -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Products/wwwroot/images/product4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/03 Aspire/Products/wwwroot/images/product4.png -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Products/wwwroot/images/product5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/03 Aspire/Products/wwwroot/images/product5.png -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Products/wwwroot/images/product6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/03 Aspire/Products/wwwroot/images/product6.png -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Products/wwwroot/images/product7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/03 Aspire/Products/wwwroot/images/product7.png -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Products/wwwroot/images/product8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/03 Aspire/Products/wwwroot/images/product8.png -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Products/wwwroot/images/product9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/03 Aspire/Products/wwwroot/images/product9.png -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/SearchEntities/SearchEntities.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | net9.0 9 | enable 10 | enable 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/SearchEntities/SearchResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace SearchEntities; 4 | 5 | public class SearchResponse 6 | { 7 | [JsonPropertyName("id")] 8 | public string? Response { get; set; } 9 | 10 | [JsonPropertyName("products")] 11 | public List? Products { get; set; } 12 | 13 | [JsonPropertyName("elapsedtime")] 14 | public TimeSpan ElapsedTime { get; set; } 15 | } 16 | 17 | 18 | [JsonSerializable(typeof(SearchResponse))] 19 | public sealed partial class SearchResponseSerializerContext : JsonSerializerContext 20 | { 21 | } -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Store/Components/App.razor: -------------------------------------------------------------------------------- 1 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Store/Components/Layout/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 |
4 | 7 | 8 |
9 |
10 | About 11 |
12 | 13 |
14 | @Body 15 |
16 |
17 |
18 | 19 |
20 | An unhandled error has occurred. 21 | Reload 22 | 🗙 23 |
24 | -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Store/Components/Layout/MainLayout.razor.css: -------------------------------------------------------------------------------- 1 | .page { 2 | position: relative; 3 | display: flex; 4 | flex-direction: column; 5 | } 6 | 7 | main { 8 | flex: 1; 9 | } 10 | 11 | .sidebar { 12 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 13 | } 14 | 15 | .top-row { 16 | background-color: #f7f7f7; 17 | border-bottom: 1px solid #d6d5d5; 18 | justify-content: flex-end; 19 | height: 3.5rem; 20 | display: flex; 21 | align-items: center; 22 | } 23 | 24 | .top-row ::deep a, .top-row ::deep .btn-link { 25 | white-space: nowrap; 26 | margin-left: 1.5rem; 27 | text-decoration: none; 28 | } 29 | 30 | .top-row ::deep a:hover, .top-row ::deep .btn-link:hover { 31 | text-decoration: underline; 32 | } 33 | 34 | .top-row ::deep a:first-child { 35 | overflow: hidden; 36 | text-overflow: ellipsis; 37 | } 38 | 39 | @media (max-width: 640.98px) { 40 | .top-row:not(.auth) { 41 | display: none; 42 | } 43 | 44 | .top-row.auth { 45 | justify-content: space-between; 46 | } 47 | 48 | .top-row ::deep a, .top-row ::deep .btn-link { 49 | margin-left: 0; 50 | } 51 | } 52 | 53 | @media (min-width: 641px) { 54 | .page { 55 | flex-direction: row; 56 | } 57 | 58 | .sidebar { 59 | width: 250px; 60 | height: 100vh; 61 | position: sticky; 62 | top: 0; 63 | } 64 | 65 | .top-row { 66 | position: sticky; 67 | top: 0; 68 | z-index: 1; 69 | } 70 | 71 | .top-row.auth ::deep a:first-child { 72 | flex: 1; 73 | text-align: right; 74 | width: 0; 75 | } 76 | 77 | .top-row, article { 78 | padding-left: 2rem !important; 79 | padding-right: 1.5rem !important; 80 | } 81 | } 82 | 83 | #blazor-error-ui { 84 | background: lightyellow; 85 | bottom: 0; 86 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 87 | display: none; 88 | left: 0; 89 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 90 | position: fixed; 91 | width: 100%; 92 | z-index: 1000; 93 | } 94 | 95 | #blazor-error-ui .dismiss { 96 | cursor: pointer; 97 | position: absolute; 98 | right: 0.75rem; 99 | top: 0.5rem; 100 | } 101 | -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Store/Components/Layout/NavMenu.razor: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 31 | -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Store/Components/Pages/Home.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 | Home 4 | 5 |

Home

6 | 7 | Welcome to the best e-commerce platform in the world - eShopLite! 8 | -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Store/Components/Pages/Products.razor: -------------------------------------------------------------------------------- 1 | @page "/products" 2 | @using DataEntities 3 | @using Store.Services 4 | @inject ProductService ProductService 5 | @inject IConfiguration Configuration 6 | @attribute [StreamRendering(true)] 7 | 8 | Products 9 | 10 |

Products

11 | 12 |

Here are some of our amazing outdoor products that you can purchase.

13 | 14 | @if (products == null) 15 | { 16 |

Loading...

17 | } 18 | else 19 | { 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | @foreach (var product in products) 31 | { 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | } 40 | 41 |
ImageNameDescriptionPrice
@product.Name@product.Description@product.Price
42 | } 43 | 44 | @code { 45 | private List? products; 46 | 47 | protected override async Task OnInitializedAsync() 48 | { 49 | // Simulate asynchronous loading to demonstrate streaming rendering 50 | await Task.Delay(500); 51 | products = await ProductService.GetProducts(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Store/Components/Routes.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Store/Components/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using Microsoft.AspNetCore.Components.Web.Virtualization 7 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 8 | @using Microsoft.JSInterop 9 | @using Store 10 | @using Store.Components 11 | -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Store/Program.cs: -------------------------------------------------------------------------------- 1 | using Store.Components; 2 | using Store.Services; 3 | 4 | var builder = WebApplication.CreateBuilder(args); 5 | 6 | // add aspire service defaults 7 | builder.AddServiceDefaults(); 8 | 9 | builder.Services.AddSingleton(); 10 | //builder.Services.AddHttpClient(c => 11 | //{ 12 | // var url = builder.Configuration["ProductEndpoint"] ?? throw new InvalidOperationException("ProductEndpoint is not set"); 13 | 14 | // c.BaseAddress = new(url); 15 | //}); 16 | builder.Services.AddHttpClient( 17 | static client => client.BaseAddress = new("https+http://products")); 18 | 19 | // Add services to the container. 20 | builder.Services.AddRazorComponents() 21 | .AddInteractiveServerComponents(); 22 | 23 | var app = builder.Build(); 24 | 25 | // aspire map default endpoints 26 | app.MapDefaultEndpoints(); 27 | 28 | // Configure the HTTP request pipeline. 29 | if (!app.Environment.IsDevelopment()) 30 | { 31 | app.UseExceptionHandler("/Error", createScopeForErrors: true); 32 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 33 | app.UseHsts(); 34 | } 35 | 36 | app.UseHttpsRedirection(); 37 | 38 | app.UseStaticFiles(); 39 | app.UseAntiforgery(); 40 | 41 | app.MapRazorComponents() 42 | .AddInteractiveServerRenderMode(); 43 | 44 | app.Run(); 45 | -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Store/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:38240", 8 | "sslPort": 44332 9 | } 10 | }, 11 | "profiles": { 12 | "http": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "launchBrowser": true, 16 | "applicationUrl": "http://localhost:5158", 17 | "environmentVariables": { 18 | "ASPNETCORE_ENVIRONMENT": "Development" 19 | } 20 | }, 21 | "https": { 22 | "commandName": "Project", 23 | "dotnetRunMessages": true, 24 | "launchBrowser": true, 25 | "applicationUrl": "https://localhost:7085;http://localhost:5158", 26 | "environmentVariables": { 27 | "ASPNETCORE_ENVIRONMENT": "Development" 28 | } 29 | }, 30 | "IIS Express": { 31 | "commandName": "IISExpress", 32 | "launchBrowser": true, 33 | "environmentVariables": { 34 | "ASPNETCORE_ENVIRONMENT": "Development" 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Store/Services/ProductService.cs: -------------------------------------------------------------------------------- 1 | using SearchEntities; 2 | using DataEntities; 3 | using System.Text.Json; 4 | 5 | namespace Store.Services; 6 | 7 | public class ProductService 8 | { 9 | HttpClient httpClient; 10 | private readonly ILogger _logger; 11 | 12 | public ProductService(HttpClient httpClient, ILogger logger) 13 | { 14 | _logger = logger; 15 | this.httpClient = httpClient; 16 | } 17 | public async Task> GetProducts() 18 | { 19 | List? products = null; 20 | try 21 | { 22 | var response = await httpClient.GetAsync("/api/product"); 23 | var responseText = await response.Content.ReadAsStringAsync(); 24 | 25 | _logger.LogInformation($"Http status code: {response.StatusCode}"); 26 | _logger.LogInformation($"Http response content: {responseText}"); 27 | 28 | if (response.IsSuccessStatusCode) 29 | { 30 | var options = new JsonSerializerOptions 31 | { 32 | PropertyNameCaseInsensitive = true 33 | }; 34 | 35 | products = await response.Content.ReadFromJsonAsync(ProductSerializerContext.Default.ListProduct); 36 | } 37 | } 38 | catch (Exception ex) 39 | { 40 | _logger.LogError(ex, "Error during GetProducts."); 41 | } 42 | 43 | return products ?? new List(); 44 | } 45 | 46 | public async Task Search(string searchTerm, bool semanticSearch = false) 47 | { 48 | try 49 | { 50 | // call the desired Endpoint 51 | HttpResponseMessage response = null; 52 | if (semanticSearch) 53 | { 54 | // AI Search 55 | response = await httpClient.GetAsync($"/api/aisearch/{searchTerm}"); 56 | } 57 | else 58 | { 59 | // standard search 60 | response = await httpClient.GetAsync($"/api/product/search/{searchTerm}"); 61 | } 62 | 63 | var responseText = await response.Content.ReadAsStringAsync(); 64 | 65 | _logger.LogInformation($"Http status code: {response.StatusCode}"); 66 | _logger.LogInformation($"Http response content: {responseText}"); 67 | 68 | if (response.IsSuccessStatusCode) 69 | { 70 | return await response.Content.ReadFromJsonAsync(); 71 | } 72 | } 73 | catch (Exception ex) 74 | { 75 | _logger.LogError(ex, "Error during Search."); 76 | } 77 | 78 | return new SearchResponse { Response = "No response" }; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Store/Store.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | preview 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Store/Store.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | https 5 | 6 | -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Store/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft.AspNetCore": "Warning" 7 | } 8 | }, 9 | "AllowedHosts": "*", 10 | "ProductEndpoint": "http://localhost:5228/", 11 | "ProductEndpointHttps": "" 12 | } 13 | -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Store/wwwroot/app.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 3 | } 4 | 5 | h1:focus { 6 | outline: none; 7 | } 8 | 9 | a, .btn-link { 10 | color: #0071c1; 11 | } 12 | 13 | .btn-primary { 14 | color: #fff; 15 | background-color: #1b6ec2; 16 | border-color: #1861ac; 17 | } 18 | 19 | .btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus { 20 | box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb; 21 | } 22 | 23 | .content { 24 | padding-top: 1.1rem; 25 | } 26 | 27 | .valid.modified:not([type=checkbox]) { 28 | outline: 1px solid #26b050; 29 | } 30 | 31 | .invalid { 32 | outline: 1px solid red; 33 | } 34 | 35 | .validation-message { 36 | color: red; 37 | } 38 | 39 | .blazor-error-boundary { 40 | background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121; 41 | padding: 1rem 1rem 1rem 3.7rem; 42 | color: white; 43 | } 44 | 45 | .blazor-error-boundary::after { 46 | content: "An error has occurred." 47 | } 48 | -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/Store/wwwroot/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/03 Aspire/Store/wwwroot/favicon.png -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/eShopAppHost/Program.cs: -------------------------------------------------------------------------------- 1 | var builder = DistributedApplication.CreateBuilder(args); 2 | 3 | var ai = !builder.ExecutionContext.IsPublishMode ? 4 | builder.AddConnectionString("aoai") : 5 | builder.AddAzureOpenAI("aoai") 6 | .AddDeployment(new AzureOpenAIDeployment("gpt4o", "gpt4o", "2024-08-06")) 7 | .AddDeployment(new AzureOpenAIDeployment("text-embedding-3-large", "text-embedding-3-large", "1")); 8 | 9 | var products = builder.AddProject("products") 10 | .WithReference(ai) 11 | .WithEnvironment("AZURE_OPENAI_MODEL", builder.Configuration["AZURE_OPENAI_MODEL"]) 12 | .WithEnvironment("AZURE_OPENAI_EMBEDDING_MODEL", builder.Configuration["AZURE_OPENAI_EMBEDDING_MODEL"]); 13 | 14 | var store = builder.AddProject("store") 15 | .WithReference(products) 16 | .WithExternalHttpEndpoints(); 17 | 18 | builder.Build().Run(); 19 | -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/eShopAppHost/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "https": { 5 | "commandName": "Project", 6 | "dotnetRunMessages": true, 7 | "launchBrowser": true, 8 | "applicationUrl": "https://localhost:17104;http://localhost:15295", 9 | "environmentVariables": { 10 | "ASPNETCORE_ENVIRONMENT": "Development", 11 | "DOTNET_ENVIRONMENT": "Development", 12 | "DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21237", 13 | "DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22003" 14 | } 15 | }, 16 | "http": { 17 | "commandName": "Project", 18 | "dotnetRunMessages": true, 19 | "launchBrowser": true, 20 | "applicationUrl": "http://localhost:15295", 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development", 23 | "DOTNET_ENVIRONMENT": "Development", 24 | "DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:19009", 25 | "DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:20136" 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/eShopAppHost/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning", 6 | "Aspire.Hosting.Dcp": "Warning" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/eShopAppHost/eShopAppHost.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Exe 6 | net9.0 7 | enable 8 | enable 9 | true 10 | 3e9fd9fb-e2c0-4477-bbd3-ab03823266cd 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/src BackUp/03 Aspire/eShopServiceDefaults/eShopServiceDefaults.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | true 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | 3 | # CS8602: Dereference of a possibly null reference. 4 | dotnet_diagnostic.CS8602.severity = silent 5 | 6 | # IDE0058: Expression value is never used 7 | dotnet_diagnostic.IDE0058.severity = silent 8 | -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/DataEntities/DataEntities.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/DataEntities/Product.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace DataEntities; 4 | 5 | public class Product 6 | { 7 | 8 | public Product() 9 | { 10 | Id = 0; 11 | Name = "not defined"; 12 | Description = "not defined"; 13 | Price = 0; 14 | ImageUrl = "not defined"; 15 | } 16 | 17 | [JsonPropertyName("id")] 18 | public virtual int Id { get; set; } 19 | 20 | [JsonPropertyName("name")] 21 | public virtual string? Name { get; set; } 22 | 23 | [JsonPropertyName("description")] 24 | public virtual string? Description { get; set; } 25 | 26 | [JsonPropertyName("price")] 27 | public virtual decimal Price { get; set; } 28 | 29 | [JsonPropertyName("imageUrl")] 30 | public virtual string? ImageUrl { get; set; } 31 | } 32 | 33 | 34 | [JsonSerializable(typeof(List))] 35 | public sealed partial class ProductSerializerContext : JsonSerializerContext 36 | { 37 | } -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Products/.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "dotnet-ef": { 6 | "version": "8.0.0-rc.1.23419.6", 7 | "commands": [ 8 | "dotnet-ef" 9 | ] 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Products/Database.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/04 Aspire Ollama/Products/Database.db -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Products/Products.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | https 5 | 6 | -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Products/Products.http: -------------------------------------------------------------------------------- 1 | @HostAddress = http://localhost:5228 2 | 3 | GET {{HostAddress}}/api/Product 4 | Accept: application/json 5 | 6 | ### 7 | -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Products/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Products.Data; 3 | using Products.Endpoints; 4 | using Products.Memory; 5 | 6 | var builder = WebApplication.CreateBuilder(args); 7 | 8 | builder.AddServiceDefaults(); 9 | 10 | builder.Services.AddDbContext(options => 11 | options.UseSqlite(builder.Configuration.GetConnectionString("ProductsContext") ?? throw new InvalidOperationException("Connection string 'ProductsContext' not found."))); 12 | 13 | builder.Services.AddSingleton(sp => 14 | { 15 | return builder.Configuration; 16 | }); 17 | 18 | // add memory context 19 | builder.AddSemanticKernel(); 20 | 21 | if (builder.Environment.IsDevelopment()) 22 | { 23 | builder.AddOllama(); 24 | } 25 | else 26 | { 27 | builder.AddAzureAI(); 28 | } 29 | 30 | // Add services to the container. 31 | var app = builder.Build(); 32 | 33 | // Configure the HTTP request pipeline. 34 | app.UseHttpsRedirection(); 35 | 36 | app.MapProductEndpoints(); 37 | 38 | app.UseStaticFiles(); 39 | 40 | app.CreateDbIfNotExists(); 41 | 42 | // init semantic memory 43 | await app.InitSemanticMemoryAsync(); 44 | 45 | app.MapDefaultEndpoints(); 46 | 47 | app.Run(); 48 | -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Products/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:49179", 8 | "sslPort": 44375 9 | } 10 | }, 11 | "profiles": { 12 | "http": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "launchBrowser": true, 16 | "launchUrl": "api/Product", 17 | "applicationUrl": "http://localhost:5228", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development" 20 | } 21 | }, 22 | "https": { 23 | "commandName": "Project", 24 | "dotnetRunMessages": true, 25 | "launchBrowser": true, 26 | "launchUrl": "api/Product", 27 | "applicationUrl": "https://localhost:7130;http://localhost:5228", 28 | "environmentVariables": { 29 | "ASPNETCORE_ENVIRONMENT": "Development" 30 | } 31 | }, 32 | "IIS Express": { 33 | "commandName": "IISExpress", 34 | "launchBrowser": true, 35 | "launchUrl": "api/Product", 36 | "environmentVariables": { 37 | "ASPNETCORE_ENVIRONMENT": "Development" 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Products/aisearchresponse.prompty: -------------------------------------------------------------------------------- 1 | --- 2 | name: ai_search_detailed_response 3 | description: A prompt that responses a query from an user about a topic in the context of a product. 4 | authors: 5 | - Bruno Capuano 6 | model: 7 | api: chat 8 | parameters: 9 | max_tokens: 3000 10 | sample: 11 | question: > 12 | What do you suggest for a rainy day in the beach? 13 | productid: > 14 | 10 15 | productname: > 16 | Tent Ultimate plus plus 17 | productdescription: > 18 | This tent is perfect for camping trips and to also be used in the beach in rainy days 19 | productprice: > 20 | 99.99 21 | --- 22 | 23 | system: 24 | You are an intelligent assistant helping Contoso Inc clients with their search about outdoor product. 25 | Use 'you' to refer to the individual asking the questions even if they ask with 'I'. 26 | Answer the questions using only the data provided related to a product in the response below. 27 | Do not include the product id. 28 | Do not return markdown format. Do not return HTML format. 29 | If you cannot answer using the information below, say you don't know. 30 | As the assistant, you generate descriptions using a funny style and even add some personal flair with appropriate emojis. 31 | 32 | # Context 33 | Generate and answer to the question using the information below. 34 | Incorporate the question if provided: {{question}} 35 | +++++ 36 | product id: {{productid}} 37 | product name: {{productname}} 38 | product description: {{productdescription}} 39 | product price: {{productprice}} 40 | +++++ 41 | 42 | -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Products/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "ConnectionStrings": { 10 | "ProductsContext": "Data Source=Database.db" 11 | } 12 | } -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Products/wwwroot/images/product1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/04 Aspire Ollama/Products/wwwroot/images/product1.png -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Products/wwwroot/images/product2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/04 Aspire Ollama/Products/wwwroot/images/product2.png -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Products/wwwroot/images/product3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/04 Aspire Ollama/Products/wwwroot/images/product3.png -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Products/wwwroot/images/product4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/04 Aspire Ollama/Products/wwwroot/images/product4.png -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Products/wwwroot/images/product5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/04 Aspire Ollama/Products/wwwroot/images/product5.png -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Products/wwwroot/images/product6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/04 Aspire Ollama/Products/wwwroot/images/product6.png -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Products/wwwroot/images/product7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/04 Aspire Ollama/Products/wwwroot/images/product7.png -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Products/wwwroot/images/product8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/04 Aspire Ollama/Products/wwwroot/images/product8.png -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Products/wwwroot/images/product9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/04 Aspire Ollama/Products/wwwroot/images/product9.png -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/SearchEntities/ProductVector.cs: -------------------------------------------------------------------------------- 1 | using DataEntities; 2 | using Microsoft.Extensions.VectorData; 3 | using System.Text.Json.Serialization; 4 | 5 | namespace SearchEntities; 6 | 7 | public class ProductVector : Product 8 | { 9 | [VectorStoreRecordKey] 10 | [JsonPropertyName("id")] 11 | public override int Id { get => base.Id ; set => base.Id = value; } 12 | 13 | [VectorStoreRecordData] 14 | [JsonPropertyName("name")] 15 | public override string? Name { get => base.Name ; set => base.Name = value; } 16 | 17 | [VectorStoreRecordData] 18 | [JsonPropertyName("price")] 19 | public override decimal Price { get => base.Price; set => base.Price = value; } 20 | 21 | [VectorStoreRecordData] 22 | [JsonPropertyName("imageUrl")] 23 | public override string? ImageUrl { get => base.ImageUrl; set => base.ImageUrl = value; } 24 | 25 | [VectorStoreRecordData] 26 | [JsonPropertyName("description")] 27 | public override string? Description { get => base.Description ; set => base.Description = value; } 28 | 29 | [VectorStoreRecordData] 30 | public required string ProductInformation { get; set; } 31 | 32 | [VectorStoreRecordVector(384, DistanceFunction.CosineDistance)] 33 | public ReadOnlyMemory Vector { get; set; } 34 | 35 | public static ProductVector FromProduct(Product product) 36 | { 37 | return new ProductVector 38 | { 39 | Id = product.Id, 40 | Name = product.Name, 41 | Description = product.Description, 42 | Price = product.Price, 43 | ImageUrl = product.ImageUrl, 44 | ProductInformation = $"[{product.Name}] is a product that costs [{product.Price}] and is described as [{product.Description}]", 45 | }; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/SearchEntities/SearchEntities.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | net9.0 13 | enable 14 | enable 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/SearchEntities/SearchResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace SearchEntities; 4 | 5 | public class SearchResponse 6 | { 7 | [JsonPropertyName("id")] 8 | public string? Response { get; set; } 9 | 10 | [JsonPropertyName("products")] 11 | public List? Products { get; set; } 12 | 13 | [JsonPropertyName("elapsedtime")] 14 | public TimeSpan ElapsedTime { get; set; } 15 | } 16 | 17 | 18 | [JsonSerializable(typeof(SearchResponse))] 19 | public sealed partial class SearchResponseSerializerContext : JsonSerializerContext 20 | { 21 | } -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Store/Components/App.razor: -------------------------------------------------------------------------------- 1 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Store/Components/Layout/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 |
4 | 7 | 8 |
9 |
10 | About 11 |
12 | 13 |
14 | @Body 15 |
16 |
17 |
18 | 19 |
20 | An unhandled error has occurred. 21 | Reload 22 | 🗙 23 |
24 | -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Store/Components/Layout/MainLayout.razor.css: -------------------------------------------------------------------------------- 1 | .page { 2 | position: relative; 3 | display: flex; 4 | flex-direction: column; 5 | } 6 | 7 | main { 8 | flex: 1; 9 | } 10 | 11 | .sidebar { 12 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 13 | } 14 | 15 | .top-row { 16 | background-color: #f7f7f7; 17 | border-bottom: 1px solid #d6d5d5; 18 | justify-content: flex-end; 19 | height: 3.5rem; 20 | display: flex; 21 | align-items: center; 22 | } 23 | 24 | .top-row ::deep a, .top-row ::deep .btn-link { 25 | white-space: nowrap; 26 | margin-left: 1.5rem; 27 | text-decoration: none; 28 | } 29 | 30 | .top-row ::deep a:hover, .top-row ::deep .btn-link:hover { 31 | text-decoration: underline; 32 | } 33 | 34 | .top-row ::deep a:first-child { 35 | overflow: hidden; 36 | text-overflow: ellipsis; 37 | } 38 | 39 | @media (max-width: 640.98px) { 40 | .top-row:not(.auth) { 41 | display: none; 42 | } 43 | 44 | .top-row.auth { 45 | justify-content: space-between; 46 | } 47 | 48 | .top-row ::deep a, .top-row ::deep .btn-link { 49 | margin-left: 0; 50 | } 51 | } 52 | 53 | @media (min-width: 641px) { 54 | .page { 55 | flex-direction: row; 56 | } 57 | 58 | .sidebar { 59 | width: 250px; 60 | height: 100vh; 61 | position: sticky; 62 | top: 0; 63 | } 64 | 65 | .top-row { 66 | position: sticky; 67 | top: 0; 68 | z-index: 1; 69 | } 70 | 71 | .top-row.auth ::deep a:first-child { 72 | flex: 1; 73 | text-align: right; 74 | width: 0; 75 | } 76 | 77 | .top-row, article { 78 | padding-left: 2rem !important; 79 | padding-right: 1.5rem !important; 80 | } 81 | } 82 | 83 | #blazor-error-ui { 84 | background: lightyellow; 85 | bottom: 0; 86 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 87 | display: none; 88 | left: 0; 89 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 90 | position: fixed; 91 | width: 100%; 92 | z-index: 1000; 93 | } 94 | 95 | #blazor-error-ui .dismiss { 96 | cursor: pointer; 97 | position: absolute; 98 | right: 0.75rem; 99 | top: 0.5rem; 100 | } 101 | -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Store/Components/Layout/NavMenu.razor: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 31 | -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Store/Components/Pages/Home.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 | Home 4 | 5 |

Home

6 | 7 | Welcome to the best e-commerce platform in the world - eShopLite! 8 | -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Store/Components/Pages/Products.razor: -------------------------------------------------------------------------------- 1 | @page "/products" 2 | @using DataEntities 3 | @using Store.Services 4 | @inject ProductService ProductService 5 | @inject IConfiguration Configuration 6 | @attribute [StreamRendering(true)] 7 | 8 | Products 9 | 10 |

Products

11 | 12 |

Here are some of our amazing outdoor products that you can purchase.

13 | 14 | @if (products == null) 15 | { 16 |

Loading...

17 | } 18 | else 19 | { 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | @foreach (var product in products) 31 | { 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | } 40 | 41 |
ImageNameDescriptionPrice
@product.Name@product.Description@product.Price
42 | } 43 | 44 | @code { 45 | private List? products; 46 | 47 | protected override async Task OnInitializedAsync() 48 | { 49 | // Simulate asynchronous loading to demonstrate streaming rendering 50 | await Task.Delay(500); 51 | products = await ProductService.GetProducts(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Store/Components/Routes.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Store/Components/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using Microsoft.AspNetCore.Components.Web.Virtualization 7 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 8 | @using Microsoft.JSInterop 9 | @using Store 10 | @using Store.Components 11 | -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Store/Program.cs: -------------------------------------------------------------------------------- 1 | using Store.Components; 2 | using Store.Services; 3 | 4 | var builder = WebApplication.CreateBuilder(args); 5 | 6 | // add aspire service defaults 7 | builder.AddServiceDefaults(); 8 | 9 | builder.Services.AddSingleton(); 10 | //builder.Services.AddHttpClient(c => 11 | //{ 12 | // var url = builder.Configuration["ProductEndpoint"] ?? throw new InvalidOperationException("ProductEndpoint is not set"); 13 | 14 | // c.BaseAddress = new(url); 15 | //}); 16 | builder.Services.AddHttpClient( 17 | static client => client.BaseAddress = new("https+http://products")); 18 | 19 | // Add services to the container. 20 | builder.Services.AddRazorComponents() 21 | .AddInteractiveServerComponents(); 22 | 23 | var app = builder.Build(); 24 | 25 | // aspire map default endpoints 26 | app.MapDefaultEndpoints(); 27 | 28 | // Configure the HTTP request pipeline. 29 | if (!app.Environment.IsDevelopment()) 30 | { 31 | app.UseExceptionHandler("/Error", createScopeForErrors: true); 32 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 33 | app.UseHsts(); 34 | } 35 | 36 | app.UseHttpsRedirection(); 37 | 38 | app.UseStaticFiles(); 39 | app.UseAntiforgery(); 40 | 41 | app.MapRazorComponents() 42 | .AddInteractiveServerRenderMode(); 43 | 44 | app.Run(); 45 | -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Store/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:38240", 8 | "sslPort": 44332 9 | } 10 | }, 11 | "profiles": { 12 | "http": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "launchBrowser": true, 16 | "applicationUrl": "http://localhost:5158", 17 | "environmentVariables": { 18 | "ASPNETCORE_ENVIRONMENT": "Development" 19 | } 20 | }, 21 | "https": { 22 | "commandName": "Project", 23 | "dotnetRunMessages": true, 24 | "launchBrowser": true, 25 | "applicationUrl": "https://localhost:7085;http://localhost:5158", 26 | "environmentVariables": { 27 | "ASPNETCORE_ENVIRONMENT": "Development" 28 | } 29 | }, 30 | "IIS Express": { 31 | "commandName": "IISExpress", 32 | "launchBrowser": true, 33 | "environmentVariables": { 34 | "ASPNETCORE_ENVIRONMENT": "Development" 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Store/Store.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | preview 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Store/Store.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | https 5 | 6 | -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Store/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft.AspNetCore": "Warning" 7 | } 8 | }, 9 | "AllowedHosts": "*", 10 | "ProductEndpoint": "http://localhost:5228/", 11 | "ProductEndpointHttps": "" 12 | } 13 | -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Store/wwwroot/app.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 3 | } 4 | 5 | h1:focus { 6 | outline: none; 7 | } 8 | 9 | a, .btn-link { 10 | color: #0071c1; 11 | } 12 | 13 | .btn-primary { 14 | color: #fff; 15 | background-color: #1b6ec2; 16 | border-color: #1861ac; 17 | } 18 | 19 | .btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus { 20 | box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb; 21 | } 22 | 23 | .content { 24 | padding-top: 1.1rem; 25 | } 26 | 27 | .valid.modified:not([type=checkbox]) { 28 | outline: 1px solid #26b050; 29 | } 30 | 31 | .invalid { 32 | outline: 1px solid red; 33 | } 34 | 35 | .validation-message { 36 | color: red; 37 | } 38 | 39 | .blazor-error-boundary { 40 | background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121; 41 | padding: 1rem 1rem 1rem 3.7rem; 42 | color: white; 43 | } 44 | 45 | .blazor-error-boundary::after { 46 | content: "An error has occurred." 47 | } 48 | -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/Store/wwwroot/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src BackUp/04 Aspire Ollama/Store/wwwroot/favicon.png -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/eShopAppHost/Program.cs: -------------------------------------------------------------------------------- 1 | var builder = DistributedApplication.CreateBuilder(args); 2 | 3 | var products = builder.AddProject("products"); 4 | 5 | if (builder.ExecutionContext.IsPublishMode) 6 | { 7 | var ai = builder.AddAzureOpenAI("aoai") 8 | .AddDeployment(new AzureOpenAIDeployment("gpt4o", "gpt4o", "2024-08-06")) 9 | .AddDeployment(new AzureOpenAIDeployment("text-embedding-ada-002", "text-embedding-ada-002", "2")); 10 | 11 | products 12 | .WithReference(ai) 13 | .WithEnvironment("AZURE_OPENAI_MODEL", "gpt4o") 14 | .WithEnvironment("AZURE_OPENAI_EMBEDDING_MODEL", "text-embedding-ada-002"); 15 | } 16 | else 17 | { 18 | var ollama = builder.AddOllama("ollama") 19 | .WithDataVolume() 20 | .WithGPUSupport() 21 | .WithOpenWebUI(); 22 | 23 | var chat = ollama.AddModel("chat", "phi3.5"); 24 | var embedding = ollama.AddModel("embedding", "all-minilm"); 25 | 26 | products 27 | .WithReference(chat) 28 | .WithReference(embedding) 29 | .WaitFor(chat) 30 | .WaitFor(embedding); 31 | } 32 | 33 | var store = builder.AddProject("store") 34 | .WithReference(products) 35 | .WithExternalHttpEndpoints() 36 | .WaitFor(products); 37 | 38 | builder.Build().Run(); 39 | -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/eShopAppHost/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "https": { 5 | "commandName": "Project", 6 | "dotnetRunMessages": true, 7 | "launchBrowser": true, 8 | "applicationUrl": "https://localhost:17104;http://localhost:15295", 9 | "environmentVariables": { 10 | "ASPNETCORE_ENVIRONMENT": "Development", 11 | "DOTNET_ENVIRONMENT": "Development", 12 | "DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21237", 13 | "DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22003" 14 | } 15 | }, 16 | "http": { 17 | "commandName": "Project", 18 | "dotnetRunMessages": true, 19 | "launchBrowser": true, 20 | "applicationUrl": "http://localhost:15295", 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development", 23 | "DOTNET_ENVIRONMENT": "Development", 24 | "DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:19009", 25 | "DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:20136" 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/eShopAppHost/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning", 6 | "Aspire.Hosting.Dcp": "Warning" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/eShopAppHost/eShopAppHost.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Exe 6 | net9.0 7 | enable 8 | enable 9 | true 10 | 3e9fd9fb-e2c0-4477-bbd3-ab03823266cd 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/src BackUp/04 Aspire Ollama/eShopServiceDefaults/eShopServiceDefaults.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | true 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/src Demo/Products/aisearchresponse.prompty: -------------------------------------------------------------------------------- 1 | --- 2 | name: ai_search_detailed_response 3 | description: A prompt that responses a query from an user about a topic in the context of a product. 4 | authors: 5 | - Bruno Capuano 6 | model: 7 | api: chat 8 | configuration: 9 | type: azure_openai 10 | azure_endpoint: ${env:AZURE_OPENAI_ENDPOINT} 11 | azure_deployment: ${env:AZURE_OPENAI_MODEL} 12 | parameters: 13 | max_tokens: 3000 14 | sample: 15 | question: > 16 | What do you suggest for a rainy day in the beach? 17 | productid: > 18 | 10 19 | productname: > 20 | Tent Ultimate plus plus 21 | productdescription: > 22 | This tent is perfect for camping trips and to also be used in the beach in rainy days 23 | productprice: > 24 | 99.99 25 | --- 26 | 27 | system: 28 | You are an intelligent assistant helping Contoso Inc clients with their search about outdoor product. 29 | Use 'you' to refer to the individual asking the questions even if they ask with 'I'. 30 | Answer the questions using only the data provided related to a product in the response below. 31 | Do not include the product id. 32 | Do not return markdown format. Do not return HTML format. 33 | If you cannot answer using the information below, say you don't know. 34 | As the assistant, you generate descriptions using a funny style and even add some personal flair with appropriate emojis. 35 | 36 | # Context 37 | Generate and answer to the question using the information below. 38 | Incorporate the question if provided: {{question}} 39 | +++++ 40 | product id: {{productid}} 41 | product name: {{productname}} 42 | product description: {{productdescription}} 43 | product price: {{productprice}} 44 | +++++ 45 | 46 | -------------------------------------------------------------------------------- /src/src/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | 3 | # CS8602: Dereference of a possibly null reference. 4 | dotnet_diagnostic.CS8602.severity = silent 5 | 6 | # IDE0058: Expression value is never used 7 | dotnet_diagnostic.IDE0058.severity = silent 8 | -------------------------------------------------------------------------------- /src/src/DataEntities/DataEntities.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/src/DataEntities/Product.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace DataEntities; 4 | 5 | public class Product 6 | { 7 | 8 | public Product() 9 | { 10 | Id = 0; 11 | Name = "not defined"; 12 | Description = "not defined"; 13 | Price = 0; 14 | ImageUrl = "not defined"; 15 | } 16 | 17 | [JsonPropertyName("id")] 18 | public int Id { get; set; } 19 | 20 | [JsonPropertyName("name")] 21 | public string? Name { get; set; } 22 | 23 | [JsonPropertyName("description")] 24 | public string? Description { get; set; } 25 | 26 | [JsonPropertyName("price")] 27 | public decimal Price { get; set; } 28 | 29 | [JsonPropertyName("imageUrl")] 30 | public string? ImageUrl { get; set; } 31 | } 32 | 33 | 34 | [JsonSerializable(typeof(List))] 35 | public sealed partial class ProductSerializerContext : JsonSerializerContext 36 | { 37 | } -------------------------------------------------------------------------------- /src/src/Products/.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "dotnet-ef": { 6 | "version": "8.0.0-rc.1.23419.6", 7 | "commands": [ 8 | "dotnet-ef" 9 | ] 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /src/src/Products/Database.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src/Products/Database.db -------------------------------------------------------------------------------- /src/src/Products/Database.db-shm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src/Products/Database.db-shm -------------------------------------------------------------------------------- /src/src/Products/Database.db-wal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src/Products/Database.db-wal -------------------------------------------------------------------------------- /src/src/Products/Products.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | true 8 | 000aa9d1-8ada-4ab7-9b97-678cf3132ce5 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | all 28 | runtime; build; native; contentfiles; analyzers; buildtransitive 29 | 30 | 31 | 32 | 33 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /src/src/Products/Products.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | https 5 | 6 | -------------------------------------------------------------------------------- /src/src/Products/Products.http: -------------------------------------------------------------------------------- 1 | @HostAddress = http://localhost:5228 2 | 3 | GET {{HostAddress}}/api/Product 4 | Accept: application/json 5 | 6 | ### 7 | -------------------------------------------------------------------------------- /src/src/Products/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Products.Data; 3 | using Products.Endpoints; 4 | 5 | var builder = WebApplication.CreateBuilder(args); 6 | builder.Services.AddDbContext(options => 7 | options.UseSqlite(builder.Configuration.GetConnectionString("ProductsContext") ?? throw new InvalidOperationException("Connection string 'ProductsContext' not found."))); 8 | 9 | builder.Services.AddSingleton(sp => 10 | { 11 | return builder.Configuration; 12 | }); 13 | 14 | // Add services to the container. 15 | var app = builder.Build(); 16 | 17 | // Configure the HTTP request pipeline. 18 | app.UseHttpsRedirection(); 19 | 20 | app.MapProductEndpoints(); 21 | 22 | app.UseStaticFiles(); 23 | 24 | app.CreateDbIfNotExists(); 25 | 26 | app.Run(); 27 | -------------------------------------------------------------------------------- /src/src/Products/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:49179", 8 | "sslPort": 44375 9 | } 10 | }, 11 | "profiles": { 12 | "http": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "launchBrowser": true, 16 | "launchUrl": "api/Product", 17 | "applicationUrl": "http://localhost:5228", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development" 20 | } 21 | }, 22 | "https": { 23 | "commandName": "Project", 24 | "dotnetRunMessages": true, 25 | "launchBrowser": true, 26 | "launchUrl": "api/Product", 27 | "applicationUrl": "https://localhost:7130;http://localhost:5228", 28 | "environmentVariables": { 29 | "ASPNETCORE_ENVIRONMENT": "Development" 30 | } 31 | }, 32 | "IIS Express": { 33 | "commandName": "IISExpress", 34 | "launchBrowser": true, 35 | "launchUrl": "api/Product", 36 | "environmentVariables": { 37 | "ASPNETCORE_ENVIRONMENT": "Development" 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/src/Products/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "ConnectionStrings": { 10 | "ProductsContext": "Data Source=Database.db" 11 | } 12 | } -------------------------------------------------------------------------------- /src/src/Products/wwwroot/images/product1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src/Products/wwwroot/images/product1.png -------------------------------------------------------------------------------- /src/src/Products/wwwroot/images/product2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src/Products/wwwroot/images/product2.png -------------------------------------------------------------------------------- /src/src/Products/wwwroot/images/product3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src/Products/wwwroot/images/product3.png -------------------------------------------------------------------------------- /src/src/Products/wwwroot/images/product4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src/Products/wwwroot/images/product4.png -------------------------------------------------------------------------------- /src/src/Products/wwwroot/images/product5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src/Products/wwwroot/images/product5.png -------------------------------------------------------------------------------- /src/src/Products/wwwroot/images/product6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src/Products/wwwroot/images/product6.png -------------------------------------------------------------------------------- /src/src/Products/wwwroot/images/product7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src/Products/wwwroot/images/product7.png -------------------------------------------------------------------------------- /src/src/Products/wwwroot/images/product8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src/Products/wwwroot/images/product8.png -------------------------------------------------------------------------------- /src/src/Products/wwwroot/images/product9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src/Products/wwwroot/images/product9.png -------------------------------------------------------------------------------- /src/src/SearchEntities/SearchEntities.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | net9.0 9 | enable 10 | enable 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/src/SearchEntities/SearchResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace SearchEntities; 4 | 5 | public class SearchResponse 6 | { 7 | [JsonPropertyName("id")] 8 | public string? Response { get; set; } 9 | 10 | [JsonPropertyName("products")] 11 | public List? Products { get; set; } 12 | 13 | [JsonPropertyName("elapsedtime")] 14 | public TimeSpan ElapsedTime { get; set; } 15 | } 16 | 17 | 18 | [JsonSerializable(typeof(SearchResponse))] 19 | public sealed partial class SearchResponseSerializerContext : JsonSerializerContext 20 | { 21 | } -------------------------------------------------------------------------------- /src/src/Store/Components/App.razor: -------------------------------------------------------------------------------- 1 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/src/Store/Components/Layout/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 |
4 | 7 | 8 |
9 |
10 | About 11 |
12 | 13 |
14 | @Body 15 |
16 |
17 |
18 | 19 |
20 | An unhandled error has occurred. 21 | Reload 22 | 🗙 23 |
24 | -------------------------------------------------------------------------------- /src/src/Store/Components/Layout/MainLayout.razor.css: -------------------------------------------------------------------------------- 1 | .page { 2 | position: relative; 3 | display: flex; 4 | flex-direction: column; 5 | } 6 | 7 | main { 8 | flex: 1; 9 | } 10 | 11 | .sidebar { 12 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 13 | } 14 | 15 | .top-row { 16 | background-color: #f7f7f7; 17 | border-bottom: 1px solid #d6d5d5; 18 | justify-content: flex-end; 19 | height: 3.5rem; 20 | display: flex; 21 | align-items: center; 22 | } 23 | 24 | .top-row ::deep a, .top-row ::deep .btn-link { 25 | white-space: nowrap; 26 | margin-left: 1.5rem; 27 | text-decoration: none; 28 | } 29 | 30 | .top-row ::deep a:hover, .top-row ::deep .btn-link:hover { 31 | text-decoration: underline; 32 | } 33 | 34 | .top-row ::deep a:first-child { 35 | overflow: hidden; 36 | text-overflow: ellipsis; 37 | } 38 | 39 | @media (max-width: 640.98px) { 40 | .top-row:not(.auth) { 41 | display: none; 42 | } 43 | 44 | .top-row.auth { 45 | justify-content: space-between; 46 | } 47 | 48 | .top-row ::deep a, .top-row ::deep .btn-link { 49 | margin-left: 0; 50 | } 51 | } 52 | 53 | @media (min-width: 641px) { 54 | .page { 55 | flex-direction: row; 56 | } 57 | 58 | .sidebar { 59 | width: 250px; 60 | height: 100vh; 61 | position: sticky; 62 | top: 0; 63 | } 64 | 65 | .top-row { 66 | position: sticky; 67 | top: 0; 68 | z-index: 1; 69 | } 70 | 71 | .top-row.auth ::deep a:first-child { 72 | flex: 1; 73 | text-align: right; 74 | width: 0; 75 | } 76 | 77 | .top-row, article { 78 | padding-left: 2rem !important; 79 | padding-right: 1.5rem !important; 80 | } 81 | } 82 | 83 | #blazor-error-ui { 84 | background: lightyellow; 85 | bottom: 0; 86 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 87 | display: none; 88 | left: 0; 89 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 90 | position: fixed; 91 | width: 100%; 92 | z-index: 1000; 93 | } 94 | 95 | #blazor-error-ui .dismiss { 96 | cursor: pointer; 97 | position: absolute; 98 | right: 0.75rem; 99 | top: 0.5rem; 100 | } 101 | -------------------------------------------------------------------------------- /src/src/Store/Components/Layout/NavMenu.razor: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 31 | -------------------------------------------------------------------------------- /src/src/Store/Components/Pages/Home.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 | Home 4 | 5 |

Home

6 | 7 | Welcome to the best e-commerce platform in the world - eShopLite! 8 | -------------------------------------------------------------------------------- /src/src/Store/Components/Pages/Products.razor: -------------------------------------------------------------------------------- 1 | @page "/products" 2 | @using DataEntities 3 | @using Store.Services 4 | @inject ProductService ProductService 5 | @inject IConfiguration Configuration 6 | @attribute [StreamRendering(true)] 7 | 8 | Products 9 | 10 |

Products

11 | 12 |

Here are some of our amazing outdoor products that you can purchase.

13 | 14 | @if (products == null) 15 | { 16 |

Loading...

17 | } 18 | else 19 | { 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | @foreach (var product in products) 31 | { 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | } 40 | 41 |
ImageNameDescriptionPrice
@product.Name@product.Description@product.Price
42 | } 43 | 44 | @code { 45 | private List? products; 46 | 47 | protected override async Task OnInitializedAsync() 48 | { 49 | // Simulate asynchronous loading to demonstrate streaming rendering 50 | await Task.Delay(500); 51 | products = await ProductService.GetProducts(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/src/Store/Components/Pages/Search.razor: -------------------------------------------------------------------------------- 1 | @page "/search" 2 | 3 | @inject Store.Services.ProductService ProductService 4 | @inject IConfiguration Configuration 5 | @attribute [StreamRendering(true)] 6 | @rendermode InteractiveServer 7 | 8 | Search Products 9 | 10 |

Search Products

11 | 12 |

Search our amazing outdoor products that you can purchase.

13 | 14 |
15 | 16 |
17 | 18 | 19 |
20 |
21 |

@aiResponse

22 | 23 | @* Uncomment this to show elapsed time *@ 24 | @*

Elapsed Time: [@elapsedTime]

*@ 25 |
26 | 27 | @if (products == null) 28 | { 29 |

Loading...

30 | } 31 | else 32 | { 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | @foreach (var product in products) 44 | { 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | } 53 | 54 |
ImageNameDescriptionPrice
@product.Name@product.Description@product.Price
55 | } 56 | 57 | @code { 58 | private string searchTerm = ""; 59 | private List? products; 60 | private string aiResponse = ""; 61 | private string elapsedTime = ""; 62 | 63 | private async Task DoSearch(MouseEventArgs e) 64 | { 65 | await Task.Delay(500); 66 | var response = await ProductService.Search(searchTerm); 67 | aiResponse = response.Response; 68 | products = response.Products; 69 | elapsedTime = response.ElapsedTime.ToString(); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/src/Store/Components/Routes.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/src/Store/Components/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using Microsoft.AspNetCore.Components.Web.Virtualization 7 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 8 | @using Microsoft.JSInterop 9 | @using Store 10 | @using Store.Components 11 | -------------------------------------------------------------------------------- /src/src/Store/Program.cs: -------------------------------------------------------------------------------- 1 | using Store.Components; 2 | using Store.Services; 3 | 4 | var builder = WebApplication.CreateBuilder(args); 5 | 6 | builder.Services.AddSingleton(); 7 | builder.Services.AddHttpClient(c => 8 | { 9 | var url = builder.Configuration["ProductEndpoint"] ?? throw new InvalidOperationException("ProductEndpoint is not set"); 10 | 11 | c.BaseAddress = new(url); 12 | }); 13 | 14 | // Add services to the container. 15 | builder.Services.AddRazorComponents() 16 | .AddInteractiveServerComponents(); 17 | 18 | var app = builder.Build(); 19 | 20 | // Configure the HTTP request pipeline. 21 | if (!app.Environment.IsDevelopment()) 22 | { 23 | app.UseExceptionHandler("/Error", createScopeForErrors: true); 24 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 25 | app.UseHsts(); 26 | } 27 | 28 | app.UseHttpsRedirection(); 29 | 30 | app.UseStaticFiles(); 31 | app.UseAntiforgery(); 32 | 33 | app.MapRazorComponents() 34 | .AddInteractiveServerRenderMode(); 35 | 36 | app.Run(); 37 | -------------------------------------------------------------------------------- /src/src/Store/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:38240", 8 | "sslPort": 44332 9 | } 10 | }, 11 | "profiles": { 12 | "http": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "launchBrowser": true, 16 | "applicationUrl": "http://localhost:5158", 17 | "environmentVariables": { 18 | "ASPNETCORE_ENVIRONMENT": "Development" 19 | } 20 | }, 21 | "https": { 22 | "commandName": "Project", 23 | "dotnetRunMessages": true, 24 | "launchBrowser": true, 25 | "applicationUrl": "https://localhost:7085;http://localhost:5158", 26 | "environmentVariables": { 27 | "ASPNETCORE_ENVIRONMENT": "Development" 28 | } 29 | }, 30 | "IIS Express": { 31 | "commandName": "IISExpress", 32 | "launchBrowser": true, 33 | "environmentVariables": { 34 | "ASPNETCORE_ENVIRONMENT": "Development" 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/src/Store/Services/ProductService.cs: -------------------------------------------------------------------------------- 1 | using SearchEntities; 2 | using DataEntities; 3 | using System.Text.Json; 4 | 5 | namespace Store.Services; 6 | 7 | public class ProductService 8 | { 9 | HttpClient httpClient; 10 | private readonly ILogger _logger; 11 | 12 | public ProductService(HttpClient httpClient, ILogger logger) 13 | { 14 | _logger = logger; 15 | this.httpClient = httpClient; 16 | } 17 | public async Task> GetProducts() 18 | { 19 | List? products = null; 20 | try 21 | { 22 | var response = await httpClient.GetAsync("/api/product"); 23 | var responseText = await response.Content.ReadAsStringAsync(); 24 | 25 | _logger.LogInformation($"Http status code: {response.StatusCode}"); 26 | _logger.LogInformation($"Http response content: {responseText}"); 27 | 28 | if (response.IsSuccessStatusCode) 29 | { 30 | var options = new JsonSerializerOptions 31 | { 32 | PropertyNameCaseInsensitive = true 33 | }; 34 | 35 | products = await response.Content.ReadFromJsonAsync(ProductSerializerContext.Default.ListProduct); 36 | } 37 | } 38 | catch (Exception ex) 39 | { 40 | _logger.LogError(ex, "Error during GetProducts."); 41 | } 42 | 43 | return products ?? new List(); 44 | } 45 | 46 | public async Task Search(string searchTerm) 47 | { 48 | try 49 | { 50 | // call the AI Endpoint 51 | var response = await httpClient.GetAsync($"/api/product/search/{searchTerm}"); 52 | 53 | var responseText = await response.Content.ReadAsStringAsync(); 54 | 55 | _logger.LogInformation($"Http status code: {response.StatusCode}"); 56 | _logger.LogInformation($"Http response content: {responseText}"); 57 | 58 | if (response.IsSuccessStatusCode) 59 | { 60 | return await response.Content.ReadFromJsonAsync(); 61 | } 62 | } 63 | catch (Exception ex) 64 | { 65 | _logger.LogError(ex, "Error during Search."); 66 | } 67 | 68 | return new SearchResponse { Response = "No response" }; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/src/Store/Store.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | preview 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/src/Store/Store.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | https 5 | 6 | -------------------------------------------------------------------------------- /src/src/Store/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft.AspNetCore": "Warning" 7 | } 8 | }, 9 | "AllowedHosts": "*", 10 | "ProductEndpoint": "http://localhost:5228/", 11 | "ProductEndpointHttps": "" 12 | } 13 | -------------------------------------------------------------------------------- /src/src/Store/wwwroot/app.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 3 | } 4 | 5 | h1:focus { 6 | outline: none; 7 | } 8 | 9 | a, .btn-link { 10 | color: #0071c1; 11 | } 12 | 13 | .btn-primary { 14 | color: #fff; 15 | background-color: #1b6ec2; 16 | border-color: #1861ac; 17 | } 18 | 19 | .btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus { 20 | box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb; 21 | } 22 | 23 | .content { 24 | padding-top: 1.1rem; 25 | } 26 | 27 | .valid.modified:not([type=checkbox]) { 28 | outline: 1px solid #26b050; 29 | } 30 | 31 | .invalid { 32 | outline: 1px solid red; 33 | } 34 | 35 | .validation-message { 36 | color: red; 37 | } 38 | 39 | .blazor-error-boundary { 40 | background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121; 41 | padding: 1rem 1rem 1rem 3.7rem; 42 | color: white; 43 | } 44 | 45 | .blazor-error-boundary::after { 46 | content: "An error has occurred." 47 | } 48 | -------------------------------------------------------------------------------- /src/src/Store/wwwroot/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/aitour-ecommerce-app-with-ai/3184ce597aba1fd4159854ab3f1687e82e13fe04/src/src/Store/wwwroot/favicon.png -------------------------------------------------------------------------------- /src/src/eShopLite.slnLaunch.user: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Name": "New Profile", 4 | "Projects": [ 5 | { 6 | "Path": "Products\\Products.csproj", 7 | "Action": "Start" 8 | }, 9 | { 10 | "Path": "Store\\Store.csproj", 11 | "Action": "Start" 12 | } 13 | ] 14 | } 15 | ] --------------------------------------------------------------------------------