# geken02/sgpi-fondos-vie-reparaciones architecture

> Architecture diagram of the GitHub repository geken02/sgpi-fondos-vie-reparaciones, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/geken02/sgpi-fondos-vie-reparaciones
- Repository: https://github.com/geken02/sgpi-fondos-vie-reparaciones

## Overview

SGPI is a web system for managing TEC VIE-funded research proposals, from researcher submission through technical review, school approval, VIE validation, and final CIE resolution. Users work through role-specific React screens; the FastAPI backend exposes domain APIs backed by SQLAlchemy models. The README documents the six main modules and the institutional workflow; sampled source confirms API router registration, proposal persistence, and selected service/model relationships. Most domain routers and services were not sampled, so their internal calls are not asserted.

Main entry points: [`05_Codigo_Fuente/backend/src/main.py`](https://github.com/geken02/sgpi-fondos-vie-reparaciones/blob/main/05_Codigo_Fuente/backend/src/main.py) (FastAPI routers), [`05_Codigo_Fuente/backend/src/services/investigador/propuesta_service.py`](https://github.com/geken02/sgpi-fondos-vie-reparaciones/blob/main/05_Codigo_Fuente/backend/src/services/investigador/propuesta_service.py) (Proposal formulation), [`05_Codigo_Fuente/frontend/src/App.jsx`](https://github.com/geken02/sgpi-fondos-vie-reparaciones/blob/main/05_Codigo_Fuente/frontend/src/App.jsx) (Role-based screens), [`05_Codigo_Fuente/frontend/src/services/api.js`](https://github.com/geken02/sgpi-fondos-vie-reparaciones/blob/main/05_Codigo_Fuente/frontend/src/services/api.js) (HTTP client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User interface"]
  node_frontend["Role-based screens<br/>[App.jsx]"]
  node_frontend_api["HTTP client<br/>[api.js]"]
end

subgraph group_api["API and identity"]
  node_api_entry["FastAPI routers<br/>[main.py]"]
  node_auth["Authentication<br/>[auth_service.py]"]
end

subgraph group_workflow["Proposal workflow"]
  node_proposal_api["Proposal endpoints<br/>[propuestas.py]"]
  node_proposal_service["Proposal formulation"]
  node_vinculacion["Vinculación review"]
  node_technical["Technical evaluation"]
  node_school["School approval"]
  node_vie["VIE validation"]
  node_cie["CIE resolution"]
  node_direction["Research direction"]
end

subgraph group_operations["Operations and records"]
  node_proposal_data[("Proposal records")]
  node_admin["System administration"]
  node_history["Historical reports<br/>[reporte_service.py]"]
  node_database[("Database session<br/>[database.py]")]
  node_files["Document storage<br/>[s3_client.py]"]
end

node_researcher(("Researcher"))

node_researcher -->|"submits proposal"| node_frontend
node_frontend -.->|"uses HTTP client"| node_frontend_api
node_frontend_api -.->|"calls API"| node_api_entry
node_api_entry -->|"registers router"| node_proposal_api
node_api_entry -.->|"serves identity"| node_auth
node_proposal_api -.->|"handles formulation"| node_proposal_service
node_proposal_service -->|"reads and writes"| node_proposal_data
node_proposal_data -->|"maps through Base"| node_database
node_proposal_service -.->|"advances to review"| node_vinculacion
node_vinculacion -->|"advances to committee"| node_technical
node_technical -.->|"advances to approval"| node_school
node_school -.->|"advances to validation"| node_vie
node_vie -.->|"routes for resolution"| node_cie
node_cie -.->|"coordinates final stage"| node_direction
node_api_entry -->|"registers admin routes"| node_admin
node_api_entry -.->|"registers report routes"| node_history
node_proposal_service -.->|"stores documents"| node_files

click node_frontend "https://github.com/geken02/sgpi-fondos-vie-reparaciones/blob/main/05_Codigo_Fuente/frontend/src/App.jsx"
click node_frontend_api "https://github.com/geken02/sgpi-fondos-vie-reparaciones/blob/main/05_Codigo_Fuente/frontend/src/services/api.js"
click node_api_entry "https://github.com/geken02/sgpi-fondos-vie-reparaciones/blob/main/05_Codigo_Fuente/backend/src/main.py"
click node_auth "https://github.com/geken02/sgpi-fondos-vie-reparaciones/blob/main/05_Codigo_Fuente/backend/src/services/auth_service.py"
click node_proposal_api "https://github.com/geken02/sgpi-fondos-vie-reparaciones/blob/main/05_Codigo_Fuente/backend/src/api/routers/investigador/propuestas.py"
click node_proposal_service "https://github.com/geken02/sgpi-fondos-vie-reparaciones/blob/main/05_Codigo_Fuente/backend/src/services/investigador/propuesta_service.py"
click node_proposal_data "https://github.com/geken02/sgpi-fondos-vie-reparaciones/tree/main/05_Codigo_Fuente/backend/src/models"
click node_vinculacion "https://github.com/geken02/sgpi-fondos-vie-reparaciones/blob/main/05_Codigo_Fuente/backend/src/services/vinculacion/vinculacion_service.py"
click node_technical "https://github.com/geken02/sgpi-fondos-vie-reparaciones/tree/main/05_Codigo_Fuente/backend/src/services/comite_tecnico"
click node_school "https://github.com/geken02/sgpi-fondos-vie-reparaciones/tree/main/05_Codigo_Fuente/backend/src/services/consejo_escuela"
click node_vie "https://github.com/geken02/sgpi-fondos-vie-reparaciones/tree/main/05_Codigo_Fuente/backend/src/services/vie"
click node_cie "https://github.com/geken02/sgpi-fondos-vie-reparaciones/blob/main/05_Codigo_Fuente/backend/src/services/vie/miembro_cie_service.py"
click node_direction "https://github.com/geken02/sgpi-fondos-vie-reparaciones/blob/main/05_Codigo_Fuente/backend/src/services/direccion_investigacion_service.py"
click node_admin "https://github.com/geken02/sgpi-fondos-vie-reparaciones/tree/main/05_Codigo_Fuente/backend/src/services/admin"
click node_history "https://github.com/geken02/sgpi-fondos-vie-reparaciones/blob/main/05_Codigo_Fuente/backend/src/services/consulta_historica/reporte_service.py"
click node_database "https://github.com/geken02/sgpi-fondos-vie-reparaciones/blob/main/05_Codigo_Fuente/backend/src/database.py"
click node_files "https://github.com/geken02/sgpi-fondos-vie-reparaciones/blob/main/05_Codigo_Fuente/backend/src/utils/s3_client.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_frontend,node_frontend_api toneBlue
class node_api_entry,node_auth toneAmber
class node_proposal_api,node_proposal_service,node_vinculacion,node_technical,node_school,node_vie,node_cie,node_direction toneMint
class node_proposal_data,node_admin,node_history,node_database,node_files toneRose
class node_researcher toneIndigo
```

## Components

### User interface

- [Role-based screens](https://github.com/geken02/sgpi-fondos-vie-reparaciones/blob/main/05_Codigo_Fuente/frontend/src/App.jsx): `05_Codigo_Fuente/frontend/src/App.jsx`
- [HTTP client](https://github.com/geken02/sgpi-fondos-vie-reparaciones/blob/main/05_Codigo_Fuente/frontend/src/services/api.js): `05_Codigo_Fuente/frontend/src/services/api.js`

### API and identity

- [FastAPI routers](https://github.com/geken02/sgpi-fondos-vie-reparaciones/blob/main/05_Codigo_Fuente/backend/src/main.py): `05_Codigo_Fuente/backend/src/main.py`
- [Authentication](https://github.com/geken02/sgpi-fondos-vie-reparaciones/blob/main/05_Codigo_Fuente/backend/src/services/auth_service.py): `05_Codigo_Fuente/backend/src/services/auth_service.py`

### Proposal workflow

- [Proposal endpoints](https://github.com/geken02/sgpi-fondos-vie-reparaciones/blob/main/05_Codigo_Fuente/backend/src/api/routers/investigador/propuestas.py): `05_Codigo_Fuente/backend/src/api/routers/investigador/propuestas.py`
- [Proposal formulation](https://github.com/geken02/sgpi-fondos-vie-reparaciones/blob/main/05_Codigo_Fuente/backend/src/services/investigador/propuesta_service.py): `05_Codigo_Fuente/backend/src/services/investigador/propuesta_service.py`
- [Vinculación review](https://github.com/geken02/sgpi-fondos-vie-reparaciones/blob/main/05_Codigo_Fuente/backend/src/services/vinculacion/vinculacion_service.py): `05_Codigo_Fuente/backend/src/services/vinculacion/vinculacion_service.py`
- [Technical evaluation](https://github.com/geken02/sgpi-fondos-vie-reparaciones/tree/main/05_Codigo_Fuente/backend/src/services/comite_tecnico): `05_Codigo_Fuente/backend/src/services/comite_tecnico`
- [School approval](https://github.com/geken02/sgpi-fondos-vie-reparaciones/tree/main/05_Codigo_Fuente/backend/src/services/consejo_escuela): `05_Codigo_Fuente/backend/src/services/consejo_escuela`
- [VIE validation](https://github.com/geken02/sgpi-fondos-vie-reparaciones/tree/main/05_Codigo_Fuente/backend/src/services/vie): `05_Codigo_Fuente/backend/src/services/vie`
- [CIE resolution](https://github.com/geken02/sgpi-fondos-vie-reparaciones/blob/main/05_Codigo_Fuente/backend/src/services/vie/miembro_cie_service.py): `05_Codigo_Fuente/backend/src/services/vie/miembro_cie_service.py`
- [Research direction](https://github.com/geken02/sgpi-fondos-vie-reparaciones/blob/main/05_Codigo_Fuente/backend/src/services/direccion_investigacion_service.py): `05_Codigo_Fuente/backend/src/services/direccion_investigacion_service.py`

### Operations and records

- [Proposal records](https://github.com/geken02/sgpi-fondos-vie-reparaciones/tree/main/05_Codigo_Fuente/backend/src/models): `05_Codigo_Fuente/backend/src/models`
- [System administration](https://github.com/geken02/sgpi-fondos-vie-reparaciones/tree/main/05_Codigo_Fuente/backend/src/services/admin): `05_Codigo_Fuente/backend/src/services/admin`
- [Historical reports](https://github.com/geken02/sgpi-fondos-vie-reparaciones/blob/main/05_Codigo_Fuente/backend/src/services/consulta_historica/reporte_service.py): `05_Codigo_Fuente/backend/src/services/consulta_historica/reporte_service.py`
- [Database session](https://github.com/geken02/sgpi-fondos-vie-reparaciones/blob/main/05_Codigo_Fuente/backend/src/database.py): `05_Codigo_Fuente/backend/src/database.py`
- [Document storage](https://github.com/geken02/sgpi-fondos-vie-reparaciones/blob/main/05_Codigo_Fuente/backend/src/utils/s3_client.py): `05_Codigo_Fuente/backend/src/utils/s3_client.py`

### Other components

- **Researcher**

## Connections

- Researcher → Role-based screens: submits proposal
- Role-based screens → HTTP client: uses HTTP client
- HTTP client → FastAPI routers: calls API
- FastAPI routers → Proposal endpoints: registers router (evidence: `05_Codigo_Fuente/backend/src/main.py`)
- FastAPI routers → Authentication: serves identity
- Proposal endpoints → Proposal formulation: handles formulation
- Proposal formulation → Proposal records: reads and writes (evidence: `05_Codigo_Fuente/backend/src/services/investigador/propuesta_service.py`)
- Proposal records → Database session: maps through Base (evidence: `05_Codigo_Fuente/backend/src/models/propuestas.py`)
- Proposal formulation → Vinculación review: advances to review
- Vinculación review → Technical evaluation: advances to committee (evidence: `05_Codigo_Fuente/backend/src/services/vinculacion/vinculacion_service.py`)
- Technical evaluation → School approval: advances to approval
- School approval → VIE validation: advances to validation
- VIE validation → CIE resolution: routes for resolution
- CIE resolution → Research direction: coordinates final stage
- FastAPI routers → System administration: registers admin routes (evidence: `05_Codigo_Fuente/backend/src/main.py`)
- FastAPI routers → Historical reports: registers report routes
- Proposal formulation → Document storage: stores documents
