Skip to main content

Prerequisites

Before installing SupermarketWEB, ensure you have the following installed on your system:

.NET 8.0 SDK

Download from dotnet.microsoft.com

SQL Server

SQL Server LocalDB or SQL Server Express (included with Visual Studio)
SupermarketWEB targets .NET 8.0 with C# nullable reference types enabled. Make sure you have the correct SDK version installed.

Verify Prerequisites

Check your .NET installation:
dotnet --version
You should see version 8.0 or higher.

Installation Steps

1

Clone the Repository

Clone the SupermarketWEB repository to your local machine:
git clone <repository-url>
cd SupermarketWEB
2

Restore NuGet Packages

Restore the required NuGet packages for the project:
dotnet restore
This will install the following dependencies:
  • Microsoft.EntityFrameworkCore (v8.0.10)
  • Microsoft.EntityFrameworkCore.SqlServer (v8.0.10)
3

Configure Database Connection

The default configuration uses SQL Server LocalDB. If you need to change the connection string, edit appsettings.json:
{
  "ConnectionStrings": {
    "SupermarketDB": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=SupermarketEF;Integrated Security=True;..."
  }
}
See the Configuration Guide for detailed database setup options.
4

Apply Database Migrations

Create and update the database schema:
dotnet ef database update
If you don’t have the Entity Framework Core tools installed, run:
dotnet tool install --global dotnet-ef
5

Build the Application

Build the project to ensure everything compiles correctly:
dotnet build
You should see a successful build with no errors.
6

Run the Application

Start the development server:
dotnet run
The application will start and display the URLs it’s listening on:
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: https://localhost:5001
      Now listening on: http://localhost:5000
7

Access the Application

Open your web browser and navigate to:
https://localhost:5001
You should see the SupermarketWEB home page.

Verify Installation

To verify your installation is working correctly:
  1. Check the home page loads - You should see the main dashboard
  2. Test authentication - Navigate to /Account/Login to verify the login page loads
  3. Check database connectivity - Try accessing any of the management pages (Categories, Products, Customers, etc.)
During development, the application uses detailed error pages and logging. See appsettings.Development.json for development-specific settings.

Project Structure

After installation, you’ll have the following structure:
SupermarketWEB/
├── Data/
│   └── SupermarketContext.cs      # EF Core DbContext
├── Models/
│   ├── Category.cs                # Category entity
│   ├── Customer.cs                # Customer entity
│   ├── PayMode.cs                 # Payment mode entity
│   ├── Product.cs                 # Product entity
│   └── User.cs                    # User entity
├── Pages/
│   ├── Account/                   # Authentication pages
│   ├── Categories/                # Category CRUD pages
│   ├── Customers/                 # Customer CRUD pages
│   ├── PayModes/                  # Payment mode CRUD pages
│   ├── Products/                  # Product CRUD pages
│   └── Shared/                    # Shared layouts and partials
├── Properties/
├── wwwroot/                       # Static files (CSS, JS, images)
├── appsettings.json               # Application configuration
├── appsettings.Development.json   # Development settings
├── Program.cs                     # Application entry point
└── SupermarketWEB.csproj          # Project file

Troubleshooting

Database Connection Issues

If you encounter database connection errors:
  • Verify SQL Server LocalDB is installed
  • Check the connection string in appsettings.json
  • Ensure the database was created with dotnet ef database update

Port Already in Use

If ports 5000 or 5001 are already in use:
  • Modify the URLs in Properties/launchSettings.json
  • Or let the system assign random ports by removing the URL configuration

Package Restore Failures

If package restore fails:
  • Clear the NuGet cache: dotnet nuget locals all --clear
  • Try restoring again: dotnet restore
  • Check your internet connection

Next Steps

Now that SupermarketWEB is installed, learn how to configure it for your environment in the Configuration Guide.

Build docs developers (and LLMs) love