WithLove is a sample e-commerce applicaiton that show how AI can be integrated into a web application. It includes a curated gift shop with hybrid search (full-text + vector), and an AI-powered chat shopping assistant. The sample also uses OpenAI models for inference and embedding generation.
- .NET 10 SDK
- Docker Desktop (for Redis, SQL Server, and Temporal containers)
- Stripe CLI — for local webhook forwarding (
brew install stripe/stripe-cli/stripeon macOS) - OpenAI API key — used by the chat assistant and embedding generation
- Stripe API keys (test mode) — used for checkout
API keys are defined once in the AppHost using Aspire parameters and automatically injected into each project as environment variables. No need to duplicate keys across project appsettings files.
Set up secrets using the Aspire CLI (Aspire 13.2+). Run from the repo root — Aspire auto-discovers the AppHost:
aspire secret set Parameters:openai-api-key "<your-openai-key>"
aspire secret set Parameters:stripe-api-key "<your-stripe-secret-key>"
aspire secret set Parameters:stripe-public-key "<your-stripe-public-key>"Verify your secrets are stored:
aspire secret listTo retrieve a single secret:
aspire secret get Parameters:openai-api-keyThe AppHost injects these into the appropriate projects:
Before running, ensure:
- Docker Desktop is running — Required for Redis, SQL Server, and Temporal containers
- Stripe CLI is running and forwarding webhooks — For local Stripe webhook testing:
stripe listen --forward-to https://localhost:7260/stripe/webhookThis listens for Stripe webhook events and forwards them to your local web app. Keep this terminal running while developing.
Build the solution:
dotnet build WithLoveShop.slnxRun the Aspire AppHost
aspire runThe Aspire dashboard opens automatically and shows:
- Aspire Dashboard — resource health, logs, traces, and metrics
- Shop Frontend — the Blazor Web app storefront
- Products API — REST endpoints with Scalar docs at
/scalar - Redis Insight — cache inspection dashboard
- DbGate — SQL Server browser
- Temporal UI — workflow visibility
To stop, press Ctrl+C in the terminal.
- Hybrid Search — Full-text search (SQL Server FTS) combined with vector similarity (OpenAI embeddings), merged via Reciprocal Rank Fusion
- Chat Assistant (LA) — Temporal-backed conversational shopping assistant using
Microsoft.Extensions.AIwith tool calling for product search, cart management, and recommendations - Stripe Web elements — Server-side Checkout Sessions with the Payment and Address elements integrated
- FusionCache + Redis — Multi-layer caching with tag-based invalidation and Redis backplane for cross-instance sync
- Temporal Workflows — Durable database setup, Stripe order processing, customer onboarding, and long-lived chat sessions
The application uses Temporal for durable, long-lived operations:
| Workflow | Purpose | Key Features |
|---|---|---|
| ChatAgentWorkflow | Long-lived chat session per user | 24h idle timeout; resumable via IdConflictPolicy.UseExisting; Update/Query/Signal pattern for async message handling |
| DatabaseSetupWorkflow | Schema initialization on app startup | Runs full-text search index creation, vector column setup, and initial data seeding; executes once per deployment |
| StripeCheckoutOrderWorkflow | Order processing pipeline | Coordinates Stripe Checkout Session creation, webhook verification, and order fulfillment with retry logic |
| CustomerOnboardingWorkflow | New customer registration flow | Creates Stripe customer record and links to user account; ensures customer data is synced with payment processor |
Access Temporal UI: The Aspire dashboard provides a Temporal UI link showing all workflows, executions, task queues, and event histories.
This project is licensed under the MIT License. See LICENSE for details.
