first commit

This commit is contained in:
alexandrump
2026-02-09 01:02:53 +01:00
commit 82f3464565
90 changed files with 4788 additions and 0 deletions

46
docs/DEPLOYMENT.md Normal file
View File

@@ -0,0 +1,46 @@
# Despliegue en miniPCs
## Requisitos
- Docker + Docker Compose
- Postgres y Redis (opcional)
## Variables de entorno recomendadas
- `DATABASE_URL`
- `API_ADMIN_KEY`
- `JWT_SECRET`
- `INGEST_CRON`
- `ALERTS_CRON`
- `BACKUP_CRON`
- `BACKUP_DIR`
- `INGEST_ENABLED`
- `ALERTS_ENABLED`
- `BACKUP_ENABLED`
- `SMTP_HOST`, `SMTP_PORT`, `SMTP_USER`, `SMTP_PASS`, `SMTP_FROM`
- `TELEGRAM_BOT_TOKEN`, `TELEGRAM_DEFAULT_CHAT`
## Arranque rápido (todoenuno)
```bash
# Desde la raíz del repo
pnpm install
pnpm build
pnpm start
```
## Arranque con Docker Compose
```bash
docker compose build
docker compose up -d
```
## Estrategia recomendada (2 miniPCs)
1. **MiniPC 1**: ejecutar Postgres + Redis + jobs de ingesta.
2. **MiniPC 2**: ejecutar API + web + backups + alertas.
3. Definir `DATABASE_URL` apuntando al Postgres del MiniPC 1.
Sugerencia de flags:
- MiniPC 1: `INGEST_ENABLED=true`, `ALERTS_ENABLED=false`, `BACKUP_ENABLED=false`.
- MiniPC 2: `INGEST_ENABLED=false`, `ALERTS_ENABLED=true`, `BACKUP_ENABLED=true`.
## Backups
- Programados por `BACKUP_CRON`.
- Manual: `POST /admin/backup/run`.