KitchenPC is a free, open-source framework written in C# for working with recipes, shopping lists, and menus. It provides a standardized data model for representing normalized ingredient and recipe information, and allows ingredient usage to be aggregated across recipes automatically. The core KitchenPC framework includes:
- Base classes for describing and working with core recipe-related concepts.
- A recipe modeling engine capable of building sets of recipes that efficiently use a set of ingredients and amounts.
- A natural language parser which can convert human input ("a dozen eggs") to a normalized ingredient usage structure (whole eggs: 12)
- A categorization engine which can take recipe objects and catagorize them as breakfast, lunch, dinner or dessert. This engine can also derive nutrional information based on USDA data, a taste profile (sweet, savory, spicy, mild) based on ingredients and amounts used, dietary flags (vegetarian, gluten-free, low-calorie, etc) and other aspects of the recipe.
- An extensible framework to define how data is loaded and saved to a persistence mechanism, such as a SQL database or full-text search engine.
The KitchenPC developer Wiki documents the current API, architecture, setup, and extension points. Start with these guides:
- Getting started
- Contexts and configuration
- Recipes and search
- Ingredient parsing and units
- Shopping lists and aggregation
- PostgreSQL and database provisioning
- ASP.NET Core integration
Example applications and a small static data snapshot are available in the KitchenPC Samples repository.
Install the .NET 8 and .NET 10 SDKs, then restore, build, and test from the repository root:
dotnet restore src/core.slnx
dotnet build src/core.slnx --configuration Release --no-restore
dotnet test src/UnitTests/UnitTests.csproj --configuration Release --no-build --no-restoreThe build includes KitchenPC.Core, KitchenPC.DB, KitchenPC.Core.AspNetCore, and the unit tests.
KitchenPC.Core contains the engine and static context. Add KitchenPC.DB when using PostgreSQL,
and add KitchenPC.Core.AspNetCore only when registering a context with ASP.NET Core dependency
injection. Applications can connect KitchenPC to standard Microsoft logging through either context
builder:
var context = DBContext.Configure
.Logging(loggerFactory)
.Adapter(/* database adapter configuration */)
.Identity(() => AuthIdentity.Anonymous)
.Create();The PostgreSQL persistence adapter uses shoppingingredients as the physical table name for the
ingredient catalog. This legacy name is retained for compatibility with the KitchenPC website.
Public domain types and provisioning data continue to use the simpler Ingredient and
Ingredients terminology; those names describe application data rather than database tables.
DBContext.InitializeStore() recreates the KitchenPC schema and deletes existing KitchenPC data.
Use it only with a new database or when replacing all existing data is intentional. See the
KitchenPC Samples repository for a PostgreSQL initializer
and a small sample dataset.
DBContext initializes its autocomplete index, ingredient-text parser, and recipe-modeler graph
by default. Applications that do not use every feature can select only the in-memory capabilities
they need while retaining ordinary database-backed operations:
var context = DBContext.Configure
.Adapter(/* database adapter configuration */)
.Capabilities(DBContextCapabilities.IngredientParsing)
.Identity(() => AuthIdentity.Anonymous)
.Create();The available flags are IngredientAutocomplete, IngredientParsing, and RecipeModeler.
DBContextCapabilities.All is the default for backward compatibility. Calling an API whose
capability was not enabled throws ContextCapabilityNotEnabledException. Recipe aggregation uses
the in-memory graph when the modeler is enabled and falls back to loading recipes from the database
when it is disabled.
See DBContext capability profiles for capability requirements and sample-data startup and memory measurements.
Every push and pull request builds and tests the solution, then creates matching prerelease packages
for CI validation. Version tags publish KitchenPC.Core, KitchenPC.DB, and
KitchenPC.Core.AspNetCore to NuGet with the same version. For example:
git tag -a v2.0.0 -m "KitchenPC 2.0.0"
git push origin v2.0.0NuGet package versions are immutable. Always increment the version for a subsequent release.