An open-source, IPL-style player auction system with real-time bidding
Experience the thrill of live player auctions β perfect for office cricket leagues, fantasy sports, or any team-building event!
- Real-time Bidding β WebSocket-powered live auctions with instant updates
- Multi-Role System β Admin, Organizer, Auctioneer, Captain, Player, Spectator
- Smart Timer β Auto-resets on bids, configurable duration
- Live Dashboard β Track budgets, rosters, and bid history in real-time
- Spectator Mode β Projector-ready full-screen view for audiences
- Email Invitations β Automated invites via AWS SES (or configure your own SMTP)
- Player Profiles β Photo uploads with skill ratings
- Secure Auth β JWT-based authentication with magic link support
- Docker Ready β One-command deployment with Docker Compose
- Scalable β Redis-based coordination supports multiple workers/pods
| Layer | Technology |
|---|---|
| Backend | FastAPI, SQLAlchemy (async), PostgreSQL, Redis, ARQ |
| Frontend | Next.js 14 (App Router), TailwindCSS, Zustand |
| Storage | AWS S3 (or local uploads) |
| AWS SES (configurable) | |
| Infrastructure | Docker Compose, Traefik (TLS/Let's Encrypt) |
This runs everything including PostgreSQL and Redis in Docker.
# 1. Clone the repository
git clone https://github.com/your-username/cricket-auction.git
cd cricket-auction
# 2. Copy environment file
cp .env.example .env
# 3. Start all services
docker compose up --build
# 4. Open http://localhost in your browserIf you have an existing PostgreSQL database and want to use it instead of Docker's:
# 1. Copy environment file
cp .env.example .env
# 2. Edit .env with your database connection
DATABASE_URL=postgresql+asyncpg://user:password@your-db-host:5432/auction_db
# 3. Start services (without db)
docker compose up --build backend frontend redis nginx worker# Backend
cd backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000
# Frontend (new terminal)
cd frontend
npm install
npm run devNote: You'll need PostgreSQL and Redis running locally or remotely.
Create a .env file in the root directory:
# ββ App ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
SECRET_KEY=your-super-secret-key-change-this
GODMODE_SECRET=testing-secret-for-dev-only
# ββ Database βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Option A: Use Docker's PostgreSQL (default)
DATABASE_URL=postgresql+asyncpg://auction:auction@db:5432/auction
# Option B: Use your own PostgreSQL
# DATABASE_URL=postgresql+asyncpg://user:password@your-host:5432/your_db
# ββ Redis ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
REDIS_URL=redis://redis:6379
# Or your own: REDIS_URL=redis://your-redis-host:6379
# ββ Frontend URLs ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
NEXT_PUBLIC_API_URL=http://localhost/api
NEXT_PUBLIC_WS_URL=ws://localhost/api/auction/ws
# ββ AWS SES (Email) - Optional βββββββββββββββββββββββββββββββββββββββββββββββ
# Leave empty to disable email features
AWS_MAIL_ACCESS_KEY_ID=
AWS_MAIL_SECRET_ACCESS_KEY=
AWS_REGION=ap-south-1
EMAIL_FROM=auction@yourdomain.com
# ββ AWS S3 (Profile Photos) - Optional βββββββββββββββββββββββββββββββββββββββ
# Leave empty to use local file storage
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_BUCKET_NAME=After starting the services, run migrations:
# With Docker
docker compose exec backend alembic upgrade head
# Without Docker
cd backend && alembic upgrade headdocker compose exec backend python seed_players.py# 1. Create production env file
cp .env.prod.example .env.prod
# 2. Configure production values (REQUIRED changes marked)
nano .env.prodRequired changes in .env.prod:
# Your domain (must point to your server IP)
PUBLIC_DOMAIN=auction.yourdomain.com
TRAEFIK_ACME_EMAIL=admin@yourdomain.com
# Generate strong secrets!
SECRET_KEY=$(openssl rand -hex 32)
GODMODE_SECRET=$(openssl rand -hex 32)
POSTGRES_PASSWORD=$(openssl rand -hex 16)# 3. Deploy
docker compose -f docker-compose.prod.yml --env-file .env.prod up --build -d
# 4. Run migrations
docker compose -f docker-compose.prod.yml exec backend alembic upgrade headTo use an external PostgreSQL (e.g., AWS RDS, Supabase, Neon):
- Remove the
dbservice fromdocker-compose.prod.yml - Update
DATABASE_URLin.env.prod:DATABASE_URL=postgresql+asyncpg://user:password@your-rds-endpoint:5432/auction
- Remove
dbfromdepends_onin backend, worker, and migrator services
| Role | Capabilities |
|---|---|
| Admin | Create events, assign organizers/auctioneers, manage allowed email domains |
| Organizer | Configure event settings, add players, create teams, assign captains |
| Auctioneer | Start/pause auction, pick players, hammer sales, finish event |
| Captain | Place bids, view budget & roster, bookmark players |
| Player | Complete profile (photo, ratings), view personal dashboard |
| Spectator | Watch live auction, view standings and history |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 1. ADMIN creates event β assigns ORGANIZER β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 2. ORGANIZER sets up event: β
β β’ Configure budget, max players per team β
β β’ Add players (by email domain) β
β β’ Create teams, assign CAPTAINS β
β β’ Mark event as "Ready" β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 3. System sends email invitations to all participants β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 4. AUCTIONEER starts auction: β
β β’ Pick player (random or manual) β
β β’ Timer starts (180 seconds default) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 5. CAPTAINS bid in real-time: β
β β’ Timer resets on each bid β
β β’ Max bid increment: min(50% of current, 5% of budget) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 6. Timer expires β Player SOLD or UNSOLD β
β β’ Unsold players can be re-auctioned β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 7. AUCTIONEER finishes auction β Summary displayed β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Connect to: ws://your-domain/api/auction/ws/{eventId}?token=<jwt>
| Event | Description |
|---|---|
auction_state |
Full state snapshot on connect |
player_up |
New player put up for auction |
new_bid |
A captain placed a bid |
timer_tick |
Timer countdown (every second) |
player_sold |
Player sold to a captain |
player_unsold |
Player went unsold |
auction_paused |
Auctioneer paused the auction |
auction_resumed |
Auctioneer resumed the auction |
auction_completed |
Auction finished |
Instantly log in as any user without password:
http://localhost/auth/login?godmode=YOUR_GODMODE_SECRET&email=user@example.com
- Swagger UI:
http://localhost/api/docs - ReDoc:
http://localhost/api/redoc
# Backend tests
cd backend
pytest
# Frontend tests
cd frontend
npm testContributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by IPL player auctions
- Built with β€οΈ for cricket lovers
A project by Techiebutler
Have questions? Need help?
Email: support@techiebutler.com
β Star this repo if you find it useful!



