Ivan a713369e03 fix: Settings courts list not loading and status display
- Handle Courts API returning array directly (not wrapped in data property)
- Map pricePerHour to hourlyRate for frontend compatibility
- Handle uppercase DB status values (AVAILABLE, MAINTENANCE, CLOSED)
- Send pricePerHour field when creating/updating courts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 03:52:08 +00:00

SmashPoint

Sistema integral de gestion para clubes de padel. Una solucion moderna y completa para administrar reservas, ventas, torneos, membresias y multiples sedes.

Next.js TypeScript PostgreSQL Prisma TailwindCSS


Caracteristicas Principales

Sistema de Reservas

  • Calendario visual con vista diaria/semanal
  • Gestion de disponibilidad por cancha
  • Precios dinamicos (horario regular vs premium)
  • Integracion automatica con membresias
  • Reservas recurrentes

Punto de Venta (POS)

  • Gestion de productos y categorias
  • Control de inventario con alertas de stock bajo
  • Multiples metodos de pago
  • Caja registradora con apertura/cierre
  • Historial de ventas detallado

Torneos

  • Formatos: Eliminacion simple/doble, Round Robin, Liga
  • Inscripciones online
  • Generacion automatica de brackets
  • Seguimiento de partidos y resultados

Membresias

  • Planes personalizables
  • Horas de cancha incluidas
  • Descuentos en reservas y tienda
  • Renovacion automatica opcional
  • Alertas de vencimiento

Multi-Sede

  • Gestion centralizada de multiples ubicaciones
  • Usuarios con acceso por sede
  • Reportes por sede o consolidados
  • Configuracion independiente por sede

Capturas de Pantalla

[Dashboard]     [Reservas]      [POS]
[Torneos]       [Membresias]    [Clientes]

Inicio Rapido

Requisitos Previos

  • Node.js 20.x o superior
  • PostgreSQL 16.x
  • pnpm 8.15.0 o superior

Instalacion

# Clonar el repositorio
git clone https://github.com/tu-organizacion/smashpoint.git
cd smashpoint

# Instalar dependencias
pnpm install

# Configurar variables de entorno
cp apps/web/.env.example apps/web/.env
# Editar .env con tus credenciales

# Generar cliente Prisma
pnpm db:generate

# Crear tablas en la base de datos
pnpm db:push

# Sembrar datos iniciales (opcional)
cd apps/web && pnpm db:seed && cd ../..

# Iniciar en modo desarrollo
pnpm dev

La aplicacion estara disponible en http://localhost:3000


Estructura del Proyecto

smashpoint/
├── apps/
│   └── web/                    # Aplicacion Next.js principal
│       ├── app/
│       │   ├── api/            # API Routes
│       │   │   ├── auth/       # Autenticacion (NextAuth)
│       │   │   ├── bookings/   # Reservas
│       │   │   ├── cash-register/ # Caja registradora
│       │   │   ├── clients/    # Clientes
│       │   │   ├── courts/     # Canchas
│       │   │   ├── dashboard/  # Estadisticas
│       │   │   ├── membership-plans/ # Planes de membresia
│       │   │   ├── memberships/# Membresias
│       │   │   ├── products/   # Productos
│       │   │   ├── sales/      # Ventas
│       │   │   ├── sites/      # Sedes
│       │   │   └── tournaments/# Torneos
│       │   └── (admin)/        # Paginas del panel de administracion
│       ├── components/         # Componentes React reutilizables
│       ├── lib/               # Utilidades y configuraciones
│       ├── prisma/            # Schema y migraciones
│       └── types/             # Definiciones de tipos TypeScript
├── packages/
│   └── shared/                # Codigo compartido (tipos, validaciones)
├── docs/                      # Documentacion
├── package.json
├── pnpm-workspace.yaml
└── turbo.json

Variables de Entorno

Crear un archivo .env en apps/web/ con las siguientes variables:

# Base de datos
DATABASE_URL="postgresql://usuario:password@localhost:5432/smashpoint_db?schema=public"

# NextAuth
NEXTAUTH_SECRET="tu-clave-secreta-aqui"
NEXTAUTH_URL="http://localhost:3000"

# Aplicacion
NEXT_PUBLIC_APP_URL="http://localhost:3000"

Variables Requeridas

Variable Descripcion Ejemplo
DATABASE_URL URL de conexion a PostgreSQL postgresql://user:pass@localhost:5432/db
NEXTAUTH_SECRET Clave secreta para JWT (min 32 caracteres) Generar con openssl rand -base64 32
NEXTAUTH_URL URL base de la aplicacion http://localhost:3000
NEXT_PUBLIC_APP_URL URL publica de la aplicacion http://localhost:3000

Scripts Disponibles

Desarrollo

pnpm dev           # Iniciar servidor de desarrollo
pnpm build         # Construir para produccion
pnpm lint          # Ejecutar ESLint
pnpm type-check    # Verificar tipos TypeScript

Base de Datos

pnpm db:generate   # Generar cliente Prisma
pnpm db:push       # Sincronizar schema con DB
pnpm db:studio     # Abrir Prisma Studio (UI para DB)
pnpm db:seed       # Sembrar datos iniciales

Resumen de API

La API REST sigue convenciones estandar. Todas las rutas requieren autenticacion excepto las indicadas.

Endpoints Principales

Recurso Ruta Base Descripcion
Auth /api/auth/* Autenticacion NextAuth
Courts /api/courts Gestion de canchas
Bookings /api/bookings Reservas
Clients /api/clients Clientes
Products /api/products Productos del POS
Sales /api/sales Ventas
Cash Register /api/cash-register Caja registradora
Tournaments /api/tournaments Torneos
Memberships /api/memberships Membresias
Membership Plans /api/membership-plans Planes de membresia
Sites /api/sites Sedes
Dashboard /api/dashboard/stats Estadisticas

Ver documentacion completa en docs/API.md


Credenciales por Defecto

Despues de ejecutar el seed, puedes acceder con:

Usuario Password Rol
admin@smashpoint.com admin123 Super Admin
recepcion@smashpoint.com recepcion123 Recepcionista

IMPORTANTE: Cambiar estas credenciales inmediatamente en entornos de produccion.


Contribuir

  1. Fork el repositorio
  2. Crear una rama para tu feature (git checkout -b feature/nueva-funcionalidad)
  3. Commit tus cambios (git commit -m 'feat: agregar nueva funcionalidad')
  4. Push a la rama (git push origin feature/nueva-funcionalidad)
  5. Abrir un Pull Request

Convenciones de Commits

Usamos Conventional Commits:

  • feat: Nueva funcionalidad
  • fix: Correccion de bug
  • docs: Cambios en documentacion
  • style: Cambios de formato (no afectan codigo)
  • refactor: Refactorizacion de codigo
  • test: Agregar o modificar tests
  • chore: Tareas de mantenimiento

Documentacion Adicional


Licencia

Este proyecto esta bajo la Licencia MIT. Ver el archivo LICENSE para mas detalles.

MIT License

Copyright (c) 2024 SmashPoint

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Description
Aplicación de gestión para canchas de pádel - Reservas, torneos, pagos, analytics y más
Readme 2.7 MiB
Languages
TypeScript 99.4%
Dockerfile 0.3%
CSS 0.2%