refactor: isolate SSE setup

This commit is contained in:
josedario87
2025-06-09 15:16:02 -06:00
parent ed30369d3b
commit 031314d662
6 changed files with 110 additions and 5 deletions

View File

@@ -132,6 +132,20 @@ 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 y el servidor los
reenvía 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 `<style scoped>` section, ensuring the styles are encapsulated and don't affect other elements.