This guide walks you from zero to a fully running ReservaFácil instance on your local machine. By the end you’ll have the development server running, the database schema applied, and three test accounts ready to log in with — one for each role.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.
Prerequisites
Before you begin, make sure you have the following available:- Node.js 18 or later — check with
node -v - A PostgreSQL database — local install or a free hosted instance (see tip below)
- Git — to clone the repository
Setup Steps
Clone the repository and install dependencies
Clone the ReservaFácil repository and install all Node.js dependencies. The
postinstall script runs prisma generate automatically after install.Configure environment variables
Copy the example environment file to Open
.env.local, which Next.js loads automatically during development..env.local and fill in each variable:DATABASE_URL— your PostgreSQL connection string. If you’re using Neon, paste the connection string from the Neon dashboard.JWT_SECRET— any random string of at least 32 characters used to sign and verify JWT tokens. See the Environment Setup page for how to generate a secure value.NEXTAUTH_URL— the canonical public URL of your deployment. Leave this as the placeholder for local development; it’s only required when deploying to production.
Push the database schema
Apply the Prisma schema to your database. This creates the You should see output confirming that the schema was applied. If you get a connection error, double-check your
Usuario, Cancha, and Reserva tables along with all enums and constraints — no migration files required during development.DATABASE_URL in .env.local.Seed test data
Run the seed script to populate the database with three test user accounts and three sample courts across different sport types.The script outputs the created accounts on success:
Start the development server
Launch the Next.js development server:Open http://localhost:3000 in your browser. You should see the ReservaFácil landing page. Navigate to
/login (or click the login link) to sign in with one of the test accounts below.Test Accounts
The seed script creates one account for each role. Use these credentials to explore the platform:| Role | Password | Dashboard redirect | |
|---|---|---|---|
SUPERADMIN | superadmin@reservafacil.com | superadmin123 | /superadmin |
ADMIN | admin@reservafacil.com | admin123 | /admin |
USUARIO | usuario@reservafacil.com | usuario123 | /dashboard |
Role-Based Redirects After Login
After a successful login, the server reads therol field from the JWT payload and redirects each user to their dedicated area:
- USUARIO →
/dashboard— browse available courts, make and view personal reservations - ADMIN →
/admin— manage courts, confirm or cancel reservations across the platform - SUPERADMIN →
/superadmin— full system access including user management, role changes, and platform-wide reports
Attempting to access a dashboard you don’t have permission for (e.g. a
USUARIO navigating to /admin) will result in a redirect back to your own dashboard. Route protection is enforced in Next.js middleware using the token HTTP-only cookie.