This sample project demonstrates how to build a shop application using .NET, Blazor and HotChocolate GraphQL.
The architecture will use feature-slicing instead of clean/onion architecture to demonstrate how to build applications focusing on business logic instead of technical concerns.
- Create the project
- Add minimal infrastructure (EF Core, SQL-Server, GraphQL)
- Add minimal back-end using feature-slicing
- Add Blazor front-end
- Add GitHub Actions CI/CD (Deploy to Azure)
- Add authentication & authorization
- Add shopping cart
- Add payment gateway
- Add order management
- ...
You can install .NET 8.0.1 from the following link: https://dotnet.microsoft.com/download
The repository contains a dotnet-tools.json
file that contains the tools required to build the project. You can install them using the following command:
dotnet tool restore
The project uses SQL-Server as a database. You can start a local instance using docker:
docker compose up -d
The first time, it will take a few minutes to download and start the SQL-server image.
You can create the database using the following command:
dotnet ef database update --project src/Shop.Application/Shop.Application.csproj
You can start the back-end using the following command:
dotnet run --project src/Shop.Application/Shop.Application.csproj
To consume the GraphQL API, you can use the Banana Cake Pop tool. You can access it by browsing to the following URL: https://localhost:5001/graphql