Skip to main content

Welcome to the Hub API

The Hub API is a REST API built with Spring Boot that powers the padel booking and match management platform. This API enables you to manage venues, resources, bookings, matches, and user profiles.

Base URL

All API requests should be made to:
https://api.yourdomain.com
For local development:
http://localhost:8080

API Architecture

The Hub API follows these architectural principles:
  • REST principles: Resource-based URLs and standard HTTP methods
  • Spring Boot 3.5: Built on the latest Spring Boot framework
  • OAuth2 Resource Server: Secured with Auth0 JWT tokens
  • Domain-Driven Design: Organized into bounded contexts (booking, matching, venue, IAM)
  • Problem Details (RFC 7807): Standardized error responses

Core Modules

The API is organized into the following modules:

Venues

Manage padel venues, including creation, updates, and image management

Resources

Handle padel courts and other bookable resources within venues

Bookings

Create and manage court bookings with payment processing

Matches

Organize and join padel matches with team management

User Profiles

Manage user profiles and preferences

Media

Upload and manage images via Cloudinary integration

Making Your First Request

Here’s a simple example to get started. This request retrieves all active venues:
curl -X GET https://api.yourdomain.com/api/venues \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json"

API Features

OpenAPI Documentation

The API includes interactive Swagger UI documentation available at:
http://localhost:8080/swagger-ui.html
OpenAPI specification:
http://localhost:8080/v3/api-docs
Swagger UI can be disabled in production by setting SWAGGER_ENABLED=false

Health Checks

Monitor API health status:
curl http://localhost:8080/actuator/health

CORS Configuration

The API supports CORS for the following origins:
  • http://localhost:3000
  • http://localhost:5173
  • Custom frontend URL (configured via APP_FRONTEND_URL)
Allowed methods: GET, POST, PUT, PATCH, DELETE, OPTIONS

Rate Limiting

Rate limiting details should be configured based on your deployment environment. Contact your administrator for specific limits.

API Versioning

The current API version is embedded in the URL path (/api/). Future versions will be introduced as /api/v2/ when breaking changes are necessary.

Next Steps

Authentication

Learn how to authenticate with Auth0 OAuth2

Error Handling

Understand error responses and status codes

Venues API

Start managing venues

Bookings API

Create and manage bookings

Build docs developers (and LLMs) love