Built live during the Blazor AI Workshop on May 20th, 2026. A demo of building a real-world Blazor Server app end-to-end using Claude Code with Claude Opus 4.7 as the implementer — one prompt at a time, no scaffolding pre-baked.
The full session is reproducible: every feature in this repo was driven by one of the 9 prompts at the bottom of this file.
A multi-user shopping list app:
- Sign up / sign in (ASP.NET Core Identity).
- Create, rename, delete shopping lists.
- Add, edit, tick off, delete items per list.
- Share a list with other users by email — they immediately see the list and can manage its items. No invitation/acceptance flow.
- Generate ingredients from a recipe with OpenAI — type "pasta napoli for 4 people" and the AI populates the list with the items needed.
- ASP.NET Core Blazor Server on .NET 10
- ASP.NET Core Identity (cookie auth,
IdentityDbContext<ApplicationUser>) - EF Core 10 + SQL Server Express (
.\SQLEXPRESS) - Vertical Slice Architecture with a custom CQRS mediator (just
Send) - OpenAI .NET SDK 2.10 (
gpt-4o-mini, JSON-object response format) - Dark-themed UI with a blue→purple gradient accent
Strict Vertical Slice + custom CQRS. One folder per entity, one folder
per use case, one file per type — command, handler, DTO, form model,
Razor page all in the slice folder. No services, no repositories;
ApplicationDbContext is injected directly into handlers via primary
constructors.
Common/Mediator/ # IRequest, IRequestHandler, IMediator, Mediator
Data/ # entities, DbContext, migrations
Features/
├─ ShoppingLists/
│ ├─ CreateShoppingList/
│ ├─ GetShoppingLists/
│ ├─ UpdateShoppingList/
│ └─ DeleteShoppingList/
└─ ShoppingItems/
├─ CreateShoppingItem/
├─ GetShoppingItems/
├─ UpdateShoppingItem/
├─ DeleteShoppingItem/
└─ GenerateItemsFromRecipe/ # OpenAI integration lives here
Full conventions, naming rules, do/don't list: see AGENTS.md. That file is read by Claude Code on every new prompt so future sessions follow the same patterns without re-explaining them.
- A
ShoppingListhas an owner (UserId) and a many-to-many set ofShoppingListSharesto other users. - Owner-only operations: rename list, delete list, manage shares.
- Owner OR shared operations: see list, all item CRUD, AI recipe generation.
- The predicate
l.UserId == userId || l.Shares.Any(s => s.UserId == userId)is inlined in every relevant handler.
- .NET 10 SDK
- SQL Server Express (default instance
.\SQLEXPRESS) - (Optional) An OpenAI API key for the recipe feature
The connection string in appsettings.json points
to .\SQLEXPRESS and creates a database called ShoppingListApp. To
apply the schema:
dotnet ef database updateOr — for environments where the EF tools aren't available (e.g. an Azure SQL deployment) — run the idempotent script:
sqlcmd -S <server> -d <database> -E -i Migrate.sqlMigrate.sql is safe to re-run; each migration block is
guarded against __EFMigrationsHistory.
Stored in .NET user-secrets — never in appsettings.json, never
in git:
dotnet user-secrets set "OpenAI:ApiKey" "sk-..."If the key isn't set, the rest of the app still works; the recipe panel just shows a friendly "API key is not configured" message.
dotnet run --launch-profile httpOpen http://localhost:5206, register an account, and start a list.
These are the exact prompts that produced this repo. Each one led to a single chunk of work — entities, slices, migrations, design, sharing, AI integration.
i want to build an app where users can create shopping lists. each list has items which can be marked as done. for now, please create the entities first. that would be a simple list entity with id, name, items list and the user id. then also the item entity with an id, item name, a field to mark we put the item in the cart and the user id. i would like to use ef core with a local sql server express database. so make sure, that this already works.
next, please implement creating and reading shopping lists for the users. for the architecture i would like to use vertical slice architecture. for that, use a feature folder structure, meaning for every entity one folder, then for every use case one folder. additionally, i want to use cqrs with a custom mediator implementation - we only need the send function. use individual files for the commands/queries, handlers, records, classes, dtos, anything really, use best practices. make sure it works first time!!! dont use services or repositories. make sure the logic is in the handlers. use dependency injections and inject the dbcontext in the handlers if necessary.
please create an AGENTS.md file, where you write down all the specs, coding guidelines, the architecture and so on that i told you in the last prompt and what you actually already used for your implementations, so i dont have to tell you that with every single prompt in the future. in particular, make sure to write about the vertical slice architecture, with the folder structure, individual files, and so on
now, please implement all crud operations for shopping list items
create an idempotent migration script we can use to migrate the database also on azure
let's change the design of the complete page. please use a similar look as in the attached screenshot.
(Reference: a dark-themed dashboard with a left sidebar, gradient blue→purple accents, card-based layout, rounded pill-style active nav state.)
i would like to see a sharing feature, where users can share shopping lists between accounts. so, if one account creates a shopping list or wants to update a shopping list, i also want to be able, to add an email address of another user, so that this user also has access to that specific shopping list. dont implement an invitation system where another user would have to confirm the invitation, just show the other user the shopping list in the list of all shopping lists already. and this invited user then, should also be able to add, update and delete items.
update the idempotent migration script please
i would like to have a feature, where i can prompt the openai api with a recipe. meaning, i say something like "i would like to cook pasta napoli", and then the ai api thinks of the items necessary to cook this and add it to the list. so i think we need a textbox to prompt the ai inside a shopping list. please implement that and only show me the environment variable for the api key i have to set in the end.
please use the dotnet user secrets for the key and use this api key:
sk-proj-***
- AGENTS.md — the conventions Claude Code follows on every prompt.
- Common/Mediator/ — the entire ~80-line custom mediator.
- Features/ShoppingItems/GenerateItemsFromRecipe/ — the OpenAI slice (handler + Razor component embedded in the items page).
- Data/ApplicationDbContext.cs — entity configuration including the
ShoppingListSharejoin table and the SQL Server multi-cascade-path workaround. - wwwroot/app.css — the design tokens for the dark theme.