Hermes is a backend that manages a Minecraft player system, tracking their statistics and data in real time with Redis caching.
Hermes is a RESTful backend developed in Java with Spring Boot for managing Minecraft player data (users, economy, statistics) and authenticating multiple Minecraft servers using JWT. It includes Redis caching, persistence with MySQL, and is fully dockerized for development and production.
Hermes is a backend system that:
This project is designed as a robust Minecraft backend foundation (economy, achievements, statistics, etc.).
| Component | Technology | | -------------- | ---------------------------- | | Backend | Java 17 + Spring Boot | | Persistence | MySQL | | Cache | Redis | | Authentication | JWT | | Build | Gradle (with Gradle Wrapper) | | Containers | Docker + Docker Compose |
hermes/
โโ src/
โ โโ main/java/... # Main code
โ โโ main/resources # Configs and startup SQL
โ โโ test/ # Tests (if any)
โโ gradlew
โโ build.gradle.kts # Gradle build
โโ settings.gradle.kts
โโ Dockerfile
โโ docker-compose.yml
โโ .env-template # Example environment variables
โโ README.md # โ This file
cp .env-template .env
Edit .env with your secrets (JWT, MySQL, Redis, etc.)
Start all services:
docker compose --env-file .env up --build
This will launch:
โ๏ธ MySQL โ๏ธ Redis โ๏ธ Hermes backend
docker compose --env-file .env up -d --build
docker compose ps
docker compose logs -f hermes
docker compose down
| Method | Endpoint | Description |
| ------ | ---------------------- | ----------------------------------- |
| POST | /api/v1/auth/login | Server login with credentials |
| POST | /api/v1/auth/refresh | Refresh token to renew access token |
Returns accessToken and refreshToken.
| Method | Endpoint | Description |
| ------ | -------------------- | ---------------------- |
| GET | /api/v1/users | List users (paginated) |
| GET | /api/v1/users/{id} | Get user by ID |
| POST | /api/v1/users | Create a new user |
| DELETE | /api/v1/users/{id} | Delete user |
This allows Minecraft servers to maintain sessions without resending sensitive credentials continuously.
| Entity | Key Fields |
| --------------- | ----------------------------------- |
| Server | id, password |
| User | id, name |
| UserEconomy | coins, gems |
| UserStatistic | kills, deaths, wins, losses |
Place a data.sql file in src/main/resources with initial inserts for:
Spring Boot will execute it automatically on startup (configurable with spring.jpa.hibernate.ddl-auto).
# MySQL
MYSQL_ROOT_PASSWORD=rootpassword
MYSQL_DATABASE=hermes
MYSQL_USER=hermesuser
MYSQL_PASSWORD=hermespass
# Redis
REDIS_PASSWORD=redispass
# Application
SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/hermes
SPRING_DATASOURCE_USERNAME=hermesuser
SPRING_DATASOURCE_PASSWORD=hermespass
SPRING_REDIS_HOST=redis
SPRING_REDIS_PASSWORD=redispass
JWT_SECRET=yourSuperSecretJWT
spring.jpa.hibernate.ddl-auto=update to let Spring create tables automatically.For guidance on README structure and best practices: GitHub Docs
This project is licensed under the MIT License. See the LICENSE file for details.