An auction service for AD space using supply/demand side platform. This app consists of 4 microservices.
-
auction_db_svc: Specififes the
ad_space_auctionschema for MySQL database and allows saving/retreiving of data by other auction services- Table
space: id, name, base_price - Table
bidder: id, name, - Table
auction: id, space_id, starts_on, ends_on - Table
auction_bid: id, auction_id, bidder_id, bid_price, bid_on
- Table
-
auction_supply_svc: Provides endpoints to perform CRUD operations for AD spaces
POST /space: Create a new space for auctionGET /space: List all the spaces available for auctionGET /space/:id: Get the info of a specific spacePATCH /space/:id: Update the info of a specific spaceDELETE /space/:id: Delete a specific space
-
auction_demand_svc: Provides endpoints to perform CRUD operations for potential bidders
POST /bidder: Create a new bidderGET /bidder: List all the biddersGET /bidder/:id: Get the info of a specific bidderPATCH /bidder/:id: Update the info of a specific bidderDELETE /bidder/:id: Delete a specific bidder
-
auction_main_svc: Provides endpoints to create/get an auction and allows to make a bid in the auction
POST /auction: Create a new auctionGET /auction: List all the auctionsGET /auction/:id: Get the info of a specific auctionPOST /auction/:id/bid: Make a bid in a specific auction
- Build the docker images
make build
OR
docker build -t apsgangwar/auction_db_svc:latest ./db/
docker build -t apsgangwar/auction_supply_svc:latest ./supply/
docker build -t apsgangwar/auction_demand_svc:latest ./demand/
docker build -t apsgangwar/auction_main_svc:latest ./auction/
- Start the services
It will take about a minute to setup database and start the services.
make install
OR
docker-compose up -d
- Stop the services
make uninstall
OR
docker-compose down
Currently, tests are added for supply/svc package in supply/svc/svc_test.go
file. To test the code, run these command:
cd supply
go mod download
go test supply/svc