ReservaFácil uses PostgreSQL as its sole data store, accessed through Prisma ORM. The schema covers three core models —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.
Usuario, Cancha, and Reserva — along with the enums that drive roles, court types, and booking states. This guide walks you through choosing and provisioning a database, pushing the schema, and optionally seeding local test data.
Supported Databases
ReservaFácil requires PostgreSQL 13 or later. The Prisma datasource is configured withprovider = "postgresql" and reads the connection URL from the DATABASE_URL environment variable.
Neon.tech (Recommended)
Serverless PostgreSQL with a generous free tier, instant branching, and SSL enabled by default. No credit card required. Perfect for both development and production.
Any PostgreSQL 13+ Provider
Compatible with Supabase, Railway, Render, AWS RDS, Google Cloud SQL, or a self-hosted instance — as long as you can supply a valid connection string with SSL.
Setting Up Neon.tech
Create a Neon account
Go to neon.tech and sign up for free. You can authenticate with your GitHub, Google, or email account. No credit card is required for the free tier.
Create a new project
After signing in, click New Project. Give it a name (e.g.
reservafacil), choose your preferred cloud region, and click Create Project. Neon provisions a PostgreSQL 16 database in seconds.Copy the connection string
On the project dashboard, open the Connection Details panel and select the Prisma connection string format. It will look similar to:Note the
?sslmode=require suffix — this is mandatory for Neon and is already included in the connection string it provides.Initializing the Database Schema
OnceDATABASE_URL points to a live PostgreSQL instance, push the Prisma schema to create all tables and enums:
prisma/schema.prisma, compares it to the current database state, and applies the necessary DDL statements (CREATE TABLE, CREATE TYPE, etc.) to bring the two into sync. It is non-destructive on empty databases and ideal for first-time setup.
| Table | Description |
|---|---|
Usuario | Platform users with roles: SUPERADMIN, ADMIN, USUARIO |
Cancha | Sports courts with type, pricing, and capacity |
Reserva | Bookings linking a user to a court with time slot and status |
Prisma Client is regenerated automatically every time you run
npm install, thanks to the postinstall script in package.json (prisma generate). You only need to run npx prisma db push manually when setting up a new database or after modifying schema.prisma.The Seed Script
The seed script (prisma/seed.ts) populates your local development database with a minimal set of test users and courts so you can log in and explore all roles immediately after setup.
What the seed creates
Users (3)| Role | Password | |
|---|---|---|
SUPERADMIN | superadmin@reservafacil.com | superadmin123 |
ADMIN | admin@reservafacil.com | admin123 |
USUARIO | usuario@reservafacil.com | usuario123 |
| Name | Type | Price per hour | Capacity |
|---|---|---|---|
| Cancha Fútbol 1 | FUTBOL | S/ 50 | 10 players |
| Cancha Tenis A | TENIS | S/ 30 | 4 players |
| Cancha Básquet | BASQUET | S/ 40 | 10 players |
Running the seed
Make sure your database schema is already pushed (see above), then run:Inspecting the Database with Prisma Studio
Prisma Studio is a visual browser-based editor for your database. It is useful for verifying that the schema push applied correctly and for inspecting or manually editing records during development.http://localhost:5555 where you can browse every table, filter rows, and update fields without writing SQL.