Full-stack demo showcasing the Weaviate C# Managed Client with semantic search, product recommendations, and faceted filtering.
- Backend: ASP.NET Core Minimal API (.NET 9.0)
- Frontend: SvelteKit + Tailwind CSS
- Database: Weaviate (vector database)
✅ Complete - All backend code is implemented and ready:
- ✅ Product and ProductReview models with ImageUrl support
- ✅ ProductCatalogContext (WeaviateContext)
- ✅ 4 endpoint groups (Health, Products, Search, Reviews)
- ✅ DataSeeder service (50 products, ~20 reviews)
- ✅ ProductDataGenerator with sample data
- Docker - For running Weaviate
- .NET 9.0 SDK - For running the backend
- Node.js 18+ - For running the frontend (optional)
We provide a simplified Docker Compose tailored for this demo:
cd src/Example/WebApi
docker compose up -dThis starts a single Weaviate instance without the complex cluster/RBAC setup, avoiding gRPC health check issues.
Wait for Weaviate to be ready (usually 5-10 seconds):
# Check if ready
curl http://localhost:8080/v1/.well-known/readycd src/Example/WebApi
dotnet runThe API will:
- Connect to Weaviate at localhost:8080
- Create Product and ProductReview collections
- Seed 50 products with images and ~20 reviews
- Start listening at http://localhost:5000
Open your browser to:
- Swagger UI: http://localhost:5000/swagger
- Health Check: http://localhost:5000/health
Or use curl:
# Get all products
curl http://localhost:5000/api/products
# Search with hybrid mode
curl -X POST http://localhost:5000/api/search \
-H "Content-Type: application/json" \
-d '{"query":"wireless mouse","mode":"hybrid","alpha":0.5}'
# Get product facets
curl http://localhost:5000/api/products/facets# Stop backend (Ctrl+C in terminal)
# Stop Weaviate
cd src/Example/WebApi
docker compose down| Endpoint | Method | Description |
|---|---|---|
/health |
GET | Health check |
/api/products |
GET | List products with filters |
/api/products/{id} |
GET | Get single product |
/api/products/{id}/similar |
GET | Get similar products (NearObject) |
/api/products/facets |
GET | Get facets (categories, brands) |
/api/search |
POST | Unified search (semantic/hybrid/keyword) |
/api/reviews |
GET | List reviews with filters |
Natural language product search using NearText:
- Example: "wireless headphones with noise cancellation"
Combines semantic (vector) + keyword (BM25):
- Adjustable alpha slider (0=keyword, 1=semantic)
Finds similar products using NearObject vector similarity.
Filter reviews by rating, search content with BM25.
Dynamic category and brand counts for filtering.
// Query with semantic search
var results = await context
.Query<Product>()
.NearText("wireless mouse")
.Where(p => p.Category == "Electronics")
.Limit((uint)10)
.Execute();
// Hybrid search
var results = await context
.Query<Product>()
.Hybrid("gaming keyboard", alpha: 0.7f)
.WithMetadata(MetadataOptions.Score)
.Execute();
// Similar products
var similar = await context
.Query<Product>()
.NearObject(productId)
.Limit((uint)5)
.WithMetadata(MetadataOptions.Distance)
.Execute();src/Example/WebApi/
├── WebApi.csproj
├── Program.cs # App entry point, DI setup
├── GlobalUsings.cs # Global using directives
├── Models/
│ ├── Product.cs # Product, ProductSpecifications, ProductReview
│ └── ProductCatalogContext.cs # WeaviateContext
├── Endpoints/
│ ├── HealthEndpoints.cs
│ ├── ProductEndpoints.cs
│ ├── SearchEndpoints.cs
│ └── ReviewEndpoints.cs
├── Services/
│ ├── DataSeeder.cs # IHostedService for data seeding
│ └── ProductDataGenerator.cs # Sample data generation
└── wwwroot/
└── images/ # Product images (will be from picsum.photos)
- Resolve gRPC health check issue (see workarounds above)
- Test backend API with curl or Swagger UI
- Implement SvelteKit frontend
- Connect frontend to backend API
- Deploy demo
The frontend will be a SvelteKit application located at src/Example/WebApp/ with:
- Product listing with category sidebar
- Interactive search with mode selector
- Product detail pages with similar products
- Review display and filtering
See the implementation plan for detailed frontend specifications.