routers
feat: Implement game state snapshotting and auto-saving, add bid plot number validation, and enable admin team disconnection.
tests
feat: Implement initial auction backend with admin controls for managing auction state and plots, along with core infrastructure, models, and tests.
.dockerignore
feat: Introduce Docker support for the backend with a new Dockerfile, .dockerignore, and updated seed script to handle containerized CSV paths.
.gitignore
feat: Implement auction round management, previous plot navigation with refund logic, recent bids API, and enhance bid validation.
.python-version
feat: Implement initial auction backend with admin controls for managing auction state and plots, along with core infrastructure, models, and tests.
auction.db
feat: Implement auction round management, previous plot navigation with refund logic, recent bids API, and enhance bid validation.
database.py
feat: Add admin endpoint to force resell plots, refine Round 4 advancement logic, update database enum handling to be asynchronous, and remove CSV seeding.
Dockerfile
feat: Add admin endpoint to force resell plots, refine Round 4 advancement logic, update database enum handling to be asynchronous, and remove CSV seeding.
main.py
fix: socket fix in railway
models.py
feat: Implement game state snapshotting and auto-saving, add bid plot number validation, and enable admin team disconnection.
pyproject.toml
contour detection
README.md
updated README
seed.py
feat: Add admin endpoint to force resell plots, refine Round 4 advancement logic, update database enum handling to be asynchronous, and remove CSV seeding.
seed.py.orig
feat: Add admin endpoint to force resell plots, refine Round 4 advancement logic, update database enum handling to be asynchronous, and remove CSV seeding.
socket_manager.py
feat: Implement game state snapshotting and auto-saving, add bid plot number validation, and enable admin team disconnection.
start.sh
feat: Add admin endpoint to force resell plots, refine Round 4 advancement logic, update database enum handling to be asynchronous, and remove CSV seeding.
uv.lock
contour detection

AU-FEST 2026 Auction Backend

Real-time auction backend for AU-FEST 2026 land plot auction system. Built with FastAPI and Socket.IO for real-time bidding updates.

Tech Stack

  • FastAPI - REST API framework
  • Socket.IO - Real-time bidirectional communication
  • SQLModel - Database ORM (supports PostgreSQL/SQLite)
  • PostgreSQL - Primary database (via asyncpg)
  • pytest - Testing framework

Features

  • Team authentication with passcode
  • Real-time bid updates via WebSocket
  • Admin controls: start, pause, advance to next plot, reset auction
  • Plot management with status tracking (pending, active, sold)
  • Budget tracking for teams
  • Connected client monitoring

Setup

Prerequisites

  • Python 3.12+
  • PostgreSQL database

Installation

uv sync

Environment Variables

Create a .env file:

DATABASE_URL=postgresql+asyncpg://user:password@host:5432/auctionfest
SECRET_KEY=asdjkasd
ALLOWED_ORIGINS=http://localhost:5173,http://localhost:3000

Database Setup

# Seed database with sample data
uv run seed.py

Running the Server

uv run uvicorn main:app --host 0.0.0.0 --port 8000 --reload

The server runs on http://localhost:8000

API Endpoints

Authentication

  • POST /api/auth/login - Team login

Data

  • GET /api/data/plots - Get all plots
  • GET /api/data/teams - Get all teams
  • GET /api/data/team/{team_id} - Get specific team
  • GET /api/data/connected - Get connected client count

Admin

  • GET /api/admin/state - Get auction state
  • POST /api/admin/start - Start auction
  • POST /api/admin/pause - Pause auction
  • POST /api/admin/next - Move to next plot
  • POST /api/admin/reset - Reset auction

Socket.IO Events

Emitted Events

  • auction_state_update - Auction state changes
  • bid_update - New bid placed
  • auction_reset - Auction reset

Client Events (handled server-side)

  • join_room - Join auction room
  • place_bid - Place a bid on current plot

Database Models

  • Team - Bidding teams with budget and spent tracking
  • Plot - Auction plots with area, price, and status
  • Bid - Individual bids with amount and timestamp
  • AuctionState - Global auction state (current plot, status)