Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Nyverie/reservafacil/llms.txt

Use this file to discover all available pages before exploring further.

ReservaFácil (also known as CanchaYA) is a full-stack sports court booking platform designed for sports facilities, community centers, and clubs that need a straightforward way to manage court availability and player reservations. Built on Next.js 16 with an App Router architecture, it gives end users a clean interface to browse courts and book time slots, while admins and superadmins get dedicated dashboards to manage courts, review reservations, and oversee the entire platform — all without double-bookings thanks to built-in time-slot conflict detection.

Key Features

Role-Based Access Control

Three distinct roles — USUARIO, ADMIN, and SUPERADMIN — each redirect to their own dashboard on login, with protected routes enforced at the middleware level.

Multi-Sport Court Management

Create and manage courts across four sport types: football (FUTBOL), tennis (TENIS), basketball (BASQUET), and volleyball (VOLLEYBALL), each with pricing, capacity, and optional images.

Conflict-Free Scheduling

Every booking request is validated against existing reservations for the same court and date, preventing overlapping time slots before they reach the database.

JWT Authentication

Stateless authentication via JSON Web Tokens signed with HS256, stored in an HTTP-only cookie named token with a 7-day expiry — no session storage required.

Admin Reservation Dashboard

Admins can view all reservations across their courts, confirm or cancel bookings, and update statuses (PENDIENTE → CONFIRMADA → COMPLETADA / CANCELADA) from a single panel.

Superadmin System Management

Superadmins have full platform visibility: system-wide reservation reports, user management (activate/deactivate accounts, change roles), and access to all admin functions.

Tech Stack

  • Next.js 16 — App Router, Server Actions, and API Routes
  • TypeScript — end-to-end type safety across the full stack
  • Prisma ORM — schema-first database access with PostgreSQL
  • PostgreSQL — relational database for users, courts, and reservations
  • Tailwind CSS 4 — utility-first styling with tailwind-merge and clsx
  • jose — JWT signing and verification (HS256) for stateless auth
  • bcryptjs — password hashing for secure credential storage

Project Structure at a Glance

The platform models three core database entities defined in prisma/schema.prisma:
ModelSpanish namePurpose
UsuarioUserPlatform accounts with role assignment
CanchaCourtBookable sports courts with type and pricing
ReservaReservationBookings linking a user, a court, and a time
ReservaFácil’s UI and data layer are intentionally in Spanish. Key terms you’ll encounter throughout the codebase and API: cancha (court), reserva (booking/reservation), usuario (user), rol (role), and estado (status). English equivalents are used in this documentation for clarity.

Build docs developers (and LLMs) love