Skip to content

YiranHu361/wordle-backend

Repository files navigation

Wordle Solver Backend

A Spring Boot REST API for solving Wordle puzzles using intelligent heuristics and data structures.

🚀 Features

  • Smart Wordle Solving: Advanced algorithms to suggest optimal words
  • RESTful API: Clean endpoints for frontend integration
  • CORS Support: Ready for web application integration
  • Health Monitoring: Built-in health check endpoint

🛠️ Tech Stack

  • Framework: Spring Boot 3.3.5
  • Language: Java 17
  • Build Tool: Maven
  • API: RESTful endpoints

📡 API Endpoints

Health Check

GET /api/wordle/health

Returns: "Wordle Solver API is running!"

Solve Wordle

POST /api/wordle/solve
Content-Type: application/json

{
  "word": "hello",
  "hints": "- e - - x"
}

Response:

{
  "suggestions": ["world", "house", "mouse"],
  "message": "Found 3 suggestions",
  "success": true
}

🚀 Quick Start

Prerequisites

  • Java 17 or higher
  • Maven 3.6+

Local Development

# Clone the repository
git clone https://github.com/YiranHu361/wordle-backend.git
cd wordle-backend

# Run the application
mvn spring-boot:run

The API will be available at http://localhost:8080

Build and Run

# Build the application
mvn clean package

# Run the JAR
java -jar target/wordle-backend-0.0.1-SNAPSHOT.jar

🌐 Deployment

Render (Recommended)

  1. Connect your GitHub repository to Render
  2. Set build command: mvn clean package
  3. Set start command: java -jar target/wordle-backend-0.0.1-SNAPSHOT.jar
  4. Deploy!

Environment Variables

  • PORT: Server port (auto-set by platform)
  • SPRING_PROFILES_ACTIVE: Set to production for production

🔧 Configuration

CORS Settings

The API is configured to accept requests from:

  • http://localhost:3000 (development)
  • https://*.vercel.app (Vercel deployments)
  • https://*.netlify.app (Netlify deployments)

Application Properties

server.port=${PORT:8080}
spring.application.name=wordle-backend
spring.profiles.active=${SPRING_PROFILES_ACTIVE:default}

📝 Wordle Hint Format

Use the following format for hints:

  • - = Gray (letter not in word)
  • y = Yellow (letter in word, wrong position)
  • g = Green (letter in word, correct position)

Example:

  • Word: hello
  • Hints: - e - - x
  • Meaning: h (gray), e (yellow), l (gray), l (gray), o (gray)

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

📄 License

This project is open source and available under the MIT License.

📧 Contact

Yiran Hu - GitHub

About

Spring Boot Wordle Solver Backend API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors