Flexible product catalog with Web API.
Based on Products with Options (with values). Also supports Product Variants.
Watch video
Product can have Options.
Option can either be a single option to be picked, or not picked, or a set of items to pick a value from. E.g. Colors or Sizes.
Product Variants represent combinations of Option values. E.g. the combination of a Color and a Size, like Blue and Medium.
A Variant has its own SKU. Physically it is its own good in the warehouse.
Sample products:
- T-shirt with variants (Color, Size)
- Sallad builder
- Pizza builder
.NET 6, ASP.NET Core, Blazor UI based on MudBlazor.
Entity Framework Core and SQL Server database
Database structure is based on this post in StackOverlow.
Just open it in Visual Studio.
In the Catalog.Server
run:
dotnet run
Or:
Run the project with .NET Tye, by running this in the solution folder:
tye run --watch
To publicly expose Blobs via their URLs you have to change Azurite's configuration.
(This requires Azurite to have been run once for the files to be created)
Open the file WebApi/.data/azurite/__azurite_db_blob__.json
:
Add the "publicAccess": "blob"
key-value in the section shown below:
{
"name": "$CONTAINERS_COLLECTION$",
"data": [
{
"accountName": "devstoreaccount1",
"name": "images",
"properties": {
"etag": "\"0x1C839AE6CDF11F0\"",
"lastModified": "2021-05-14T15:08:51.726Z",
"leaseStatus": "unlocked",
"leaseState": "available",
"hasImmutabilityPolicy": false,
"hasLegalHold": false,
--- > "publicAccess": "blob" <----
},
// Omitted
},
Then, restart Azurite.
In Catalog.Server
project, open Program.cs
.
Make sure that this line is uncommented:
await Seed.SeedAsync(app.Services)
Then restart the app.
Toggle line the comment again to prevent unecessary seeding, or else, Ids will constantly change.