A modern web application for organizing EA FC (FIFA) player drafts with real-time updates, tournament management, and comprehensive player data. Try now at https://fifadraft.kak.dev
fifadraft.mp4
fifadraft2.mp4
fifadraft3.mp4
- Create Drafts: Generate unique draft rooms with custom names and admin controls
- Real-time Drafting: Live WebSocket updates for instant pick notifications
- Player Walkout Animations: Celebratory animations when players are selected
- Draft Order Management: Automatic participant shuffling and turn-based picking
- Shortlist System: Save favorite players for quick access during drafts
- Comprehensive Player Data: 18,000+ EA FC players with detailed stats
- Advanced Search: Filter by position, rating, league, nationality, and more
- Player Comparison: Side-by-side stats comparison for informed decisions
- Player Details: Complete player profiles with abilities, stats, and images
- Post-Draft Tournaments: Automatic tournament generation after draft completion
- Match Recording: Track wins, losses, and draws with score tracking
- Live Standings: Real-time tournament table with points, goal difference, and rankings
- React 19 with TypeScript for type-safe development
- Vite for fast development and optimized builds
- Tailwind CSS 4 for modern, responsive styling
- ShadcnUI for accessible, unstyled components
- React Router for client-side routing
- WebSocket for real-time communication
- Go 1.24 with high-performance HTTP server
- Gorilla WebSocket for real-time bidirectional communication
- SQLx for type-safe database operations
- PostgreSQL 17 for reliable data persistence
- RESTful API with JSON responses
- Docker & Docker Compose for containerized development and deployment
- Google Cloud Platform for production hosting
- Caddy for reverse proxy and SSL termination
- Python Scraper for player data collection from EA's API
eafc-draft/
βββ client/ # React frontend application
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ pages/ # Route components
β β βββ context/ # React context providers
β β βββ lib/ # API utilities and helpers
β β βββ assets/ # Static assets
β βββ package.json # Frontend dependencies
β βββ vite.config.ts # Vite configuration
βββ server/ # Go backend application
β βββ cmd/server/ # Application entry point
β βββ internal/
β β βββ api/ # HTTP handlers and WebSocket logic
β β βββ config/ # Configuration management
β β βββ database/ # Database models and queries
β βββ go.mod # Go dependencies
β βββ Dockerfile # Backend container configuration
βββ scraper/ # Python player data scraper
β βββ scraper.py # EA FC API scraper
β βββ eafc_players.csv # Scraped player data
β βββ pyproject.toml # Python dependencies
βββ docker-compose.yml # Development environment
βββ docker-compose.prod.yml # Production environment
βββ Caddyfile # Reverse proxy configuration
βββ Makefile # Development commands
βββ deploy.sh # Production deployment script
βββ README.md # This file
- Docker & Docker Compose for containerized services
- Node.js 18+ for frontend development
- Go 1.24+ for backend development (optional, Docker handles this)
- Python 3.10+ for scraper (optional)
Create .env file in the root directory:
cp env.example .envRequired variables:
POSTGRES_DB=eafc_draft
POSTGRES_USER=eafc_user
POSTGRES_PASSWORD=your_secure_password
DATABASE_URL=postgres://eafc_user:your_secure_password@localhost:5432/eafc_draft?sslmode=disable
SERVER_ADDRESS=:8080
ALLOWED_ORIGIN=http://localhost:5173Create client/.env.local:
cp client/env.example client/.env.localRequired variables:
VITE_API_BASE_URL=http://localhost:8080/api
VITE_WS_BASE_URL=ws://localhost:8080Start the PostgreSQL database:
# Create Docker volume for persistent data
docker volume create eafc-draft-data
# Start database only
docker compose up database -dImport the player database:
# Navigate to scraper directory
cd scraper
# Install Python dependencies
uv sync
# Run the scraper to get latest player data
uv run python scraper.py
# Import data to database (run from project root)
docker compose exec database psql -U eafc_user -d eafc_draft -c "\copy players FROM '/scraper/eafc_players.csv' WITH (FORMAT csv, HEADER true);"# Start all services (database + backend)
make dev-server
# In another terminal, start frontend
make dev-client- Frontend: http://localhost:5173
- Backend API: http://localhost:8080/api
- Database: localhost:5432 (PostgreSQL)
# Show all available commands
make help
# Start backend services
make dev-server
# Start frontend development
make dev-client
# Deploy to production
make deployThe application is configured for deployment on Google Cloud Platform with the following setup:
- VM Instance: Compute Engine VM with Docker support
- Domain: Custom domains with SSL certificates via Caddy
- Database: PostgreSQL running in Docker container
- Reverse Proxy: Caddy for SSL termination and routing
-
Prepare Production Environment:
# Create production environment file cp env.example .env.prod # Edit .env.prod with production values
-
Deploy to GCP:
make deploy
-
Verify Deployment:
# Check container status gcloud compute ssh eafc-draft-vm --zone=europe-west3-a --command="sudo docker compose -f docker-compose.prod.yml ps"
- Frontend: https://fifadraft.kak.dev
- Backend API: https://fifadraftapi.kak.dev
POST /api/drafts- Create new draftGET /api/drafts/{code}- Get draft detailsPOST /api/drafts/{code}/join- Join existing draftPOST /api/drafts/{code}/start- Start draft (admin only)POST /api/drafts/{code}/tournament- Start tournament (admin only)
GET /api/players- List players with filtersGET /api/players/{id}- Get player detailsPOST /api/drafts/{code}/picks- Make player pick
GET /api/drafts/{code}/tournament- Get tournament dataPOST /api/drafts/{code}/matches- Record match result
draft_joined- Participant joined draftpick_made- Player selecteddraft_started- Draft begantournament_started- Tournament beganmatch_recorded- Match result recorded
Built with β€οΈ by a bunch of friends who spent too many hours playing FIFA