diff --git a/Makefile b/Makefile index f747f2c..efaa16f 100644 --- a/Makefile +++ b/Makefile @@ -49,4 +49,11 @@ mcp: cd mcp && npm install && npm run dev api: - cd api && npm install && npm run dev \ No newline at end of file + cd api && npm install && npm run dev + +# Creates a new Prisma migration in development mode. +# Pass the migration name as an argument, e.g.: +# make prisma-migrate-dev name=my-migration-name +# If no name is provided, it defaults to "new_migration". +prisma-migrate-dev: + cd api && npx prisma migrate deploy diff --git a/README.md b/README.md index 33338dc..9ed4356 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,21 @@ docker compose down --remove-orphans * Arranca en puerto **80** internamente. * Código fuente en `ui/src/`, configuración en `vite.config.js`. +### Notificaciones en tiempo real (SSE) + +El backend expone un endpoint `/events` que utiliza **Server-Sent Events**. La +base de datos PostgreSQL emite mensajes mediante triggers en las tablas +`Planilla`, `Cliente`, `TareaRealizada` y `Asistencia`. Cada cambio se +reenvía automáticamente a los navegadores conectados. + +```javascript +const source = new EventSource('http://localhost:4000/events'); +source.onmessage = (e) => { + const data = JSON.parse(e.data); + console.log('Evento recibido', data); +}; +``` + #### Card Animation The data cards implemented in `ui/src/components/ui/NucleoDataCard.vue` now feature a subtle growing animation when hovered over. This animation is implemented purely with CSS using keyframes and transitions defined within the component's `