Base URL
| Environment | URL |
|---|---|
| Development | http://localhost:3000 |
| Custom | Set EXPO_PUBLIC_API_URL environment variable |
/api. For example: http://localhost:3000/api/challenges.
The frontend automatically derives the backend host from the Metro bundler URI so physical devices and emulators on other networks can reach the backend. Set
EXPO_PUBLIC_API_URL to override this behavior.Request format
- Content-Type: Include
Content-Type: application/jsonon allPOSTandPATCHrequests. - Body: Send request bodies as JSON.
Response format
All responses follow a consistent envelope structure. Successerrors array with per-field details.
Pagination
Endpoints that return lists acceptpage and limit as query parameters. Paginated responses include a top-level pagination object alongside data.
HTTP status codes
| Code | Meaning |
|---|---|
200 | OK — request succeeded |
201 | Created — resource was created |
400 | Bad Request — validation failed or missing fields |
401 | Unauthorized — missing or invalid token |
403 | Forbidden — authenticated but insufficient permissions |
404 | Not Found — resource does not exist |
409 | Conflict — duplicate record (e.g. email already registered) |
429 | Too Many Requests — rate limit exceeded |
500 | Internal Server Error |
Rate limiting
Rate limits are applied per IP address by default. SetRATE_LIMIT_BY=user in the backend environment to key limits by authenticated user ID instead.
Rate limit headers (X-RateLimit-*) are included on all rate-limited responses.
| Limiter | Applied to | Default window | Default max requests |
|---|---|---|---|
publicLimiter | /api/challenges, /api/leaderboard | 15 minutes | 100 |
authLimiter | Auth endpoints | 15 minutes | 5 |
completionLimiter | POST /api/completions | 1 hour | 10 |
flagLimiter | POST /api/flags | 1 hour | 5 |
| Variable | Default | Description |
|---|---|---|
RL_PUBLIC_WINDOW_MINUTES | 15 | Public limiter window in minutes |
RL_PUBLIC_MAX | 100 | Public limiter max requests |
RL_AUTH_WINDOW_MINUTES | 15 | Auth limiter window in minutes |
RL_AUTH_MAX | 5 | Auth limiter max requests |
RL_COMPLETION_WINDOW_HOURS | 1 | Completion limiter window in hours |
RL_COMPLETION_MAX | 10 | Completion limiter max requests |
RL_FLAG_WINDOW_HOURS | 1 | Flag limiter window in hours |
RL_FLAG_MAX | 5 | Flag limiter max requests |
429 and a JSON body:
Health check
{ "status": "ok", "timestamp": "..." }. No authentication required. Useful for uptime monitoring.
Endpoint groups
Authentication
Sign up, log in, verify email, and manage passwords.
Challenges
List and retrieve location-based challenges.
Completions
Submit, list, and like challenge completions.
Users
Retrieve and update user profiles.
Leaderboard
Ranked list of users by aura points.
Flags
Report inappropriate completions.
Upload
Upload images for completion submissions.