You can download and install the .NET 8 SDK from the following link:
Download .NET 8 SDK
Open your SQL Server and restore the backup DB from DB_Backup folder (for easy to get sample data in the Assessment, then you can create/edit data from admin page <ecommerce_reactjs_admin>)
Step 2: Can pick sample user to work in WebEcommerceMVC (to login & vote product rating) and ecommerce_reactjs_admin (to manage information):
-
WebEcommerceMVC
user001/Kcs@222
-
ecommerce_reactjs_admin
vietanh/Kcs@222
Note: we have 2 roles (Basic User & Admin User) from AspNetRoles
Open your terminal and navigate to your project directory. Run the following commands to install the necessary packages:
-
Microsoft.AspNetCore.OpenApi
dotnet add package Microsoft.AspNetCore.OpenApi --version 8.0.10
-
Swashbuckle.AspNetCore
dotnet add package Swashbuckle.AspNetCore --version 6.6.2
-
Entity Framework Core SQL Server 8.0.0:
dotnet add package Microsoft.EntityFrameworkCore.SqlServer --version 8.0.0
-
Entity Framework Core Tools 8.0.0:
dotnet add package Microsoft.EntityFrameworkCore.Tools --version 8.0.0
-
IdentityServer4.AspNetIdentity:
dotnet add package IdentityServer4.AspNetIdentity --version 4.0.0
-
Microsoft.AspNetCore.Identity.EntityFrameworkCore:
dotnet add package Microsoft.AspNetCore.Identity.EntityFrameworkCore --version 8.0.0
-
Microsoft.AspNetCore.Authentication.JwtBearer:
dotnet add package Microsoft.AspNetCore.Authentication.JwtBearer --version 8.0.0
-
System.IdentityModel.Tokens.Jwt:
dotnet add package System.IdentityModel.Tokens.Jwt --version 8.0.0
To configure the database connection, open the appsettings.json
file and update the connection string to align with your SQL Server instance.
The connection string format consists of key-value pairs that define how your application connects to the database. Here’s an example connection string and a breakdown of its components:
"ConnectionStrings": {
"DefaultConnection": "Server=VNNOT0123\\MSSQLSERVER0123;Database=EcommerceDB;Trusted_Connection=True;TrustServerCertificate=True"
}
- Server: This specifies the SQL Server instance to connect to. In this example,
VNNOT0123\\MSSQLSERVER0123
refers to the server name and instance name. - Database: This specifies the name of the database to use, which in this case is
EcommerceDB
. - Trusted_Connection: Setting this to
True
enables Windows Authentication. If you use SQL Server Authentication, you need to provide a username and password instead. - TrustServerCertificate: This setting is used to indicate whether the application should trust the server's SSL certificate. Set it to
True
if you want to ignore SSL certificate errors (generally not recommended for production environments).
dotnet add reference ../../ClassLib/EcommerceLib/EcommerceLib.csproj
To start the application, use one of the following commands in your terminal:
-
Build the project:
dotnet build
-
Run the project:
dotnet run
- Run the project in watch mode & get Swagger API (automatically restarts on file changes):
dotnet watch run
Once the project is running, you can access it in your web browser at https://localhost:<port>/
.
Open your terminal and navigate to your project directory. Run the following commands to add necessary class library:
dotnet add reference ../ClassLib/EcommerceLib/EcommerceLib.csproj
To start the application, use one of the following commands in your terminal:
-
Build the project:
dotnet build
-
Run the project:
dotnet run
-
Run the project in watch mode (automatically restarts on file changes):
dotnet watch run
Once the project is running, you can access it in your web browser at https://localhost:<port>/
.
Open your terminal and navigate to your project directory. Run the following commands to install the necessary packages:
npm install axios react-router-dom react-bootstrap bootstrap
To start the application, use one of the following commands in your terminal:
- Build the project:
npm start
Once the project is running, you can access it in your web browser at https://localhost:<port>/
.
Swagger API:

Ecommerce - ASP.NET Core MVC:

Ecommerce - ReactJS (for Admin):
