# mrchocman/matricore architecture

> Architecture diagram of the GitHub repository mrchocman/matricore, 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/mrchocman/matricore
- Repository: https://github.com/mrchocman/matricore

## Overview

MatriCore is a Tkinter desktop application for school enrollment management. Users choose an Apoderado or Secretaría login, then use a role-adapted dashboard to view enrollment records; they can submit enrollment requests or, as Secretaría, update or annul records and open institutional reports. The Python DAO connects directly to PostgreSQL, whose documented schema, RBAC procedures, triggers, and report functions implement persistence and business rules. SQL setup scripts are included as product data artifacts. Source excerpts do not show the SQL script contents, so SQL relationships rely on README documentation.

Main entry points: [`database.py`](https://github.com/mrchocman/matricore/blob/main/database.py) (Database manager), [`ui_login.py`](https://github.com/mrchocman/matricore/blob/main/ui_login.py) (Role login), [`sql/SCRIPTS SQL DE SEGURIDAD.sql`](https://github.com/mrchocman/matricore/blob/main/sql/SCRIPTS%20SQL%20DE%20SEGURIDAD.sql) (Roles and workflows), [`main.py`](https://github.com/mrchocman/matricore/blob/main/main.py) (App orchestrator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop application"]
  node_app["App orchestrator<br/>[main.py]"]
  node_login["Role login<br/>[ui_login.py]"]
  node_dashboard["Enrollment dashboard<br/>[ui_dashboard.py]"]
end

subgraph group_data["Data access"]
  node_config["Connection settings<br/>[config.py]"]
  node_dao["Database manager<br/>[database.py]"]
end

subgraph group_enrollment["Enrollment database"]
  node_schema["Relational schema"]
  node_seed["Initial records"]
  node_security["Roles and workflows"]
end

subgraph group_insights["Institutional reporting"]
  node_reports_ui["Reports viewer<br/>[ui_reportes.py]"]
  node_report_functions["Report functions"]
end

node_user(("School user"))
node_postgres[("PostgreSQL")]

node_user -.->|"provides credentials"| node_login
node_app -->|"shows login"| node_login
node_login -->|"reports success"| node_app
node_app -->|"shows dashboard"| node_dashboard
node_login -->|"authenticates with"| node_dao
node_dashboard -->|"loads and changes"| node_dao
node_dashboard -->|"opens reports"| node_reports_ui
node_reports_ui -->|"requests reports"| node_dao
node_dao -->|"reads settings"| node_config
node_dao -->|"queries and calls"| node_postgres
node_schema -->|"precedes loading"| node_seed
node_seed -->|"precedes setup"| node_security
node_dao -->|"calls stored procedures"| node_security
node_security -->|"defines report functions"| node_report_functions
node_dao -->|"queries report functions"| node_report_functions
node_schema -.->|"defines database tables"| node_postgres
node_seed -.->|"loads initial data"| node_postgres
node_security -.->|"configures roles and triggers"| node_postgres

click node_app "https://github.com/mrchocman/matricore/blob/main/main.py"
click node_login "https://github.com/mrchocman/matricore/blob/main/ui_login.py"
click node_dashboard "https://github.com/mrchocman/matricore/blob/main/ui_dashboard.py"
click node_reports_ui "https://github.com/mrchocman/matricore/blob/main/ui_reportes.py"
click node_config "https://github.com/mrchocman/matricore/blob/main/config.py"
click node_dao "https://github.com/mrchocman/matricore/blob/main/database.py"
click node_schema "https://github.com/mrchocman/matricore/blob/main/sql/CREACION%20DE%20BD%20Y%20TABLAS.sql"
click node_seed "https://github.com/mrchocman/matricore/blob/main/sql/INSERCION%20REGISTROS.sql"
click node_security "https://github.com/mrchocman/matricore/blob/main/sql/SCRIPTS%20SQL%20DE%20SEGURIDAD.sql"
click node_report_functions "https://github.com/mrchocman/matricore/blob/main/sql/SCRIPTS%20SQL%20DE%20SEGURIDAD.sql"

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_app,node_login,node_dashboard,node_user toneBlue
class node_config,node_dao,node_postgres toneAmber
class node_schema,node_seed,node_security toneMint
class node_reports_ui,node_report_functions toneRose
```

## Components

### Desktop application

- [App orchestrator](https://github.com/mrchocman/matricore/blob/main/main.py): `main.py`
- [Role login](https://github.com/mrchocman/matricore/blob/main/ui_login.py): `ui_login.py`
- [Enrollment dashboard](https://github.com/mrchocman/matricore/blob/main/ui_dashboard.py): `ui_dashboard.py`

### Data access

- [Connection settings](https://github.com/mrchocman/matricore/blob/main/config.py): `config.py`
- [Database manager](https://github.com/mrchocman/matricore/blob/main/database.py): `database.py`

### Enrollment database

- [Relational schema](https://github.com/mrchocman/matricore/blob/main/sql/CREACION%20DE%20BD%20Y%20TABLAS.sql): `sql/CREACION DE BD Y TABLAS.sql`
- [Initial records](https://github.com/mrchocman/matricore/blob/main/sql/INSERCION%20REGISTROS.sql): `sql/INSERCION REGISTROS.sql`
- [Roles and workflows](https://github.com/mrchocman/matricore/blob/main/sql/SCRIPTS%20SQL%20DE%20SEGURIDAD.sql): `sql/SCRIPTS SQL DE SEGURIDAD.sql`

### Institutional reporting

- [Reports viewer](https://github.com/mrchocman/matricore/blob/main/ui_reportes.py): `ui_reportes.py`
- [Report functions](https://github.com/mrchocman/matricore/blob/main/sql/SCRIPTS%20SQL%20DE%20SEGURIDAD.sql): `sql/SCRIPTS SQL DE SEGURIDAD.sql`

### Other components

- **School user**
- **PostgreSQL**

## Connections

- School user → Role login: provides credentials
- App orchestrator → Role login: shows login (evidence: `main.py`)
- Role login → App orchestrator: reports success (evidence: `ui_login.py`)
- App orchestrator → Enrollment dashboard: shows dashboard (evidence: `main.py`)
- Role login → Database manager: authenticates with (evidence: `ui_login.py`)
- Enrollment dashboard → Database manager: loads and changes (evidence: `ui_dashboard.py`)
- Enrollment dashboard → Reports viewer: opens reports (evidence: `ui_dashboard.py`)
- Reports viewer → Database manager: requests reports (evidence: `ui_reportes.py`)
- Database manager → Connection settings: reads settings (evidence: `database.py`)
- Database manager → PostgreSQL: queries and calls (evidence: `database.py`)
- Relational schema → Initial records: precedes loading (evidence: `README.md`)
- Initial records → Roles and workflows: precedes setup (evidence: `README.md`)
- Database manager → Roles and workflows: calls stored procedures (evidence: `database.py`)
- Roles and workflows → Report functions: defines report functions (evidence: `README.md`)
- Database manager → Report functions: queries report functions (evidence: `database.py`)
- Relational schema → PostgreSQL: defines database tables
- Initial records → PostgreSQL: loads initial data
- Roles and workflows → PostgreSQL: configures roles and triggers
