A web application that helps Fantasy Premier League (FPL) managers analyze player performance and build optimal squads based on expected points. This app was built ENTIRELY with Cursor's Composer AI. I wrote almost 0 lines of code.
- Interactive pitch visualization for building your squad
- Position-specific player slots with validation rules:
- Exactly 1 goalkeeper
- At least 3 defenders
- At least 1 forward
- Maximum 5 defenders/midfielders
- Maximum 3 forwards
- Real-time squad statistics
- Player search with position filtering
- Player cards showing:
- Current points
- Expected points
- Team information
- Player photo
- Reset squad functionality
- Complete overview of all Premier League players
- Sortable columns for:
- Total points
- Expected points (xPts)
- Form
- Selection percentage
- Cost
- Team filtering
- Position filtering
- Fast, responsive search functionality
- Support for special characters and accents
- Displays player photos and team information
- Caches results for improved performance
- React-based SPA with React Router
- Modular component structure
- Responsive design
- Improved styling with consistent UI elements
- Performance optimizations:
- Player data caching
- Efficient state management
- Optimized rendering
- Flask API with CORS support
- Efficient data fetching from FPL API
- Player name normalization for better search
- Expected points calculation based on:
- Goals and assists
- Clean sheets
- Appearance points
- Bonus points
- Modular code structure with separate modules for:
- Position enums
- Helper functions
- API routes
- Clone the repository:
git clone https://github.com/yourusername/fpl-xpts-calculator.git
cd fpl-xpts-calculator
- Install dependencies:
# Install Python dependencies
pip install -r requirements.txt
# Install Node.js dependencies
npm install
- Build and run:
# Build frontend
npm run build
# Start server
gunicorn wsgi:app
For development, you can run:
# Run frontend dev server
npm run dev
# Run backend dev server
python app.py
- React 18
- React Router 6
- Vite
- Flask 3.0.0
- Flask-CORS 4.0.0
- Requests 2.31.0
- Python-dotenv 1.0.0
- Gunicorn 21.2.0
- Werkzeug 3.0.1
The application is configured for deployment on Heroku:
- Set up a new Heroku app
- Connect your repository
- Deploy the main branch
The build process will automatically:
- Install dependencies
- Build the React frontend
- Start the Gunicorn server
Feel free to submit issues and enhancement requests!