Demo: https://wordle-optimizer.jeeyo.workers.dev/
Wordle Optimizer AI is an intelligent companion app designed to help you solve Wordle puzzles more efficiently. It uses Google's Gemini 2.5 Flash model to analyze your current game state and provide statistically optimal word suggestions.
Unlike simple solvers that just list matching words, this optimizer considers information theory (entropy) to suggest words that will eliminate the most possibilities, even if they aren't the final answer.
- 🤖 AI-Powered Analysis: Uses Google Gemini to analyze board state (Green/Yellow/Gray tiles) and suggest the best next moves.
- 🧠 Strategic Reasoning: Provides a brief explanation for why a word is suggested (e.g., "Eliminates common vowels," "Tests specific positions").
- 🎨 Interactive Grid: Replicates the familiar Wordle interface. Type your guess, then tap tiles to toggle their colors to match your actual game.
- 📱 Mobile-First Design: Fully responsive layout that works perfectly on mobile devices, handling virtual keyboards and safe areas correctly.
- ⚡ Blazing Fast: Built with Vite and Cloudflare Workers for instant feedback.
- Frontend: React 19, TypeScript, Tailwind CSS v4, Vite
- Backend: Cloudflare Workers (Serverless)
- AI: Google Gemini API (
gemini-2.5-flash) - State Management: React Hooks
Follow these steps to run the project locally.
- Node.js (v18 or later)
- npm or yarn
- A Google Gemini API Key
-
Clone the repository
git clone <repository-url> cd wordle-optimizer
-
Install dependencies
npm install
-
Configure Environment Variables Create a
.envfile in the root directory.# .env GEMINI_API_KEY=your_api_key_here
You need to run both the frontend and the backend worker.
-
Start the Backend (Cloudflare Worker)
npm run dev:worker
This will start the worker on port
8787. -
Start the Frontend Open a new terminal and run:
npm run dev
This will start the Vite dev server (usually on port
5173). -
Open the App Visit
http://localhost:5173in your browser.
- Start a Game: Open the app. You'll see optimal starting words (like SALET or CRANE).
- Enter Your Guess: Type the word you guessed in your actual Wordle game.
- Set Colors: Tap the tiles in the app to match the colors you received in Wordle:
- Click once for Yellow (Present)
- Click twice for Green (Correct)
- Leave as Gray (Absent)
- Get Suggestions: Press SOLVE (or Enter). The AI will analyze the constraints and suggest the best next words.
- Repeat: Continue until you solve the puzzle!
MIT
