A Spring Boot backend service for the LTC (Talent Calculator) mobile application.
LTC Backend provides token management and Battle.net OAuth integration for the LTC mobile app, which helps players calculate and optimize talent builds for World of Warcraft.
- OAuth Token Management: Secure token caching and refresh from Battle.net OAuth
- Rate Limiting: Request rate limiting (100 requests/hour) using Resilience4j
- API Key Validation: Endpoint protection with API key validation
- Single Endpoint Access: Restricted access to
/get-tokenendpoint only - Logging: Comprehensive request and error logging
- Java 21 with Spring Boot
- Resilience4j for rate limiting
- Docker for containerization
- Gradle for build management
- Java 21+
- Gradle 8.8+
- Docker (optional, for containerized deployment)
- Battle.net API credentials
- Clone the repository:
git clone https://github.com/oppahansi/ltcbackend.git
cd ltcbackend- Configure environment variables in
application.properties:
api.key=your_api_key_here
battle.net.client-id=your_client_id
battle.net.client-secret=your_client_secret- Build the project:
./gradlew clean build./gradlew bootRunThe server starts on http://localhost:8080
Build and run with Docker:
docker build -t ltcbackend .
docker run -p 8080:8080 \
-e API_KEY=your_api_key \
-e BATTLE_NET_CLIENT_ID=your_client_id \
-e BATTLE_NET_CLIENT_SECRET=your_client_secret \
ltcbackendGET /get-token?api_key=your_api_key
Response (200 OK):
{
"access_token": "token_string"
}Error Responses:
403 Forbidden- Invalid or missing API key429 Too Many Requests- Rate limit exceeded500 Internal Server Error- Server error
src/
├── main/java/de/oppahansi/ltcbackend/
│ ├── config/ # Configuration classes
│ ├── controller/ # REST controllers
│ ├── filter/ # Request filters
│ ├── model/ # Data models
│ └── LtcProxyApplication.java
└── test/java/
└── de/oppahansi/ltcbackend/
└── controller/ # Integration tests
- API requests require valid API key validation via
ApiKeyFilter - Rate limiting prevents abuse (100 requests/hour)
- Only
/get-tokenendpoint is accessible - HTML escaping on all user inputs
- Basic Auth for Battle.net API communication
Run the test suite:
./gradlew testTests include:
- Valid API key token retrieval
- Invalid API key rejection
- Rate limiting validation
Configure via environment variables or application.properties:
| Property | Description |
|---|---|
api.key |
API key for client authentication |
battle.net.client-id |
Battle.net OAuth client ID |
battle.net.client-secret |
Battle.net OAuth client secret |
- LTC Frontend - Mobile application for the Talent Calculator
This project is licensed under the MIT License - see LICENSE file for details.