Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions front/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
dist
.env
.env.local
*.tsbuildinfo

.vercel
1 change: 1 addition & 0 deletions front/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
legacy-peer-deps=true
48 changes: 48 additions & 0 deletions front/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Booking Platform, frontend

React 19 + Vite + TypeScript + Tailwind 4. Consume la API del backend sin modificarlo y sin ninguna key.

## Ejecutar

```bash
cd front
npm install
npm run dev # http://localhost:3000
```

El puerto 3000 es intencional: los enlaces de los correos de Supabase apuntan al Site URL (`localhost:3000`).

Por defecto el proxy de Vite envía `/api` al backend de Render. Para usar un backend local:

```bash
cp .env.example .env # y pon VITE_API_TARGET=http://localhost:8080
```

Render (plan gratis) duerme el servicio; la primera petición puede tardar ~2 minutos y la app lo avisa.

## Por qué hay un proxy

El backend no configura CORS (`SecurityConfig`), así que el navegador debe llamar a `/api` en su propio origen.
En desarrollo lo hace Vite (`vite.config.ts`); en Vercel lo hace `vercel.json` (rewrites hacia Render).

## Despliegue en Vercel

Importa la carpeta `front/` como proyecto (framework Vite). No requiere variables de entorno.

## Rutas

| Ruta | Quién | Pantalla |
|---|---|---|
| `/` | todos | Catálogo con filtros |
| `/ingresar`, `/registro`, `/registro-negocio`, `/recuperar` | anónimos | Acceso y registro |
| `/verificar-correo`, `/restablecer-clave` | todos | Destino de los enlaces de correo (`token_hash` o `token`) |
| `/bandeja` | autenticados | Correos de la plataforma |
| `/negocio`, `/negocio/:id/...` | PROVIDER, ADMIN | Resumen, tipos, recursos, servicios, agendas |
| `/admin/proveedores`, `/admin/clientes` | ADMIN | Listados, acciones con motivo, CSV |

## Límites conocidos del backend

- No hay endpoint de refresh: al vencer el token se pide iniciar sesión de nuevo.
- No hay módulo de reservas todavía, por eso no hay flujo de reserva.
- El rol dentro del negocio (OWNER/MANAGER/STAFF) no se expone; si falta permiso, el backend responde 403 y se muestra el motivo.
- Un usuario ADMIN se asigna a mano en Supabase (`app_metadata.role = "admin"`).
20 changes: 20 additions & 0 deletions front/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!doctype html>
<html lang="es">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="#f6f3ee" />
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600&family=Inter:wght@400;500;600&display=swap"
rel="stylesheet"
/>
<title>Reservas — encuentra y reserva servicios</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading