Skip to content

Repository files navigation

Sports Store

Sports Store is a full-stack e-commerce web application built with ASP.NET Core and C#. The project demonstrates the implementation of an online sports store

with product browsing, category filtering, shopping cart management, checkout and order processing, authentication, and an administrative interface for managing products and orders.

The solution follows a layered structure with separate projects for data access, domain models, repositories, logging, services, the web application and automated tests.

Features

Storefront

  • Browse available sports products
  • Filter products by category
  • Paginated product listings
  • Add and remove products from the shopping cart
  • Session-based shopping cart
  • Checkout and order submission
  • Order completion workflow

Administration

  • Authenticated administrator access
  • Product listing and management
  • Create products
  • Edit products
  • View product details
  • Delete products
  • View and manage customer orders
  • ASP.NET Core Identity authentication
  • Blazor-based administrative interface

Technologies

  • C#
  • ASP.NET Core 5
  • ASP.NET Core MVC
  • Razor Pages
  • Server-side Blazor
  • Entity Framework Core
  • SQL Server / SQL Server LocalDB
  • ASP.NET Core Identity
  • NLog
  • xUnit
  • Moq
  • Coverlet
  • HTML
  • CSS
  • Bootstrap

Architecture

The solution is separated into multiple projects to provide a clearer separation of responsibilities.

SportsStoreApp
│
├── SportsStore.Data
│   └── Database contexts and data-access configuration
│
├── SportsStore.LoggerService
│   └── Application logging implementation
│
├── SportsStore.Models
│   ├── Entities
│   └── View models
│
├── SportsStore.Repository
│   ├── Repository interfaces
│   └── Repository implementations
│
├── SportsStore.Services
│   └── Service-layer project
│
├── SportsStore.Test
│   └── Automated unit tests
│
└── SportsStore.Web
    ├── Controllers
    ├── Razor Pages
    ├── Blazor admin components
    ├── Views
    ├── Middleware
    ├── Action filters
    └── Application configuration

This structure separates persistence, domain models, repository abstractions, presentation logic, logging, and testing concerns.

Key Implementation Details

Repository Pattern

Data access is abstracted through repository interfaces and implementations. Controllers and UI components work with abstractions rather than directly depending on the database implementation.

Entity Framework Core

Entity Framework Core is used for persistence with SQL Server.

The application maintains data for:

  • Products
  • Orders
  • Shopping cart/order lines
  • Application identity

Database migrations and initial seed data are included in the application.

Shopping Cart

The application uses a session-backed shopping cart. Customers can add products, change cart contents, proceed to checkout, and submit orders.

Authentication

ASP.NET Core Identity provides authentication for access to administrative functionality.

Admin Interface

The administration section uses Server-side Blazor alongside the ASP.NET Core application.

Administrators can manage products and work with submitted orders through the admin interface.

Logging

Application logging is separated into the SportsStore.LoggerService project and uses NLog.

Automated Testing

The solution contains automated tests covering important application behavior, including:

  • Shopping cart operations
  • Cart Razor Pages
  • Product listing
  • Product pagination
  • Category navigation
  • Order processing
  • MVC controllers
  • Navigation components
  • Custom tag helpers

The testing stack includes:

  • xUnit
  • Moq
  • Microsoft.NET.Test.Sdk
  • Coverlet

Run the tests with:

dotnet test SportsStore.Test/SportsStore.Test.csproj

Getting Started

Prerequisites

The original project targets:

  • .NET 5 SDK
  • SQL Server or SQL Server LocalDB

Because .NET 5 is no longer a supported .NET release, running the project in its original form requires the corresponding SDK or upgrading the application to a currently supported .NET version.

Clone the Repository

git clone https://github.com/Slimcent/SportsStoreApp.git
cd SportsStoreApp

Restore Dependencies

dotnet restore

Database Configuration

Database connection strings are configured in:

SportsStore.Web/appsettings.json

The application uses separate databases for store data and ASP.NET Core Identity.

Update the connection strings if your SQL Server environment differs from the default LocalDB configuration.

Run the Application

dotnet run --project SportsStore.Web

The application applies pending Entity Framework migrations and seeds development data when it starts.

Project Highlights

This project demonstrates practical implementation of several ASP.NET Core development concepts, including:

  • Layered application architecture
  • Dependency injection
  • Repository pattern
  • Entity Framework Core
  • ASP.NET Core Identity
  • MVC controllers and views
  • Razor Pages
  • Server-side Blazor
  • Session management
  • Shopping cart workflows
  • Order processing
  • Database migrations
  • Application logging
  • Unit testing and mocking

Project Status

This project was originally developed using ASP.NET Core 5 and represents an implementation of a complete e-commerce workflow using the .NET ecosystem.

Author

Obinna Vincent Achara

GitHub: @Slimcent

About

E-commerce web application built with ASP.NET Core, MVC, Blazor, Entity Framework Core, SQL Server, Identity, repository pattern, shopping cart, order management,and automated tests.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages