Fleshes out the README with useful information

This commit is contained in:
2026-05-15 00:00:00 -05:00
parent ac6f3a7014
commit 6327e0d034

View File

@@ -2,14 +2,47 @@
REST API to support a community scavenger hunt app. REST API to support a community scavenger hunt app.
## Environment variables ## Prerequisites
* `DB_PASSWORD` Password for the database
* `DB_URL` JDBC URL for the database
* `DB_USER` Username for the database
* `JWT_SECRET` Secret pass for the JWT
## TODO: - Java 21
### User Endpoints - MariaDB
* delete photo for hunt item DELETE `/hunt/{huntId}/team/{teamId}/item/{itemId}/photo/{photoId}` - MinIO
* list hunt teams with scores for hunt GET `/lead/hunt/{huntId}/team`
* list hunters with scores for hunt GET `/lead/hunt/{huntId}/hunter` ## 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 /hunt/{huntId}/team/{teamId}/item/{itemId}/photo` — list photos for a team's item
- `GET /lead/hunt/{huntId}/team` — leaderboard: teams with scores for a hunt
- `GET /lead/hunt/{huntId}/hunter` — leaderboard: hunters with scores for a hunt