# braianmartinezzz/tfi_sgc-unlpam architecture

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

- Interactive diagram: https://gitdiagram.com/braianmartinezzz/tfi_sgc-unlpam
- Repository: https://github.com/braianmartinezzz/tfi_sgc-unlpam

## Overview

This repository appears to provide a web-based system for managing institutional agreements (convenios), with a Laravel API and a Next.js web client; the mobile tree looks like a separate starter app. The main domain workflow covers agreement creation and document handling, review and observations, signatures and status changes, followed by audit and reporting. The sampled source confirms several API-to-service and service-to-model relationships. README content is absent, and many routes and frontend integrations were not sampled, so those connections are left unverified.

Main entry points: [`api/app/Services/DocumentoService.php`](https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Services/DocumentoService.php) (Document handling), [`api/app/Services/ConvenioService.php`](https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Services/ConvenioService.php) (Agreement workflows), [`api/app/Http/Controllers/Api/ConvenioController.php`](https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Http/Controllers/Api/ConvenioController.php) (Agreement API), [`api/app/Models/Convenio.php`](https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Models/Convenio.php) (Agreement records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User interfaces"]
  node_webapp["Web application"]
  node_webservices["Web API services"]
  node_mobile["Mobile starter"]
end

subgraph group_api["API and workflows"]
  node_agreement_api["Agreement API"]
  node_document_api["Document API"]
  node_representative_api["Representative API"]
  node_identity["Authentication<br/>[AuthService.php]"]
end

subgraph group_domain["Agreement domain"]
  node_representative_service["Representative service"]
  node_agreement_service["Agreement workflows"]
  node_document_service["Document handling"]
  node_agreement_model["Agreement records<br/>[Convenio.php]"]
  node_document_model["Document records<br/>[Documento.php]"]
  node_observation_model["Review observations<br/>[Observacion.php]"]
end

subgraph group_operations["Administration and reporting"]
  node_audit_api["Audit service"]
  node_audit_records["Audit records"]
  node_reporting["Statistics and exports"]
  node_catalogs["Institutional catalogs"]
  node_users["Users and roles<br/>[Usuario.php]"]
end

node_staff(("Staff user"))
node_database[("Application database")]
node_private_files[("Private document storage")]

node_staff -.->|"uses"| node_webapp
node_webapp -.->|"requests data"| node_webservices
node_webservices -.->|"calls API"| node_agreement_api
node_agreement_api -->|"delegates to"| node_agreement_service
node_agreement_api -->|"registers signatures"| node_document_service
node_document_api -->|"delegates to"| node_document_service
node_representative_api -->|"uses service"| node_representative_service
node_agreement_service -->|"reads and updates"| node_agreement_model
node_agreement_service -->|"registers signed files"| node_document_service
node_agreement_service -->|"records actions"| node_audit_api
node_document_service -->|"manages versions"| node_document_model
node_agreement_model -->|"relates observations"| node_observation_model
node_document_service -.->|"stores files"| node_private_files
node_audit_api -->|"writes audit entries"| node_audit_records
node_identity -->|"checks credentials"| node_users
node_agreement_model -.->|"maps records"| node_database
node_document_model -.->|"maps records"| node_database
node_audit_records -.->|"stores entries"| node_database

click node_webapp "https://github.com/braianmartinezzz/tfi_sgc-unlpam/tree/main/web/app"
click node_webservices "https://github.com/braianmartinezzz/tfi_sgc-unlpam/tree/main/web/services"
click node_mobile "https://github.com/braianmartinezzz/tfi_sgc-unlpam/tree/main/app/src/app"
click node_agreement_api "https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Http/Controllers/Api/ConvenioController.php"
click node_document_api "https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Http/Controllers/Api/DocumentoController.php"
click node_representative_api "https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Http/Controllers/Api/RepresentanteController.php"
click node_representative_service "https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Services/RepresentanteService.php"
click node_agreement_service "https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Services/ConvenioService.php"
click node_document_service "https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Services/DocumentoService.php"
click node_agreement_model "https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Models/Convenio.php"
click node_document_model "https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Models/Documento.php"
click node_observation_model "https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Models/Observacion.php"
click node_identity "https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Services/AuthService.php"
click node_audit_api "https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Services/AuditoriaService.php"
click node_audit_records "https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Models/RegistroAuditoria.php"
click node_reporting "https://github.com/braianmartinezzz/tfi_sgc-unlpam/tree/main/api/app/Services"
click node_catalogs "https://github.com/braianmartinezzz/tfi_sgc-unlpam/tree/main/api/app/Services"
click node_users "https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Models/Usuario.php"

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_webapp,node_webservices,node_mobile,node_staff toneBlue
class node_agreement_api,node_document_api,node_representative_api,node_identity,node_database,node_private_files toneAmber
class node_representative_service,node_agreement_service,node_document_service,node_agreement_model,node_document_model,node_observation_model toneMint
class node_audit_api,node_audit_records,node_reporting,node_catalogs,node_users toneRose
```

## Components

### User interfaces

- [Web application](https://github.com/braianmartinezzz/tfi_sgc-unlpam/tree/main/web/app): `web/app`
- [Web API services](https://github.com/braianmartinezzz/tfi_sgc-unlpam/tree/main/web/services): `web/services`
- [Mobile starter](https://github.com/braianmartinezzz/tfi_sgc-unlpam/tree/main/app/src/app): `app/src/app`

### API and workflows

- [Agreement API](https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Http/Controllers/Api/ConvenioController.php): `api/app/Http/Controllers/Api/ConvenioController.php`
- [Document API](https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Http/Controllers/Api/DocumentoController.php): `api/app/Http/Controllers/Api/DocumentoController.php`
- [Representative API](https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Http/Controllers/Api/RepresentanteController.php): `api/app/Http/Controllers/Api/RepresentanteController.php`
- [Authentication](https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Services/AuthService.php): `api/app/Services/AuthService.php`

### Agreement domain

- [Representative service](https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Services/RepresentanteService.php): `api/app/Services/RepresentanteService.php`
- [Agreement workflows](https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Services/ConvenioService.php): `api/app/Services/ConvenioService.php`
- [Document handling](https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Services/DocumentoService.php): `api/app/Services/DocumentoService.php`
- [Agreement records](https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Models/Convenio.php): `api/app/Models/Convenio.php`
- [Document records](https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Models/Documento.php): `api/app/Models/Documento.php`
- [Review observations](https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Models/Observacion.php): `api/app/Models/Observacion.php`

### Administration and reporting

- [Audit service](https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Services/AuditoriaService.php): `api/app/Services/AuditoriaService.php`
- [Audit records](https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Models/RegistroAuditoria.php): `api/app/Models/RegistroAuditoria.php`
- [Statistics and exports](https://github.com/braianmartinezzz/tfi_sgc-unlpam/tree/main/api/app/Services): `api/app/Services`
- [Institutional catalogs](https://github.com/braianmartinezzz/tfi_sgc-unlpam/tree/main/api/app/Services): `api/app/Services`
- [Users and roles](https://github.com/braianmartinezzz/tfi_sgc-unlpam/blob/main/api/app/Models/Usuario.php): `api/app/Models/Usuario.php`

### Other components

- **Staff user**
- **Application database**
- **Private document storage**

## Connections

- Staff user → Web application: uses
- Web application → Web API services: requests data
- Web API services → Agreement API: calls API
- Agreement API → Agreement workflows: delegates to (evidence: `api/app/Http/Controllers/Api/ConvenioController.php`)
- Agreement API → Document handling: registers signatures (evidence: `api/app/Http/Controllers/Api/ConvenioController.php`)
- Document API → Document handling: delegates to (evidence: `api/app/Http/Controllers/Api/DocumentoController.php`)
- Representative API → Representative service: uses service (evidence: `api/app/Http/Controllers/Api/RepresentanteController.php`)
- Agreement workflows → Agreement records: reads and updates (evidence: `api/app/Services/ConvenioService.php`)
- Agreement workflows → Document handling: registers signed files (evidence: `api/app/Services/ConvenioService.php`)
- Agreement workflows → Audit service: records actions (evidence: `api/app/Services/ConvenioService.php`)
- Document handling → Document records: manages versions (evidence: `api/app/Services/DocumentoService.php`)
- Agreement records → Review observations: relates observations (evidence: `api/app/Models/Convenio.php`)
- Document handling → Private document storage: stores files
- Audit service → Audit records: writes audit entries (evidence: `api/app/Services/AuditoriaService.php`)
- Authentication → Users and roles: checks credentials (evidence: `api/app/Services/AuthService.php`)
- Agreement records → Application database: maps records
- Document records → Application database: maps records
- Audit records → Application database: stores entries
