This is an Auction Management System built using React for the frontend and .NET API (C#) for the backend with an SQL Server database. The system allows users to participate in auctions, place bids, and manage auctions from an admin dashboard. The system includes authentication, role-based access, and other auction-related features.
- User authentication (login/register)
- Role-based access (admin/user)
- Bidding system
- Auction management (for admin)
- Notifications for bid events (to be added)
- Auction end handling and payment gateway integration (to be added)
- Frontend: React, Bootstrap
- Backend: ASP.NET Core, C#
- Database: SQL Server
- Other: Entity Framework Core, JWT Authentication
Before running this application locally, ensure you have the following installed:
- Node.js (for the React frontend)
- .NET SDK (for the ASP.NET Core backend)
- SQL Server (for the database)
- Visual Studio (or any code editor)
- SQL Server Management Studio (SSMS)
-
Clone the repository
git clone https://github.com/HasithFernando/Auction-Management-System.git cd auction-management-system
-
Install frontend dependencies
Navigate to the
Frontend
folder and install dependencies:cd frontend npm install
-
Install backend dependencies
Navigate to the
Backend
folder and restore NuGet packages:cd Backend/Backend dotnet restore
-
Update environment variables
In the
Backend
folder, ensure that yourappsettings.Development.json
file contains valid JWT settings and SQL Server connection string:{ "ConnectionStrings": { "DefaultConnection": "Server=localhost; Database=AuctionDb; Trusted_Connection=true" }, "Jwt": { "Key": "qFz2$8(1hP]9u7LJz6+K$2hG2v7b1mB!wG6#R@j*U0pH", "Issuer": "http://localhost:5229" } }
Before running the application, you need to set up the database using Entity Framework Core migrations. Follow these steps to create and apply migrations.
-
Create a Migration
If any changes have been made to the models, you will need to create a migration. In the
Backend
folder, open a terminal and run:dotnet ef migrations add InitialCreate
This will scaffold a new migration based on your current model definitions.
-
Apply Migrations to the Database
After creating the migration, you can apply it to the SQL Server database by running:
dotnet ef database update
This command will create or update the database schema based on the current migration files.
-
Check Migration Status
If you want to verify which migrations have been applied, run:
dotnet ef migrations list
This will list all migrations, showing which ones have been applied and which are still pending.
-
Rolling Back a Migration
If you need to undo the last migration, you can run:
dotnet ef database update PreviousMigrationName
This will revert the database to the state before the most recent migration.
-
Run the Backend (.NET API)
From the Backend folder, run:
dotnet run
The backend should be running at
http://localhost:5229
. -
Run the Frontend (React)
Open a new terminal window, navigate to the client folder, and run:
npm start
The frontend should be running at
http://localhost:3000
.