CoworkingBooking is a Spring Boot 4 REST API designed to manage the full lifecycle of coworking space reservations — from registering shared workspaces and meeting rooms to creating and tracking bookings for individual users. Built for educational and production-ready deployment scenarios alike, it provides a clean JSON interface over three core resources (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/devdavco/backend_1/llms.txt
Use this file to discover all available pages before exploring further.
Espacio, Usuario, Reserva), backed by a PostgreSQL database and fully documented via OpenAPI 3.
Key Features
Three REST Resources
Full CRUD endpoints for Espacios (spaces), Usuarios (users), and Reservas (bookings), each under its own base path (
/espacios, /usuarios, /reserva).OpenAPI / Swagger UI
Interactive API documentation generated automatically by
springdoc-openapi. The raw spec is served at /api-docs and the browser UI at /swagger-ui.html.PostgreSQL + JPA Persistence
All data is persisted in PostgreSQL via Spring Data JPA and Hibernate. SSL-enforced connections make the setup compatible with hosted providers such as Supabase out of the box.
CORS Support
Every controller carries a
@CrossOrigin annotation, allowing the companion Next.js dashboard (or any approved frontend origin) to call the API directly from a browser without proxy configuration.Global Error Handling
Service-layer exceptions are caught and surfaced as structured HTTP error responses, keeping client-side error handling predictable across all endpoints.
HikariCP Connection Pool
The embedded HikariCP pool is pre-configured with a maximum of 10 connections and schema pinning, ensuring efficient resource usage under concurrent load.
API Endpoints
The API exposes 16 public endpoints across the three resource groups:| Method | Path | Description |
|---|---|---|
GET | /espacios/all | List all coworking spaces |
GET | /espacios/{id} | Retrieve a space by ID |
POST | /espacios/create | Create a new coworking space |
DELETE | /espacios/eliminar/{id} | Delete a space by ID |
GET | /espacios/ping | Health check — returns "pong" |
GET | /reserva/all | List all reservations |
GET | /reserva/{id} | Retrieve a reservation by ID |
POST | /reserva/create | Create a new reservation |
PUT | /reserva/update/{id} | Update a reservation’s status |
DELETE | /reserva/eliminar/{id} | Delete a reservation by ID |
GET | /reserva/ping | Health check — returns "pong" |
GET | /usuarios/all | List all users |
GET | /usuarios/{id} | Retrieve a user by ID |
POST | /usuarios/create | Create a new user |
DELETE | /usuarios/eliminar/{id} | Delete a user by ID |
GET | /usuarios/ping | Health check — returns "pong" |
Architecture Overview
CoworkingBooking follows a classic Spring layered architecture. An incoming HTTP request travels through four layers before touching the database:| Resource | Base Path | Description |
|---|---|---|
| Espacio | /espacios | Coworking spaces and meeting rooms, including type, capacity, and post-session cleaning buffer |
| Usuario | /usuarios | Registered users with a role (usuario or admin) and hashed password |
| Reserva | /reserva | Bookings that link a user to a space with start time, user end time, total end time (including cleaning), and status |
The repository also includes a companion Next.js dashboard (
swagger-to-ui/) that consumes this API and provides a browser-based UI for managing spaces, users, and bookings. Configure its target API with the NEXT_PUBLIC_API_URL environment variable.Base URL
The API runs on port8080 by default when started locally:
NEXT_PUBLIC_API_URL environment variable, falling back to http://localhost:8080 when the variable is not set:
NEXT_PUBLIC_API_URL in your .env.local file (Next.js dashboard) or as a deployment environment variable to point the frontend at a hosted API instance.
Health Check Endpoints
Each resource group exposes a dedicatedGET /ping endpoint that returns the plain string "pong". Use these to confirm the server is up and routing requests correctly before running further tests:
| Endpoint | Returns |
|---|---|
GET /espacios/ping | pong |
GET /reserva/ping | pong |
GET /usuarios/ping | pong |