Skip to content
This repository was archived by the owner on Feb 15, 2026. It is now read-only.

oppahansi/ltcbackend

Repository files navigation

LTC Backend - Talent Calculator Backend Service

A Spring Boot backend service for the LTC (Talent Calculator) mobile application.

Overview

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.

Features

  • 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-token endpoint only
  • Logging: Comprehensive request and error logging

Technology Stack

  • Java 21 with Spring Boot
  • Resilience4j for rate limiting
  • Docker for containerization
  • Gradle for build management

Getting Started

Prerequisites

  • Java 21+
  • Gradle 8.8+
  • Docker (optional, for containerized deployment)
  • Battle.net API credentials

Installation

  1. Clone the repository:
git clone https://github.com/oppahansi/ltcbackend.git
cd ltcbackend
  1. 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
  1. Build the project:
./gradlew clean build

Running Locally

./gradlew bootRun

The server starts on http://localhost:8080

Docker Deployment

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 \
  ltcbackend

API Endpoints

Get Token

GET /get-token?api_key=your_api_key

Response (200 OK):

{
  "access_token": "token_string"
}

Error Responses:

  • 403 Forbidden - Invalid or missing API key
  • 429 Too Many Requests - Rate limit exceeded
  • 500 Internal Server Error - Server error

Project Structure

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

Security

  • API requests require valid API key validation via ApiKeyFilter
  • Rate limiting prevents abuse (100 requests/hour)
  • Only /get-token endpoint is accessible
  • HTML escaping on all user inputs
  • Basic Auth for Battle.net API communication

Testing

Run the test suite:

./gradlew test

Tests include:

  • Valid API key token retrieval
  • Invalid API key rejection
  • Rate limiting validation

Configuration

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

Related Projects

  • LTC Frontend - Mobile application for the Talent Calculator

License

This project is licensed under the MIT License - see LICENSE file for details.

Releases

No releases published

Packages

 
 
 

Contributors