Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/JuanSerna14/Final-lenguaje-Avanzado/llms.txt

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

PitchPro (also known as ArquiMarket) is a full-stack sports court reservation platform that solves the real-world problem of managing court rentals end-to-end. It provides a structured way to list available courts, accept bookings with conflict detection, and manage users — all through a clean REST API backed by a React dashboard. The system is composed of two independently runnable projects: a TypeScript/Express backend and a React/Vite frontend, designed to work together over HTTP.

What is PitchPro?

PitchPro connects sports facility managers to their customers through a straightforward booking flow. The backend exposes a secured REST API that handles authentication, court management, and reservation scheduling. The frontend gives users a polished Material UI dashboard to browse courts and place bookings directly from the browser.

Backend — arquimarket

Express + TypeScript REST API running on port 8000. Handles JWT authentication, PostgreSQL persistence, Zod validation, and exposes interactive Swagger docs at /docs.

Frontend — starter-vite-ts

React 18 + Vite + Material UI v5 dashboard on port 5173. Fetches data via Axios with automatic Bearer token injection, state managed by TanStack Query v5.

Core concepts

PitchPro is built around three main data entities. Every feature in the system maps back to one of these:
EntitySpanish termDescription
UsersusersRegistered accounts used for authentication. Passwords are hashed with bcryptjs; each user stores a refresh_token for silent re-authentication.
CourtscanchasThe physical sport spaces available for rent. Each cancha has a name, description, hourly price, and an active/inactive flag.
BookingsreservasA time-slot reservation linking a client to a specific court on a given date. Tracks status (pendiente, confirmada, cancelada) and origin (interfaz, whatsapp).
The backend enforces referential integrity between reservas and canchas via a PostgreSQL foreign key, and uses CHECK constraints to validate estado, origen, and that hora_fin > hora_inicio before any record is written.

Technology stack

PackageVersionRole
express^4.19.2HTTP server and router
typescript^5.4.5Static typing and compilation
pg^8.12.0PostgreSQL client (node-postgres)
bcryptjs^3.0.3Password hashing (10-round salt)
jsonwebtoken^9.0.3Access token (15 min) and refresh token (7 days) generation
zod^3.23.8Schema validation for request bodies
swagger-ui-express^5.0.1Interactive API docs at /docs
dotenv^16.4.5Environment variable loading
cors^2.8.5Cross-origin resource sharing
express-validator^7.3.2Input validation for auth routes
ts-node^10.9.2Direct TypeScript execution in dev

API endpoints at a glance

All endpoints are prefixed with the base URL http://localhost:8000. Endpoints under /api/canchas and /api/reservas require a valid JWT Bearer token in the Authorization header.
MethodPathAuth RequiredDescription
GET/healthNoService health check
POST/api/auth/registerNoRegister a new user
POST/api/auth/loginNoLog in, receive access + refresh tokens
POST/api/auth/refreshNoExchange refresh token for new access token
POST/api/auth/logoutNoInvalidate refresh token
GET/api/auth/meNo*Get current user profile (reads Bearer token)
GET/api/canchasYesList all courts
GET/api/canchas/:idYesGet a single court by ID
POST/api/canchasYesCreate a new court
GET/api/reservasYesList all bookings
POST/api/reservasYesCreate a new booking
GET /api/auth/me reads the Authorization: Bearer header directly but is not routed through the verifyToken middleware mount — it performs its own token verification internally.

Explore further

Quickstart

Get the full stack running locally in under 10 minutes, including database setup and seed data.

Architecture

Understand the database schema, JWT flow, and the module layout behind the API.

Backend Setup

Detailed configuration guide for the Express API, environment variables, and Docker Compose.

API Overview

Full reference for all 11 endpoints with request/response examples.

Build docs developers (and LLMs) love