Before proceeding with the installation instructions, please note that the required backend services are located in the Backend/
folder. The backend implementation, consisting of essential microservices and configurations, can be found within this directory. Make sure to follow the subsequent steps to set up and run these services effectively for seamless integration with your application.
Before setting up the backend for your application, ensure that the following prerequisites are met:
- MySQL Database: Install MySQL and MySQL Workbench.
- Maven: Install Maven for building and managing the project.
- Open MySQL Workbench.
- Create a new connection and name it "eauction."
- Locate the SQL file in the
Database
folder. - Open the newly created "eauction" connection.
- Copy the content of the SQL file and execute the query to populate the database and tables.
- Navigate to each microservice's subfolder within
Backend\eauction
. - Open the
src/main/resources/application.properties
file. - Set the appropriate
username
andpassword
for the MySQL database connection.
-
Navigate to the
Backend\eauction\Common-Library
folder. -
Open a terminal and run the following command:
mvn clean install
-
Ensure the build is successful before proceeding.
-
Navigate to each individual microservice's subfolder within
Backend\eauction
. -
Open a terminal and run the following commands:
mvn clean install mvn spring-boot:run
-
Repeat the above steps for each microservice.
-
Ensure that the common library is successfully built before building the microservices.
Your application backend is now set up and running. Ensure that the necessary configurations and dependencies are in place for each microservice, and you are ready to start using your application.
The createAuction
endpoint of the AuctionService is seamlessly integrated with the addItem
endpoint of the SellerService. Here's how the integration works:
-
When the
addItem
endpoint of the SellerService successfully adds an item to the item table, it automatically triggers a call to thecreateAuction
endpoint of the AuctionService. -
The
createAuction
endpoint of the AuctionService then processes the request and adds the newly added item to the auction, making it available for bidding.
-
SellerService:
- Base URL:
http://localhost:8081
- Endpoint:
/addItem
- Base URL:
-
AuctionService:
- Base URL:
http://localhost:8082
- Endpoint:
/createAuction
- Base URL:
To ensure seamless integration, make sure to run both services simultaneously. The SellerService should be running on port 8081, and the AuctionService on port 8080.
You can start both services with the following commands:
# Start SellerService on port 8081
$ cd path/to/SellerService
$ mvn spring-boot:run
# Start AuctionService on port 8082
$ cd path/to/AuctionService
$ mvn spring-boot:run
The AuctionService is a component of our system that facilitates the auctioning of items. Below are key details about the AuctionService:
-
Port: 8082
-
Auction Scheduler:
- The
AuctionService
features an auction scheduler that runs every 3 minutes. - It invokes the
ItemCatalogueService
on port 8080 using the endpoint/getAuctionedItems
.
- The
-
Integration with ItemCatalogue Service:
- The
AuctionService
integrates with theItemCatalogueService
to retrieve a list of auctioned items. - It calls the
/getAuctionedItems
endpoint on theItemCatalogueService
to obtain information about the current auction items.
- The
-
Auction Timer Logic:
- Upon receiving the list of auctioned items, the
AuctionService
processes the data. - It matches the auction start time and end time with the current time to determine whether to start or end an auction.
- This timer functionality ensures that auctions progress based on predefined schedules.
- Upon receiving the list of auctioned items, the
-
Simultaneous Execution:
- The
AuctionService
runs on port 8082, and theItemCatalogueService
runs on port 8080. - Both services should be run simultaneously to achieve the desired results.
- Ensure that both services are up and running concurrently for effective auction management.
- The
Note: Make sure to start both services simultaneously for seamless integration and proper functioning of the auction scheduler.