The PitchPro backend is an Express + TypeScript REST API located in theDocumentation 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.
arquimarket/ directory. It handles court management, reservations, and JWT-based authentication, with PostgreSQL as its data store and automatic schema initialization on every startup.
Prerequisites
| Requirement | Version |
|---|---|
| Node.js | 18 or later |
| npm | Bundled with Node.js 18+ |
| PostgreSQL | 14 or later (or Docker with a Postgres image) |
Installation
This installs all runtime and dev dependencies, including
express, pg, jsonwebtoken, bcryptjs, zod, swagger-ui-express, and TypeScript tooling.# Database
DB_HOST=localhost
DB_PORT=5432
DB_NAME=arquimarket
DB_USER=arquiuser
DB_PASSWORD=arquipass
# API
PORT=8000
NODE_ENV=development
See the Configuration page for a full description of every variable.
This runs
ts-node src/main.ts, which initializes the database schema and starts listening. You should see:Available Scripts
| Script | Command | Description |
|---|---|---|
dev | ts-node src/main.ts | Start the development server with live TypeScript execution |
seed | ts-node src/db/seed.ts | Populate the database with 20 sample courts and 20 reservations |
build | tsc | Compile TypeScript to JavaScript in dist/ |
start | node dist/main.js | Run the compiled production build |
Seed Data
Run the seed script to populate the database with realistic sample data for development and testing:- 20 canchas — courts named
Cancha 1throughCancha 20, each with a synthetic grass description and aprecio_horathat cycles through values between30.00and55.00:
- 20 reservas — reservations randomly distributed across the next 30 days, assigned to existing court IDs, with randomized
estado(pendiente,confirmada,cancelada) andorigen(whatsapp,interfaz).
Run
npm run seed only after starting the server at least once, so initDatabase() has had a chance to create the tables.Swagger UI
Once the server is running, interactive API documentation is available at:swagger-ui-express and covers all endpoints in the auth, canchas, and reservas modules.
Project Structure
Database Schema
Explore the three-table PostgreSQL schema and connection pool setup.
Authentication
Understand the JWT dual-token strategy and all auth endpoints.
Configuration
Full reference for every environment variable.
API Overview
Browse the full REST API endpoint reference.