feat: initial implementation taller-wox.fitlabs.dev

Portal FastAPI + 5 endpoints REST para Bootcamp Agentic AI con
watsonx Orchestrate (FactorIT). Single container, Coolify-ready.

- Landing brandeado FIT con formulario de registro (honeypot anti-bot)
- Tokens itsdangerous para descargas (24h expiry)
- 5 endpoints API: historical/available procedures, member-insights,
  schedule, generate-report (Jinja2 + Plotly)
- SQLite con upsert-on-email para leads + log de descargas
- Admin endpoints (HTTP Basic): leads.json, leads.csv, stats
- 23 tests pytest pasando
- Dockerfile listo para Coolify con volúmenes persistentes
  (/app/leads.db, /app/app/data/reports_output, /app/material)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-13 03:01:44 +00:00
commit a062b45c51
57 changed files with 8035 additions and 0 deletions

72
README.md Normal file
View File

@@ -0,0 +1,72 @@
# taller-wox.fitlabs.dev
Portal + API para el **Bootcamp Agentic AI con watsonx Orchestrate** de FactorIT.
- **Landing público:** `/`
- **Registro + descargas:** `/register`, `/descargas?token=…`, `/download/{file}?token=…`
- **API del taller** (consumida por agentes de watsonx Orchestrate):
- `POST /api/historical-procedures`
- `POST /api/available-procedures`
- `GET /api/member-insights`
- `GET /api/schedule`
- `POST /api/reports/generate-report`
- **Admin** (HTTP Basic): `/admin/leads.json`, `/admin/leads.csv`, `/admin/stats`
## Local dev
```bash
python3.11 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
uvicorn app.main:app --reload --port 8000
```
Visitar `http://localhost:8000/`.
Tests:
```bash
pytest -v
```
## Deploy en Coolify
1. Crear nueva aplicación → tipo **Dockerfile** → source Gitea → repo `farentsen/taller-wox`.
2. FQDN: `taller-wox.fitlabs.dev`. HTTPS automático con Let's Encrypt.
3. **Volúmenes persistentes:**
- `/app/leads.db` (bind file)
- `/app/app/data/reports_output` (bind dir)
- `/app/material` (bind dir)
4. **Variables de entorno:**
- `SECRET_KEY` (string aleatorio largo)
- `ADMIN_USER=admin`
- `ADMIN_PASS=fit2026`
- `BASE_URL=https://taller-wox.fitlabs.dev`
- `TOKEN_EXPIRY_HOURS=24`
5. Subir los 2 ZIPs (`taller-wox-tecnico.zip`, `taller-wox-funcional.zip`) al volumen `/app/material/` vía SFTP o el file manager de Coolify (sin redeploy).
6. Deploy → Coolify buildea + arranca.
## Estructura
```
app/
main.py FastAPI bootstrap
config.py env vars
db.py SQLite
security.py tokens + basic auth
frontend.py / · /register · /descargas · /download
benefits_api.py endpoints 1-4
reports_api.py endpoint 5
admin.py /admin/*
data/ datasets de los endpoints
templates/ jinja2
static/ CSS, JS, imágenes
material/ ZIPs descargables (volumen persistente en prod)
tests/ pytest
Dockerfile
```
## Spec y diseño
- Spec: `SPEC_taller_wox_fitlabs.md`
- Diseño: `docs/superpowers/specs/2026-05-12-taller-wox-design.md`
- Plan: `docs/superpowers/plans/2026-05-12-taller-wox.md`