1.2 KiB
1.2 KiB
Scavenger Hunt API
REST API to support a community scavenger hunt app.
Prerequisites
- Java 21
- MariaDB
- MinIO
Environment Variables
| Variable | Description |
|---|---|
DB_URL |
JDBC URL for the MariaDB database |
DB_USER |
Database username |
DB_PASSWORD |
Database password |
JWT_SECRET |
Secret key used to sign JWTs |
MINIO_ENDPOINT |
MinIO server URL (e.g. http://localhost:9000) |
MINIO_ACCESS_KEY |
MinIO access key |
MINIO_SECRET_KEY |
MinIO secret key |
MINIO_BUCKET |
MinIO bucket name for photo storage |
Running
./gradlew bootRun
API Documentation
Swagger UI is available at /docs/swagger-ui.html when the application is running.
Authentication
All endpoints except /signup and /login require a JWT bearer token.
- Create an account:
POST /signup - Log in:
POST /login— returns an access token and a refresh token - Include the access token in requests:
Authorization: Bearer <token> - Refresh an expired token:
POST /refresh - Log out:
POST /logout
TODO
GET /lead/hunt/{huntId}/team— leaderboard: teams with scores for a huntGET /lead/hunt/{huntId}/hunter— leaderboard: hunters with scores for a hunt