TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Pierrot-01/Hackathon_epis_2026/llms.txt
Use this file to discover all available pages before exploring further.
/api/stats endpoint aggregates student risk classifications into a compact summary used by the admin.html dashboard to populate the four top-level statistics cards: total students, high risk count, medium risk count, and low risk count. It is designed to be fast regardless of dataset size.
GET /api/stats
Returns global risk-level counts and percentages for all students in the dataset. No parameters are required.Caching Behavior
The endpoint checks whether the in-memory session cache (_resultados_cache) is populated:
- Cache available — reads
nivel_riesgodirectly from the cachedEstudianteResultadoobjects. This is essentially instantaneous. - Cache empty — loads the full dataset from
data/estudiantes.jsonand runsclasificar_estudiante()on each record synchronously, without calling the AI service. This makes the cold-start path significantly faster thanGET /api/estudiantes, at the cost of not populating the AI explanation cache.
Response Fields
Total number of student records in the dataset. Example:
20.Count of students classified as 🔴 high risk.
Count of students classified as 🟡 medium risk.
Count of students classified as 🟢 low risk.
Count of students classified as ⚪ insufficient data — too many variables were
null to produce a meaningful risk level.Percentage of students at 🔴 high risk, rounded to one decimal place. Calculated as
alto / total * 100. Returns 0 if total is 0.Percentage of students at 🟡 medium risk, rounded to one decimal place.
Percentage of students at 🟢 low risk, rounded to one decimal place.
Example
pct_alto + pct_medio + pct_bajo will not equal 100% when insuficiente > 0, because ⚪ students are counted in total but not included in any percentage field.Dashboard Integration
Theadmin.html frontend calls GET /api/stats on page load to populate the summary statistics cards at the top of the administration view. Because the stats endpoint uses the classifier-only fast path when the cache is cold, these cards load quickly even on a fresh server start — before the full AI-enriched student list has been fetched.
GET /api/health
The health endpoint provides a simple liveness check for the server. It is typically called on startup to confirm the API is running before the frontend attempts any data requests. No parameters are required.Response
Always
"ok" when the server is running and able to handle requests.Current API version string. Value:
"1.0.0".Example
- Startup probes: confirm the server is ready before loading the dashboard.
- Health monitoring: integrate with process managers (e.g., systemd, PM2) or uptime monitors to detect server crashes.
- Development: quickly verify the API is reachable after a code change or restart.