Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Ambaaq-Ajibike/Online-Auction-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Online Auction System

This project is a microservice-based Online Auction System designed to facilitate real-time bidding and auction management. The system is structured to ensure modularity and scalability, where each microservice handles a specific functionality such as auction room management, bid processing, user notifications, invoice generation, payments, and user authentication.

Services

1. Room Service

  • Functionality: Manages the creation and lifecycle of auction rooms, including auction initiation, room settings, and bid updates. It coordinates with the BiddingService to notify other services of auction activities.
  • Communication: Publishes events through the NATS server to the BiddingService when users enter a room or place a bid. Also interacts with the NotificationService for sending notifications and InvoiceService to generate invoices for the highest bidders.
  • Background Task: Periodically triggers invoice generation tasks at the end of auctions, passing the relevant auction information to the InvoiceService.

2. Bidding Service

  • Functionality: Manages real-time bid processing. This service listens for user activity events from the RoomService to track participants entering auction rooms. It keeps a record of all bids and identifies the highest bidder.
  • Notifications: It sends real-time bid updates to the NotificationService, which notifies all participants of the current highest bid and the leading bidder.

3. Notification Service

  • Functionality: Responsible for sending notifications (emails) to users based on auction events. It receives notifications from the BiddingService and sends them to auction participants using the Brevo (Sendinblue) email service.

4. Invoice Service

  • Functionality: After an auction concludes, this service generates invoices for the highest bidders. It receives information from the RoomService about completed auctions and prepares invoices for payment processing.

5. Payment Service

  • Integration: Uses Paystack for payment processing. Once an invoice is generated by the InvoiceService, the PaymentService handles payment confirmation and processing for the winning bidders.

6. Auth Service

  • Implementation: Handles user authentication and identity management. This service allows users to register, log in, and manage their profiles. It ensures that only authenticated users can participate in auctions and bid.

Technologies Used

  • Microservice Communication: NATS server for event-driven, real-time communication between services.
  • Payment Gateway: Paystack for secure payment transactions.
  • Emailing Service: Brevo (formerly known as Sendinblue) for sending bid and auction-related notifications.
  • ORM: Entity Framework Core (EFCore) for managing interactions with the underlying databases.
  • Backend Framework: ASP.NET Core to build and run the microservices.
  • Containerization: Docker is used to containerize all the services, enabling easier deployment and scalability across different environments.

Project Structure

This system is divided into multiple microservices, each responsible for a distinct part of the auction process:

  • RoomService: Handles auction room management, bid updates, and auction events.
  • BiddingService: Responsible for real-time bid handling and identifying the highest bidder.
  • NotificationService: Sends real-time notifications to users.
  • InvoiceService: Generates invoices for winning bidders after an auction ends.
  • PaymentService: Processes payments from winning bidders through Paystack.
  • AuthService: Manages user authentication and profile handling.

Running the Project

To run the project locally, follow the steps below:

Prerequisites

Ensure you have the following installed on your system:

  • Docker and Docker Compose
  • Git for cloning the repository

Steps to Run the Project Locally

  1. Clone the Repository: Begin by cloning the repository from GitHub:

    git clone https://github.com/Ambaaq-Ajibike/Online-Auction-System
    cd Online-Auction-System
  2. Environment Variables Setup: The system uses environment variables defined in the docker-compose.yml file for database connection strings, Paystack credentials, and Brevo API keys. Make sure you configure them properly:

    • ConnectionStrings__AppConnectionString: Connection strings for each microservice to connect to the SQL Server instance.
    • Brevo API credentials for email notifications.
    • Paystack API keys for payment integration.
  3. Start the Services: Use Docker Compose to build and start the services. Run the following command:

    docker-compose up --build

    This command will:

    • Build and start all the services defined in the docker-compose.yml file.
    • Start a SQL Server instance for database management.
  4. Service Ports: Each service is exposed on specific ports, and you can access them as follows:

    • Room Service: http://localhost:5002
    • Bidding Service: http://localhost:5000
    • Notification Service: http://localhost:5003
    • Invoice Service: http://localhost:5005
    • Payment Service: http://localhost:5001
    • Auth Service: http://localhost:5004
    • SQL Server (Database): http://localhost:1433
  5. Database Initialization: The system uses a SQL Server database to store auction and user data. The database container (mssql) is automatically configured when you run Docker Compose. To interact with the database, connect to it using SQL Server Management Studio (SSMS) or another SQL client:

    • Host: localhost
    • Port: 1433
    • Username: sa
    • Password: ajibike123
  6. Stopping the Services: To stop all running containers, run the following command:

    docker-compose down

    This will stop and remove all the services and containers.

Modifying or Developing the Services

If you need to make changes to any of the services, navigate to the corresponding folder under src/ (e.g., src/BiddingService), make the necessary changes, and then rebuild the specific service:

docker-compose up --build <service-name>

This will rebuild and restart only the modified service.

Running in Production

When deploying this project in a production environment, consider the following:

  • Use Docker Secrets or environment variable management tools to handle sensitive information like API keys and database credentials.
  • Implement monitoring and health checks to ensure services are running correctly.
  • Consider using orchestration tools like Docker Swarm or Kubernetes for scaling and managing service containers.
  • HTTPS: Configure SSL/TLS for secure communication between services and the client.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published