The web interface is a set of static HTML files served directly by FastAPI atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/gcapella0/agente-inteligente-expedientes/llms.txt
Use this file to discover all available pages before exploring further.
/ui. There is no build step — files are mounted via FastAPI’s StaticFiles and delivered as-is to the browser. All interactivity is powered by Alpine.js 3.x and styled with Tailwind CSS loaded from CDN, so no local Node toolchain is required.
Access the UI at: http://localhost:8000/ui
All pages require JWT authentication (token stored in localStorage under the key token) except login.html. Unauthenticated requests are redirected to the login page by the shared app.js helper via requireAuth().
Interface pages
login.html
JWT login form that posts credentials to
POST /auth/login. Stores the returned access_token in localStorage and redirects to the dashboard on success. Includes client-side field validation and a password-visibility toggle.index.html
Dashboard — 4 KPI cards (total documents, average completeness, eligible docentes, completion rate), an agent cards grid with individual Solo / En cadena run buttons and a stop button for running agents, and a mini SSE log stream showing the last 10 log entries in real time.
expedientes.html
Dossier list — full-text search by name, cédula, or department; status and completeness range filters; cursor-based pagination; and inline Ver / Editar / Eliminar actions per row.
expediente.html
Dossier detail — personal data header, 4 KPI cards (completeness %, document count out of 10, overall validation state, last update), document table with an OCR viewer modal (two tabs: document preview and raw JSON OCR), a validation-state picker, and an embedded AI chat panel.
config.html
Configuration — two-tab layout: Agentes (timeout and retry sliders for Watcher, OCR, Classifier, and Storage agents) and LLM (provider selection between OpenRouter and Ollama, model dropdown, Ollama host input, test-connection button, and save).
logs.html
Real-time logs — SSE stream with per-agent and per-level filters (DEBUG / INFO / WARNING / ERROR), pause/resume toggle, clear button, and a ↓ Descargar audit.jsonl button that downloads the full audit log from
GET /logs/descargar. Displays up to 500 lines.admin.html
User management (admin-only) — lists all registered users with email, role, and creation date; inline role dropdown (viewer / docente / admin) that saves immediately; delete with confirmation dialog; and a Crear Nuevo tab with email, password, and role fields.
Authentication flow
All pages (exceptlogin.html) call requireAuth() on init, which reads localStorage.token and redirects to /ui/login.html if absent.
- User submits email and password →
POST /auth/loginwithContent-Type: application/json. - On success the response includes
access_token(a JWT). This value is stored inlocalStorageastoken. - All subsequent API calls made by
fetchApi()include the headerAuthorization: Bearer <token>. - The token expires after 8 hours (480 minutes). After expiry the next API call returns
401andrequireAuth()redirects to login.
File viewer token passing
The document viewer inexpediente.html renders images with <img src> and opens PDFs via a link to the /archivo endpoint. Because browsers load these resources natively — outside of the fetch lifecycle — they cannot attach an Authorization header. Instead, the token is appended as a query parameter:
urlArchivo() in the Alpine component and is compatible with browser-native image and PDF rendering without CORS issues.
The static files live in
src/api/static/. They are mounted at /ui via FastAPI’s StaticFiles in the application startup. No separate web server or reverse proxy is needed for development; in production you may place Nginx in front, but the UI will work without it.