Files
scavengerhunt-api/README.md

48 lines
1.2 KiB
Markdown

# 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
```bash
./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.
1. Create an account: `POST /signup`
2. Log in: `POST /login` — returns an access token and a refresh token
3. Include the access token in requests: `Authorization: Bearer <token>`
4. Refresh an expired token: `POST /refresh`
5. Log out: `POST /logout`
## TODO
- `GET /lead/hunt/{huntId}/team` — leaderboard: teams with scores for a hunt
- `GET /lead/hunt/{huntId}/hunter` — leaderboard: hunters with scores for a hunt