Skip to content

mukesh1352/auction_socket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Auction Socket – IPL Auction Management System

Auction Socket is a client–server based auction management system built using Python socket programming and MySQL.
It simulates a simplified IPL-style player auction, where multiple clients can connect to a central server and interact with auction-related functionalities.

The system demonstrates network programming, concurrency, and database integration in a real-time environment.


Overview

The project follows a TCP client–server architecture:

  • The server manages auction logic and communicates with a MySQL database
  • The client connects to the server and interacts via menu-driven options
  • Multiple clients can connect simultaneously using threading

Features

  • TCP socket-based communication
  • Multi-client handling using Python threads
  • Menu-driven auction interaction
  • MySQL database integration for persistent data
  • Fetches and displays remaining (unsold) players
  • Graceful client exit handling

Architecture

Client (Python Socket)
        ⇅ TCP Connection
Server (Python Socket + Threads)
        ⇅
MySQL Database (Players Data)

Tech Stack

Layer Technology
Language Python
Networking Socket Programming (TCP)
Concurrency threading
Database MySQL
Database Driver mysql-connector-python

Functional Flow

  1. Client connects to the server on a specified port
  2. Server sends a welcome message and menu options
  3. Client selects an option from the menu
  4. Server processes the request and responds accordingly
  5. Database queries are executed when required
  6. Client receives and displays the response

Menu Options

1. Buy Player
2. Check the remaining players
3. Check the team players
4. Exit

Note: Some options (such as buying players and viewing team players) are placeholders for future enhancements.


Database Schema (Expected)

The project assumes a MySQL database named players with a table structured similar to:

CREATE TABLE players (
    player_name VARCHAR(100),
    nationality VARCHAR(50),
    role VARCHAR(50),
    price INT
);
  • Players with price = NULL are considered unsold
  • These players are returned when checking remaining players

Setup and Installation

Prerequisites

  • Python 3.8 or higher
  • MySQL Server
  • mysql-connector-python package

Install the required Python package:

pip install mysql-connector-python

Database Configuration

Update the database credentials in the server code:

connection = mysql.connector.connect(
    host='localhost',
    user='your_username',
    password='your_password',
    database='players'
)

Ensure the database is running before starting the server.


Running the Application

Start the Server

python server.py

The server will listen on:

localhost:8888

Start the Client

In a separate terminal:

python client.py

You can start multiple clients in different terminals to test concurrency.


Sample Output

Welcome to the IPL AUCTION.

Choose one of the below options:
1. Buy Player.
2. Check the remaining players.
3. Check the team players.
4. Exit!

Error Handling

  • Handles invalid menu input
  • Gracefully closes client connections
  • Catches database connection and query errors

Limitations

  • Buying players and team management logic are not fully implemented
  • Authentication is not included
  • No encryption (plain TCP sockets)

Future Improvements

  • Implement player bidding and team assignment
  • Add authentication and authorization
  • Improve concurrency control
  • Introduce logging and monitoring
  • Secure communication using SSL/TLS
  • Refactor into modular services

Learning Outcomes

This project demonstrates:

  • Socket-based network programming
  • Client–server architecture
  • Multi-threaded server design
  • Database-backed application logic
  • Real-time interaction between distributed components

License

This project is provided for educational purposes.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages