Skip to content

BlazorShop is a modern e-commerce application built with Blazor, offering an intuitive interface for managing products, orders, and customers, with a focus on speed, flexibility, and easy customization.

License

Notifications You must be signed in to change notification settings

unrealbg/BlazorShop

BlazorShop

.NET

BlazorShop is an open-source e-commerce application built with Blazor WebAssembly and ASP.NET Core (.NET 9). It follows a clean, layered architecture and provides a ready-to-extend foundation for real online stores.

Table of Contents

Introduction

BlazorShop delivers a modern, responsive shopping experience with a Blazor WebAssembly frontend and a secure ASP.NET Core Web API backend. It includes product catalog, cart, checkout with multiple payment methods, order tracking, admin tooling, and more.

Who Is It For?

  • Small/medium businesses looking to bootstrap an online shop on .NET.
  • Developers exploring Blazor WebAssembly, ASP.NET Core, and clean architecture.

Features

  • Authentication & Authorization
    • ASP.NET Core Identity, JWT access tokens + refresh flow
    • Email confirmation, password change, profile update
    • Role-based access (Admin/User)
    • Note: The first registered user becomes Admin; next users get User role.
  • Catalog Management
    • Categories, products, product variants (size/stock), image upload
    • Product search/typeahead UI
  • Cart & Checkout
    • Persistent cart (cookie), quantity updates, totals
    • Multiple payment methods: Stripe (card), PayPal, Cash on Delivery, Bank Transfer
    • Bank transfer instructions via email with order reference
  • Orders & Tracking
    • Save checkout history; admin order list
    • Update shipping status, carrier tracking number and URL
  • Newsletter
    • Email subscription with welcome email
  • Admin Area
    • Manage categories, products, variants, orders, and shipping
  • Developer Experience
    • OpenAPI/Swagger, Serilog logging, unit tests
    • Modern UI (Tailwind-style classes), toast notifications, Chart.js

Technologies Used

  • .NET 9, ASP.NET Core Web API
  • Blazor WebAssembly (client)
  • Entity Framework Core 9 + SQL Server
  • ASP.NET Core Identity (email confirmation enabled)
  • AutoMapper, FluentValidation
  • Serilog
  • Stripe & PayPal integrations
  • Swashbuckle (Swagger/OpenAPI)
  • xUnit, Moq (tests)
  • Microsoft Aspire AppHost (local orchestrator)

Requirements

  • .NET 9 SDK or later
  • SQL Server (LocalDB or full instance)
  • Modern browser (WebAssembly capable)
  • Optional: API keys and SMTP for payments/emails
    • Stripe Secret Key
    • PayPal settings (if applicable)
    • SMTP credentials

Getting Started

  1. Clone the repository

    git clone https://github.com/unrealbg/BlazorShop.git
    cd BlazorShop
  2. Configure the API (appsettings or user-secrets)

  • File: BlazorShop.Presentation/BlazorShop.API/appsettings.json
  • Keys you may need to set/update:
    • ConnectionStrings:DefaultConnection
    • Jwt: Key, Issuer, Audience
    • Stripe: SecretKey
    • BankTransfer: Iban, Beneficiary, BankName, AdditionalInfo
    • EmailSettings: From, DisplayName, SmtpServer, Port, UseSsl, Username, Password

Tip: keep secrets out of source control via dotnet user-secrets for the API project.

  1. Database
  • The API applies EF Core migrations automatically on startup.

  • Or apply manually from the solution root:

    dotnet ef database update --project BlazorShop.Infrastructure --startup-project BlazorShop.Presentation/BlazorShop.API
  1. Run the app (pick one)
  • Using the AppHost (recommended local orchestrator):

    dotnet run --project BlazorShop.AppHost
  • Run projects separately (two terminals):

    dotnet run --project BlazorShop.Presentation/BlazorShop.API
    dotnet run --project BlazorShop.Presentation/BlazorShop.Web

Default dev URLs (may vary by environment):

  1. Tests

    dotnet test

Project Structure

  • BlazorShop.Domain – Core entities and contracts
  • BlazorShop.Application – DTOs, services, validations
  • BlazorShop.Infrastructure – EF Core, repositories, Identity, email, payments, logging
  • BlazorShop.Presentation/BlazorShop.API – ASP.NET Core Web API controllers and configuration
  • BlazorShop.Presentation/BlazorShop.Web – Blazor WebAssembly client
  • BlazorShop.Presentation/BlazorShop.Web.Shared – Shared models/services used by the Web client
  • BlazorShop.AppHost – Local orchestrator (Microsoft Aspire) to run API + Web together
  • BlazorShop.Tests – Unit tests

API & Docs

  • Swagger UI available when API runs in Development at /swagger
  • CORS allows localhost HTTP/HTTPS origins

Screenshots

Sign Up screen
Sign Up
Sign In screen
Sign In
Subscribe to newsletter
Subscribe to Newsletter
Home page
Home
Profile page
Profile
Orders list
Orders
Cart page
Cart
Product quick view modal
Product Quick View
Latest products section
Latest Products
Choose payment method dialog
Choose Payment Method
Bank transfer instructions
Bank Transfer Instructions
Stripe checkout page
Stripe Checkout
Admin dashboard
Admin Dashboard
Manage products
Manage Products
Manage orders
Manage Orders
Manage categories
Manage Categories
Add product form
Add Product
Add variants modal
Add Variants
Edit tracking modal
Edit Tracking
Browse by category menu
Browse by Category
Search suggestions
Search Suggestions

Contributing

  1. Fork the repository.

  2. Create a feature branch:

    git checkout -b feature/your-feature
  3. Commit your changes:

    git commit -m "feat: add your feature"
  4. Push and open a Pull Request.

Demo

Live demo: https://shop.unrealbg.com

License

MIT License. See the LICENSE file for details.

Acknowledgements

About

BlazorShop is a modern e-commerce application built with Blazor, offering an intuitive interface for managing products, orders, and customers, with a focus on speed, flexibility, and easy customization.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published