This API provides endpoints for managing auctions, bids, payments, users, notifications, and dashboard data. The API follows the OpenAPI 3.0.1 specification.
This diagram provides a visual representation of the database structure, showing the relationships between different entities within the system.
Follow these steps to set up and run the project.
git clone https://github.com/upekshaip/sa-backend.git
cd sa-backend
dotnet restore
dotnet tool install --global dotnet-ef --version 8.*
Open the appsettings.json
file and update the DefaultConnection
string according to your MySQL server port and credentials.
Example configuration:
{
"ConnectionStrings": {
"DefaultConnection": "Server=localhost;Port=3306;Database=auction_system;User=root;Password=;"
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
cd api
dotnet ef migrations add InitialDB
dotnet ef database update
dotnet watch run
- Ensure MySQL is running on the specified port in the connection string.
- You can modify the database connection details in
appsettings.json
as needed.
-
GET /api/auctions
- Tags: Auctions
- Responses:
200
: Success
-
POST /api/auctions/my
- Tags: Auctions
- Request Body:
- Content Types:
application/json
,text/json
,application/*+json
- Schema:
GetMyAuctionsDto
- Example:
{ "id": 1 }
- Content Types:
- Responses:
200
: Success
-
POST /api/auctions/mybids
- Tags: Auctions
- Request Body:
- Content Types:
application/json
,text/json
,application/*+json
- Schema:
GetMyAuctionsDto
- Example:
{ "id": 1 }
- Content Types:
- Responses:
200
: Success
-
POST /api/auctions/statusUpdate
- Tags: Auctions
- Request Body:
- Content Types:
application/json
,text/json
,application/*+json
- Schema:
StatusUpdateDto
- Example:
{ "id": 1, "auctionId": 1, "isLive": "true" }
- Content Types:
- Responses:
200
: Success
-
GET /api/auctions/{id}
- Tags: Auctions
- Parameters:
id
(path, required, integer, int32)
- Responses:
200
: Success
-
POST /api/auctions/create
- Tags: Auctions
- Request Body:
- Content Types:
application/json
,text/json
,application/*+json
- Schema:
CreateAuctionDto
- Example:
{ "title": "Auction Title", "description": "Auction Description", "auctionImage": "image_url", "auctionCategory": "Category", "sellerId": 1, "startTime": "2023-10-01T00:00:00Z", "endTime": "2023-10-10T00:00:00Z", "startingBid": 100.0 }
- Content Types:
- Responses:
200
: Success
-
POST /api/auctions/additem
- Tags: Auctions
- Request Body:
- Content Types:
application/json
,text/json
,application/*+json
- Schema:
CreateAuctionItemDto
- Example:
{ "auctionId": 1, "itemName": "Item Name", "itemDescription": "Item Description", "itemImage": "image_url", "itemCategory": "Category" }
- Content Types:
- Responses:
200
: Success
-
POST /api/auctions/upload-image
- Tags: Auctions
- Request Body:
- Content Types:
multipart/form-data
- Schema: Object with property
file
(string, binary) - Example:
{ "file": "binary_data" }
- Content Types:
- Responses:
200
: Success
-
GET /api/bids
- Tags: Bids
- Responses:
200
: Success
-
GET /api/bids/{id}
- Tags: Bids
- Parameters:
id
(path, required, integer, int32)
- Responses:
200
: Success
-
POST /api/bids/create
- Tags: Bids
- Request Body:
- Content Types:
application/json
,text/json
,application/*+json
- Schema:
CreateBidDto
- Example:
{ "auctionId": 1, "bidderId": 1, "status": "active", "bidAmount": 150.0 }
- Content Types:
- Responses:
200
: Success
- POST /api/dashboard/all
- Tags: Dashboard
- Request Body:
- Content Types:
application/json
,text/json
,application/*+json
- Schema:
GetDashboardDto
- Example:
{ "userId": 1 }
- Content Types:
- Responses:
200
: Success
-
GET /api/notifications/{id}
- Tags: Notifications
- Parameters:
id
(path, required, integer, int32)
- Responses:
200
: Success
-
POST /api/notifications/check
- Tags: Notifications
- Request Body:
- Content Types:
application/json
,text/json
,application/*+json
- Schema:
CheckNotificationsDto
- Example:
{ "userId": 1 }
- Content Types:
- Responses:
200
: Success
-
POST /api/notifications/read
- Tags: Notifications
- Request Body:
- Content Types:
application/json
,text/json
,application/*+json
- Schema:
ReadNotifications
- Example:
{ "id": 1, "userId": 1 }
- Content Types:
- Responses:
200
: Success
-
GET /api/payments/{id}
- Tags: Payment
- Parameters:
id
(path, required, integer, int32)
- Responses:
200
: Success
-
POST /api/payments/create
- Tags: Payment
- Request Body:
- Content Types:
application/json
,text/json
,application/*+json
- Schema:
CreatePaymentDto
- Example:
{ "userId": 1, "auctionId": 1, "amount": 200.0, "type": "credit" }
- Content Types:
- Responses:
200
: Success
-
POST /api/payments/info
- Tags: Payment
- Request Body:
- Content Types:
application/json
,text/json
,application/*+json
- Schema:
GetInfoDto
- Example:
{ "userId": 1, "auctionId": 1, "type": "credit" }
- Content Types:
- Responses:
200
: Success
-
POST /api/payments/check
- Tags: Payment
- Request Body:
- Content Types:
application/json
,text/json
,application/*+json
- Schema:
CreatePaymentDto
- Example:
{ "userId": 1, "auctionId": 1, "amount": 200.0, "type": "credit" }
- Content Types:
- Responses:
200
: Success
-
POST /api/payments/my
- Tags: Payment
- Request Body:
- Content Types:
application/json
,text/json
,application/*+json
- Schema:
GetMyPaymentsDto
- Example:
{ "userId": 1 }
- Content Types:
- Responses:
200
: Success
-
GET /api/users
- Tags: Users
- Responses:
200
: Success
-
GET /api/users/{id}
- Tags: Users
- Parameters:
id
(path, required, integer, int32)
- Responses:
200
: Success
-
POST /api/users/signup
- Tags: Users
- Request Body:
- Content Types:
application/json
,text/json
,application/*+json
- Schema:
CreateUserDto
- Example:
{ "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com", "username": "johndoe", "gender": "male", "mobile": 1234567890, "password": "password123", "address": "123 Main St" }
- Content Types:
- Responses:
200
: Success
-
PUT /api/users/edit
- Tags: Users
- Request Body:
- Content Types:
application/json
,text/json
,application/*+json
- Schema:
UpdateUserDto
- Example:
{ "id": 1, "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com", "username": "johndoe", "gender": "male", "mobile": 1234567890, "address": "123 Main St" }
- Content Types:
- Responses:
200
: Success
-
POST /api/users/resetPassword
- Tags: Users
- Request Body:
- Content Types:
application/json
,text/json
,application/*+json
- Schema:
ResetUserPasswordDto
- Example:
{ "id": 1, "newPassword": "newpassword123", "oldPassword": "oldpassword123" }
- Content Types:
- Responses:
200
: Success
-
POST /api/users/login
- Tags: Users
- Request Body:
- Content Types:
application/json
,text/json
,application/*+json
- Schema:
UserLoginDto
- Example:
{ "username": "johndoe", "password": "password123" }
- Content Types:
- Responses:
200
: Success
- Type: object
- Properties:
userId
(integer, int32)
- Additional Properties: false
- Type: object
- Properties:
title
(string, nullable)description
(string, nullable)auctionImage
(string, nullable)auctionCategory
(string, nullable)sellerId
(integer, int32)startTime
(string, date-time)endTime
(string, date-time)startingBid
(number, double)
- Additional Properties: false
- Type: object
- Properties:
auctionId
(integer, int32)itemName
(string, nullable)itemDescription
(string, nullable)itemImage
(string, nullable)itemCategory
(string, nullable)
- Additional Properties: false
- Type: object
- Properties:
auctionId
(integer, int32)bidderId
(integer, int32)status
(string, nullable)bidAmount
(number, double)
- Additional Properties: false
- Type: object
- Properties:
userId
(integer, int32)auctionId
(integer, int32)amount
(number, double)type
(string, nullable)
- Additional Properties: false
- Type: object
- Properties:
firstName
(string, nullable)lastName
(string, nullable)email
(string, nullable)username
(string, nullable)gender
(string, nullable)mobile
(integer, int32)password
(string, nullable)address
(string, nullable)
- Additional Properties: false
- Type: object
- Properties:
userId
(integer, int32)
- Additional Properties: false
- Type: object
- Properties:
userId
(integer, int32)auctionId
(integer, int32)type
(string, nullable)
- Additional Properties: false
- Type: object
- Properties:
id
(integer, int32)
- Additional Properties: false
- Type: object
- Properties:
userId
(integer, int32)
- Additional Properties: false
- Type: object
- Properties:
id
(integer, int32)userId
(integer, int32)
- Additional Properties: false
- Type: object
- Properties:
id
(integer, int32)newPassword
(string, nullable)oldPassword
(string, nullable)
- Additional Properties: false
- Type: object
- Properties:
id
(integer, int32)auctionId
(integer, int32)isLive
(string, nullable)
- Additional Properties: false
- Type: object
- Properties:
id
(integer, int32)firstName
(string, nullable)lastName
(string, nullable)email
(string, nullable)username
(string, nullable)gender
(string, nullable)mobile
(integer, int32)address
(string, nullable)
- Additional Properties: false
- Type: object
- Properties:
username
(string, nullable)password
(string, nullable)
- Additional Properties: false