Skip to content

dekhanra/cric-auction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ Cricket Auction App

A simple, real-time IPL-style cricket player auction system for university tournaments. Run it on your laptop and let 4 teams bid live from their phones/laptops!

Python FastAPI License

โœจ Features

  • Real-time bidding via WebSockets โ€” all teams see bids instantly
  • 4 team logins with password protection
  • Admin/Auctioneer controls โ€” next player, sold, unsold
  • Player pools โ€” Marquee, Batsman, Bowler, All-Rounder
  • Budget tracking โ€” auto-deducted when player is sold
  • Squad management โ€” see each team's purchased players
  • SQLite database โ€” no server setup needed
  • Public URL โ€” share via Cloudflare Tunnel (free, secure HTTPS)
  • Single file deployment โ€” one Python file, one HTML file

๐Ÿš€ Quick Start

One-Command Setup

git clone https://github.com/yourusername/cricket-auction.git
cd cricket-auction
chmod +x install_and_run.sh
./install_and_run.sh

That's it! The script will:

  1. Create a Python virtual environment
  2. Install dependencies
  3. Download Cloudflare Tunnel (for public URL)
  4. Start the server
  5. Display the public URL to share with teams

Manual Setup

# Clone the repo
git clone https://github.com/yourusername/cricket-auction.git
cd cricket-auction

# Create virtual environment
python3 -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Run the server
python main.py

๐Ÿ” Login Credentials

Role Username Password
๐Ÿ”ด Royal Strikers team1 strike1
๐Ÿ”ต Thunder Kings team2 thunder2
๐ŸŸข Super Chargers team3 charge3
๐ŸŸก Fire Eagles team4 eagle4
๐Ÿ‘‘ Admin (Auctioneer) admin admin123

โš ๏ธ Change these passwords in main.py before your actual auction!

๐Ÿ“ฆ Player Pools

Players are organized into 4 pools for structured bidding:

Pool Icon Description
Marquee โญ Top premium players (highest base prices)
Batsman ๐Ÿ Specialist batsmen
Bowler ๐ŸŽฏ Specialist bowlers
All-Rounder ๐Ÿ’ช All-rounders and Wicket-keepers

Admin can switch between pools during the auction.

๐ŸŽฎ How to Use

For the Auctioneer (Admin):

  1. Open the app and login as admin
  2. Select a pool (start with Marquee)
  3. Click "Next Player" to put a player on the block
  4. Wait for teams to bid
  5. Click "SOLD" when bidding stops, or "Unsold" if no bids
  6. Repeat until all players are auctioned

For Teams:

  1. Open the shared URL on your phone/laptop
  2. Login with your team credentials
  3. When a player is on the block, click "BID +50" to place a bid
  4. Watch your budget and squad in real-time

๐ŸŒ Network Options

Option 1: Mobile Hotspot (Recommended for universities)

If your university network blocks tunnels:

  1. Turn on your phone's mobile hotspot
  2. Connect your laptop + all team devices to the hotspot
  3. Run the server and share your local IP: http://192.168.x.x:8000

Option 2: Cloudflare Tunnel (Public Internet)

The install script automatically sets up a secure HTTPS tunnel:

https://random-words.trycloudflare.com

Option 3: Local Network (Same WiFi)

If everyone is on the same network:

hostname -I  # Get your IP
# Share: http://YOUR_IP:8000

๐Ÿ“ Project Structure

cricket-auction/
โ”œโ”€โ”€ install_and_run.sh   # One-click setup script
โ”œโ”€โ”€ main.py              # FastAPI backend (single file)
โ”œโ”€โ”€ players.csv          # Player data (60 players)
โ”œโ”€โ”€ requirements.txt     # Python dependencies
โ”œโ”€โ”€ README.md            # This file
โ”œโ”€โ”€ LICENSE              # MIT License
โ”œโ”€โ”€ .gitignore           # Git ignore rules
โ””โ”€โ”€ static/
    โ””โ”€โ”€ index.html       # Frontend (single file)

โš™๏ธ Configuration

Edit main.py to customize:

# Team settings
TEAMS = {
    "team1": {"name": "Royal Strikers", "password": "strike1", "color": "#e63946"},
    "team2": {"name": "Thunder Kings", "password": "thunder2", "color": "#457b9d"},
    # ... add more teams
}

# Budget and bidding
TOTAL_BUDGET = 5000      # Each team's starting budget
BID_INCREMENT = 50       # Minimum bid increment

# Admin password
ADMIN_PASSWORD = "admin123"

๐Ÿ“‹ Customizing Players

Edit players.csv to add your own players:

name,role,base_price,pool
John Doe,Batsman,200,Marquee
Jane Smith,Bowler,150,Bowler

Pools: Marquee, Batsman, Bowler, All-Rounder Roles: Batsman, Bowler, All-Rounder, Wicket-Keeper

๐Ÿ”ง Troubleshooting

"Address already in use" error

pkill -f "python3 main.py"

Database reset

rm auction.db*
python main.py  # Will recreate from players.csv

Tunnel not working

  • Try mobile hotspot instead
  • Check if your network blocks outbound connections

๐Ÿ› ๏ธ Tech Stack

  • Backend: Python 3.8+ with FastAPI
  • Frontend: Vanilla HTML/CSS/JavaScript
  • Database: SQLite (file-based, no setup)
  • Real-time: WebSockets
  • Tunnel: Cloudflare Tunnel (cloudflared)

๐Ÿ“„ License

MIT License - feel free to use for your university tournaments!

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ™ Acknowledgments

  • Built for university cricket tournaments
  • Inspired by IPL auction format
  • Thanks to FastAPI and Cloudflare for awesome free tools

Made with โค๏ธ for cricket lovers

About

A simple, real-time IPL-style cricket player auction system for small tournaments. Run it on your laptop and let 4 teams bid live from their phones/laptops!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors