The PitchPro backend reads all runtime configuration from aDocumentation 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.
.env file in the arquimarket/ root directory, loaded at startup via the dotenv package (dotenv.config() is called in both src/main.ts and src/db/connection.ts). No configuration is hard-coded in the application logic — with the exception of insecure development fallbacks for JWT secrets that must be overridden in production.
Environment Variables Reference
The TCP port the Express HTTP server listens on. Change this if port
8000 is already in use on your machine or host.Hostname or IP address of the PostgreSQL server. Use
localhost for a local installation or a Docker container linked by service name (e.g. postgres in Docker Compose).PostgreSQL server port. The standard default is
5432. Change this only if your PostgreSQL instance is bound to a non-standard port.Name of the PostgreSQL database PitchPro will connect to. The database must exist before starting the server — PitchPro creates tables automatically, but not the database itself. Example:
arquimarket.PostgreSQL role / username. The role must have
CONNECT, CREATE TABLE, and INSERT/SELECT/UPDATE privileges on DB_NAME. Example: arquiuser.Password for
DB_USER. Passed directly to the pg.Pool constructor. Never commit a real production password to source control.Secret used to sign and verify access tokens (15-minute expiry). The application falls back to
secret_key_123 if this variable is absent — this fallback is intentionally weak and exists only for local development.Secret used to sign and verify refresh tokens (7-day expiry). The application falls back to
refresh_secret_key_456 if this variable is absent.Runtime environment indicator. Accepted values:
development | production. Affects error verbosity and may be used by middleware libraries (e.g. cors, express) that behave differently in production mode.Example .env File
.env
This is the exact
.env shipped with the repository for local development. Copy it, rename it to .env, and update the values for your environment. The .env file is typically listed in .gitignore and should never be committed to version control.TypeScript Configuration
The TypeScript compiler is configured intsconfig.json at the project root:
tsconfig.json
| Option | Value | Effect |
|---|---|---|
target | ES2020 | Compiles to ES2020 JavaScript, compatible with Node.js 14+ |
module | commonjs | Outputs require()/module.exports — the Node.js native module format |
outDir | ./dist | Compiled .js files are placed in dist/. Run with node dist/main.js |
rootDir | ./src | All TypeScript source lives under src/ |
strict | true | Enables the full suite of strict type checks (no implicit any, strict null checks, etc.) |
esModuleInterop | true | Allows import x from 'module' syntax for CommonJS modules |
npm run build to compile. The output in dist/ is then run with npm start (node dist/main.js).
CORS
The server enables CORS globally using thecors middleware with default settings (all origins allowed):
src/main.ts
The
Authorization header must be included in allowedHeaders when using JWT Bearer tokens from a browser-based frontend.Swagger
Swagger UI is mounted at/docs using swagger-ui-express:
src/main.ts
src/swagger.ts and covers all endpoints across the auth, canchas, and reservas modules. After starting the server, visit:
/docs route (e.g. via an IP allowlist or authentication guard) to avoid exposing your API specification publicly.
Backend Setup
Step-by-step installation, dev server, and seed script.
Environment Variables (Deployment)
How to inject environment variables in Docker and cloud deployments.
Docker Deployment
Run PitchPro and PostgreSQL together with Docker Compose.