# idromerom714/tutor-icfes-ai architecture

> Architecture diagram of the GitHub repository idromerom714/tutor-icfes-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/idromerom714/tutor-icfes-ai
- Repository: https://github.com/idromerom714/tutor-icfes-ai

## Overview

Tutor-Icfes-AI es una aplicación educativa Streamlit para preparar a estudiantes colombianos para el Saber 11, con un tutor socrático y herramientas de seguimiento para padres. El flujo principal del estudiante combina diagnóstico adaptativo y planes de estudio con consultas de chat, búsqueda RAG opcional y exportación del historial a PDF. El panel familiar ofrece registro, gestión de estudiantes y seguimiento. Las conexiones entre módulos se basan en referencias del índice y del README; no se inspeccionó el código fuente completo.

Main entry points: [`pages/estudiante.py`](https://github.com/idromerom714/tutor-icfes-ai/blob/main/pages/estudiante.py) (Entorno de estudio), [`core/database.py`](https://github.com/idromerom714/tutor-icfes-ai/blob/main/core/database.py) (Datos de aprendizaje y cuentas), [`app.py`](https://github.com/idromerom714/tutor-icfes-ai/blob/main/app.py) (Panel familiar), [`core/rag_search.py`](https://github.com/idromerom714/tutor-icfes-ai/blob/main/core/rag_search.py) (Búsqueda de contexto)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Experiencia Streamlit"]
  node_student_ui["Entorno de estudio<br/>[estudiante.py]"]
  node_parent_ui["Panel familiar<br/>[app.py]"]
  node_signup["Registro y landing<br/>[presentacion.py]"]
  node_auth["Autenticación PIN<br/>[auth.py]"]
  node_ads["Anuncios AdSense<br/>[ads.py]"]
end

subgraph group_learning["Aprendizaje adaptativo"]
  node_diagnostic["Diagnóstico adaptativo<br/>[diagnostic.py]"]
  node_study_plan["Planes y recomendaciones<br/>[diagnostic.py]"]
  node_rag["Búsqueda de contexto<br/>[rag_search.py]"]
  node_tutor["Tutor socrático e imágenes<br/>[ai_engine.py]"]
  node_pdf["Exportación de chat PDF<br/>[pdf_generator.py]"]
end

subgraph group_services["Servicios IA externos"]
  node_openai["OpenAI embeddings"]
  node_pinecone[("Pinecone vectores")]
  node_openrouter["OpenRouter LLM"]
end

subgraph group_persistence["Persistencia y exportación"]
  node_database[("Datos de aprendizaje y cuentas<br/>[database.py]")]
  node_supabase[("Supabase")]
end

node_student(("Estudiante"))
node_parent(("Padre o tutor"))

node_student -->|"inicia estudio"| node_student_ui
node_parent -->|"gestiona familia"| node_parent_ui
node_parent -->|"registra cuenta"| node_signup
node_student_ui -->|"verifica PIN"| node_auth
node_parent_ui -->|"verifica PIN"| node_auth
node_parent_ui -->|"consulta cuentas y progreso"| node_database
node_signup -->|"crea cuenta"| node_database
node_student_ui -->|"ejecuta diagnóstico"| node_diagnostic
node_student_ui -->|"muestra planes"| node_study_plan
node_diagnostic -->|"persiste resultados"| node_database
node_student_ui -->|"guarda historial"| node_database
node_student_ui -->|"busca contexto"| node_rag
node_rag -->|"genera embeddings"| node_openai
node_rag -->|"consulta vectores"| node_pinecone
node_student_ui -->|"envía consulta e imagen"| node_tutor
node_rag -->|"aporta contexto"| node_tutor
node_tutor -->|"solicita respuesta"| node_openrouter
node_student_ui -->|"exporta conversación"| node_pdf
node_student_ui -->|"muestra anuncios"| node_ads
node_parent_ui -->|"muestra anuncios"| node_ads
node_signup -->|"muestra anuncios"| node_ads
node_database -->|"lee y escribe"| node_supabase

click node_student_ui "https://github.com/idromerom714/tutor-icfes-ai/blob/main/pages/estudiante.py"
click node_parent_ui "https://github.com/idromerom714/tutor-icfes-ai/blob/main/app.py"
click node_signup "https://github.com/idromerom714/tutor-icfes-ai/blob/main/pages/presentacion.py"
click node_auth "https://github.com/idromerom714/tutor-icfes-ai/blob/main/core/auth.py"
click node_diagnostic "https://github.com/idromerom714/tutor-icfes-ai/blob/main/core/diagnostic.py"
click node_study_plan "https://github.com/idromerom714/tutor-icfes-ai/blob/main/core/diagnostic.py"
click node_rag "https://github.com/idromerom714/tutor-icfes-ai/blob/main/core/rag_search.py"
click node_tutor "https://github.com/idromerom714/tutor-icfes-ai/blob/main/core/ai_engine.py"
click node_pdf "https://github.com/idromerom714/tutor-icfes-ai/blob/main/core/pdf_generator.py"
click node_database "https://github.com/idromerom714/tutor-icfes-ai/blob/main/core/database.py"
click node_ads "https://github.com/idromerom714/tutor-icfes-ai/blob/main/core/ads.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_student_ui,node_parent_ui,node_signup,node_auth,node_ads toneBlue
class node_diagnostic,node_study_plan,node_rag,node_tutor,node_pdf toneAmber
class node_openai,node_pinecone,node_openrouter toneMint
class node_database,node_supabase toneRose
class node_student,node_parent toneIndigo
```

## Components

### Experiencia Streamlit

- [Entorno de estudio](https://github.com/idromerom714/tutor-icfes-ai/blob/main/pages/estudiante.py): `pages/estudiante.py`
- [Panel familiar](https://github.com/idromerom714/tutor-icfes-ai/blob/main/app.py): `app.py`
- [Registro y landing](https://github.com/idromerom714/tutor-icfes-ai/blob/main/pages/presentacion.py): `pages/presentacion.py`
- [Autenticación PIN](https://github.com/idromerom714/tutor-icfes-ai/blob/main/core/auth.py): `core/auth.py`
- [Anuncios AdSense](https://github.com/idromerom714/tutor-icfes-ai/blob/main/core/ads.py): `core/ads.py`

### Aprendizaje adaptativo

- [Diagnóstico adaptativo](https://github.com/idromerom714/tutor-icfes-ai/blob/main/core/diagnostic.py): `core/diagnostic.py`
- [Planes y recomendaciones](https://github.com/idromerom714/tutor-icfes-ai/blob/main/core/diagnostic.py): `core/diagnostic.py`
- [Búsqueda de contexto](https://github.com/idromerom714/tutor-icfes-ai/blob/main/core/rag_search.py): `core/rag_search.py`
- [Tutor socrático e imágenes](https://github.com/idromerom714/tutor-icfes-ai/blob/main/core/ai_engine.py): `core/ai_engine.py`
- [Exportación de chat PDF](https://github.com/idromerom714/tutor-icfes-ai/blob/main/core/pdf_generator.py): `core/pdf_generator.py`

### Servicios IA externos

- **OpenAI embeddings**
- **Pinecone vectores**
- **OpenRouter LLM**

### Persistencia y exportación

- [Datos de aprendizaje y cuentas](https://github.com/idromerom714/tutor-icfes-ai/blob/main/core/database.py): `core/database.py`
- **Supabase**

### Other components

- **Estudiante**
- **Padre o tutor**

## Connections

- Estudiante → Entorno de estudio: inicia estudio (evidence: `README.md`)
- Padre o tutor → Panel familiar: gestiona familia (evidence: `README.md`)
- Padre o tutor → Registro y landing: registra cuenta (evidence: `README.md`)
- Entorno de estudio → Autenticación PIN: verifica PIN (evidence: `pages/estudiante.py`)
- Panel familiar → Autenticación PIN: verifica PIN (evidence: `app.py`)
- Panel familiar → Datos de aprendizaje y cuentas: consulta cuentas y progreso (evidence: `app.py`)
- Registro y landing → Datos de aprendizaje y cuentas: crea cuenta (evidence: `pages/presentacion.py`)
- Entorno de estudio → Diagnóstico adaptativo: ejecuta diagnóstico (evidence: `pages/estudiante.py`)
- Entorno de estudio → Planes y recomendaciones: muestra planes (evidence: `pages/estudiante.py`)
- Diagnóstico adaptativo → Datos de aprendizaje y cuentas: persiste resultados (evidence: `core/diagnostic.py`)
- Entorno de estudio → Datos de aprendizaje y cuentas: guarda historial (evidence: `pages/estudiante.py`)
- Entorno de estudio → Búsqueda de contexto: busca contexto (evidence: `pages/estudiante.py`)
- Búsqueda de contexto → OpenAI embeddings: genera embeddings (evidence: `core/rag_search.py`)
- Búsqueda de contexto → Pinecone vectores: consulta vectores (evidence: `core/rag_search.py`)
- Entorno de estudio → Tutor socrático e imágenes: envía consulta e imagen (evidence: `pages/estudiante.py`)
- Búsqueda de contexto → Tutor socrático e imágenes: aporta contexto (evidence: `README.md`)
- Tutor socrático e imágenes → OpenRouter LLM: solicita respuesta (evidence: `core/ai_engine.py`)
- Entorno de estudio → Exportación de chat PDF: exporta conversación (evidence: `pages/estudiante.py`)
- Entorno de estudio → Anuncios AdSense: muestra anuncios (evidence: `pages/estudiante.py`)
- Panel familiar → Anuncios AdSense: muestra anuncios (evidence: `app.py`)
- Registro y landing → Anuncios AdSense: muestra anuncios (evidence: `pages/presentacion.py`)
- Datos de aprendizaje y cuentas → Supabase: lee y escribe (evidence: `core/database.py`)
