0f62a1324688d9f34196bc3ca01c10b995382ad4
The last row of the monthly variation table (oldest month of the rolling
window) always showed only the inflation value: the window started exactly
at that month, so there was no previous month to compare against, the
variation was null and the currency cells rendered '--' (hiding the prices
too).
- Backend: fetch 13 months (12 displayed + 1 base) so the oldest displayed
month gets its previous month; bump cache key to monthly-last-v3.
- Backend: fix external fallback filter comparing a full date against a
month key ('2026-10-14' > '2026-10' is always true), which silently
dropped the most recent month whenever it was missing from the DB.
Now filters by month key only.
- Backend: normalize subtractMonths to the 1st of the target month to avoid
month shifts; skip external quotes without a buy value.
- Frontend: compute variations over the 13 months and render the last 12;
show the current price when a variation is unavailable so no row is blank.
- Add regression tests for the window size and the external fallback.
Personal Admin 2026
Dashboard personal para seguimiento de cotizaciones (USD/BNA, USD/Blue, USDC/ARS-Belo) con actualizaciones en tiempo real.
Stack
| Capa | Tecnología |
|---|---|
| Runtime | Bun |
| Backend | Hono + TypeScript |
| Frontend | React 19 + Vite |
| Routing | TanStack Router (file-based) |
| Data Fetching | TanStack Query |
| Estilos | Tailwind CSS v4 + shadcn/ui |
| Base de datos | PostgreSQL + Prisma ORM |
| Tiempo real | Server-Sent Events (SSE) |
| Contenedor | Docker (multi-stage build) |
Estructura
├── apps/
│ ├── backend/ # API server (Hono) + cron jobs
│ │ └── src/modules/quotes/ # Módulo de cotizaciones
│ │ ├── bna.service.ts # USD oficial (dolarito.ar)
│ │ ├── blue.service.ts # USD blue (dolarito.ar)
│ │ └── belo.service.ts # USDC/ARS Belo (criptoya.com)
│ └── frontend/ # SPA React con TanStack Router
│ └── src/
│ ├── routes/ # Páginas (file-based routing)
│ ├── features/ # Componentes de cada feature
│ ├── components/ui/ # shadcn/ui components
│ └── lib/ # Hooks, API client, utils
├── packages/
│ └── common/ # Tipos y utilidades compartidas
└── Dockerfile # Multi-stage build
Requisitos
- Bun >= 1.x
- PostgreSQL (local o remota)
Setup local
# Instalar dependencias
bun install
# Configurar base de datos
cp apps/backend/.env apps/backend/.env.local
# Editar DATABASE_URL en .env.local
# Generar Prisma client
bun run --cwd apps/backend prisma:generate
# Correr migraciones
bun run --cwd apps/backend prisma:migrate
# Iniciar dev (backend + frontend simultáneamente)
bun run dev
El backend corre en http://localhost:3000 y el frontend en http://localhost:5173 (con proxy a /api → :3000).
Scripts
Root
| Comando | Descripción |
|---|---|
bun run dev |
Inicia backend y frontend en paralelo |
bun run build |
Build de frontend |
Backend (apps/backend)
| Comando | Descripción |
|---|---|
bun run dev |
Dev con watch |
bun run prisma:generate |
Generar Prisma client |
bun run prisma:migrate |
Migraciones de desarrollo |
bun run prisma:migrate:deploy |
Migraciones en producción |
bun run prisma:studio |
Prisma Studio (GUI DB) |
Frontend (apps/frontend)
| Comando | Descripción |
|---|---|
bun run dev |
Vite dev server con HMR |
bun run build |
Build a ../backend/web/ |
bun run typecheck |
TypeScript type check |
API
Todas las rutas bajo /api/quotes:
| Ruta | Descripción |
|---|---|
GET /api/quotes |
Cotizaciones actuales |
GET /api/quotes/events |
SSE — actualizaciones en vivo |
GET /api/quotes/fetch |
Forzar actualización manual |
GET /api/quotes/:type/history |
Historial paginado |
GET /api/quotes/:type/daily |
Agregados diarios |
GET /api/quotes/:type/min-max |
Mínimo y máximo diario |
Tipos: belo, blue, bna
Docker
docker build -t personal-admin-2026 .
docker run -p 3000:3000 \
-e DATABASE_URL=postgres://user:pass@host:5432/personal-admin-2026 \
personal-admin-2026
El entrypoint corre las migraciones automáticamente (con reintentos) antes de iniciar el server.
Tasks periódicas
Un cron job ejecuta cada 10 minutos la consulta de las 3 cotizaciones desde fuentes externas y las persiste en la DB. Las actualizaciones se notifican a los clientes conectados via SSE.
Description
Languages
TypeScript
98.5%
CSS
1%
Dockerfile
0.3%
HTML
0.1%
Shell
0.1%