# ivansosabz/legajos-de-funcionarios architecture

> Architecture diagram of the GitHub repository ivansosabz/legajos-de-funcionarios, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ivansosabz/legajos-de-funcionarios
- Repository: https://github.com/ivansosabz/legajos-de-funcionarios

## Overview

#### 1. Purpose and Runtime
This is a server-rendered Django system for managing public-employee personnel files (“legajos”): employee records, associated documents, evaluations, and labor events. It runs on Python/Django through the development entry point `manage.py`; deployment adapters are `legajosdefuncionarios/wsgi.py` and `legajosdefuncionarios/asgi.py`.

#### 2. Project Composition and Routing
The Django project package centralizes settings and top-level URL composition:
- `legajosdefuncionarios/settings.py`
- `legajosdefuncionarios/urls.py`
- `legajosdefuncionarios/views.py`

Feature apps expose their own URL/view boundaries, then render HTML templates rather than providing a separate API. Request flow is: browser → project/app URL routing → view → form/model persistence → template response.

#### 3. Employee Records as the Core Domain
`funcionarios` is the central personnel-record app and likely the parent entity for the other business domains. It owns employee persistence, input validation, CRUD request handling, and views/templates:
- `funcionarios/models.py`
- `funcionarios/forms.py`
- `funcionarios/views.py`

Its schema originates in `funcionarios/migrations/0001_initial.py`. Other modules’ migration names explicitly reference `funcionario`, indicating that evaluations, documents, and events are associated with an employee record.

#### 4. Personnel File Documents
`documentos` manages digitized documents connected to personnel files, including a separate document-type management area. The app has model/form/view layers and templates for document CRUD and type CRUD:
- `documentos/models.py`
- `documentos/views.py`
- `templates/documentos/tipos/index.html`

Document state evolved through `documentos/migrations/0002_alter_documentofuncionario_estado.py`, making document status a meaningful lifecycle boundary. Storage implementation is not evident from the supplied tree; do not assume local media, object storage, or external document services.

#### 5. Evaluations and Employment Events
Two independent employee-associated domains capture time-based HR history:
- Performance/employee evaluations: `evaluaciones/models.py`, `evaluaciones/forms.py`, `evaluaciones/views.py`
- Labor events: `eventoslaborales/models.py`, `eventoslaborales/forms.py`, `eventoslaborales/views.py`

Both follow server-side CRUD flows with list/create/edit/delete templates. Event migrations show employee linkage and end-date handling are part of the modeled lifecycle: `eventoslaborales/migrations/0002_rename_funcionario_eventolaboral_id_funcionario_and_more.py` and `eventoslaborales/migrations/0003_alter_eventolaboral_fecha_fin.py`.

#### 6. Identity and Access Boundary
`usuarios` isolates user/account concerns from personnel records:
- `usuarios/models.py`
- `usuarios/forms.py`
- `usuarios/views.py`

It has its own routing and a login template at `templates/usuarios/login.html`. The README claims role-based access control, but the available tree alone does not establish the exact authorization model, permissions, or whether Django’s built-in auth is extended.

#### 7. Persistence, UI, and External Dependencies
Django migrations are the database contract across each domain app; development uses SQLite and production is intended to use PostgreSQL per README. Dependencies are declared in `requirements.txt`. The presentation layer is Django templates organized by app, composed through `templates/layouts/base.html`, with static CSS/JavaScript under `static/`. Bootstrap 5 is the stated UI framework. No queue, cache, API gateway, cloud provider, or third-party SaaS integration is evidenced in the repository tree.

Main entry points: [`legajosdefuncionarios/urls.py`](https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/legajosdefuncionarios/urls.py) (Project settings & routes), [`funcionarios/models.py`](https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/funcionarios/models.py) (Employee records), [`templates/layouts/base.html`](https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/templates/layouts/base.html) (App templates), [`evaluaciones/models.py`](https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/evaluaciones/models.py) (Employee evaluations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Django Runtime"]
  node_manage{{"Django entry point<br/>Python runtime<br/>[manage.py]"}}
  node_project["Project settings &amp; routes<br/>Django project<br/>[urls.py]"]
  node_deployment{{"WSGI / ASGI adapters<br/>deployment adapter<br/>[wsgi.py]"}}
  node_migrations["Migration contracts<br/>Django migrations<br/>[0001_initial.py]"]
  node_database[("Relational database<br/>SQLite / PostgreSQL")]
  node_requirements["Dependencies<br/>[requirements.txt]"]
end

subgraph group_domains["Personnel Domains"]
  node_accounts["User accounts<br/>Django app<br/>[views.py]"]
  node_employees["Employee records<br/>core Django app<br/>[models.py]"]
  node_employee_forms["Employee validation<br/>Django forms<br/>[forms.py]"]
  node_documents["Personnel documents<br/>Django app<br/>[models.py]"]
  node_evaluations["Employee evaluations<br/>Django app<br/>[models.py]"]
  node_evaluation_forms["Evaluation validation<br/>Django forms<br/>[forms.py]"]
  node_events["Labor events<br/>Django app<br/>[models.py]"]
  node_event_forms["Event validation<br/>Django forms<br/>[forms.py]"]
end

subgraph group_presentation["Server-rendered UI"]
  node_templates["App templates<br/>Django templates<br/>[base.html]"]
  node_static["Static assets<br/>CSS / JavaScript"]
end

node_browser(("Browser<br/>client"))

node_browser -->|"HTTP requests"| node_project
node_manage -->|"starts Django"| node_project
node_deployment -->|"serves application"| node_project
node_project -->|"routes requests"| node_accounts
node_project -->|"routes requests"| node_employees
node_project -->|"routes requests"| node_documents
node_project -->|"routes requests"| node_evaluations
node_project -->|"routes requests"| node_events
node_accounts -->|"renders login"| node_templates
node_employees -->|"validates CRUD input"| node_employee_forms
node_employees -->|"persists employees"| node_database
node_documents -->|"belongs to employee"| node_employees
node_documents -->|"persists document metadata"| node_database
node_evaluations -->|"belongs to employee"| node_employees
node_evaluations -->|"validates CRUD input"| node_evaluation_forms
node_evaluations -->|"persists evaluations"| node_database
node_events -->|"belongs to employee"| node_employees
node_events -->|"validates CRUD input"| node_event_forms
node_events -->|"persists events"| node_database
node_migrations -->|"evolves schema"| node_database
node_employees -->|"renders CRUD pages"| node_templates
node_documents -->|"renders CRUD pages"| node_templates
node_evaluations -->|"renders CRUD pages"| node_templates
node_events -->|"renders CRUD pages"| node_templates
node_templates -->|"uses UI assets"| node_static
node_requirements -.->|"provides Django dependencies"| node_manage

click node_manage "https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/manage.py"
click node_project "https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/legajosdefuncionarios/urls.py"
click node_deployment "https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/legajosdefuncionarios/wsgi.py"
click node_accounts "https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/usuarios/views.py"
click node_employees "https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/funcionarios/models.py"
click node_employee_forms "https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/funcionarios/forms.py"
click node_documents "https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/documentos/models.py"
click node_evaluations "https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/evaluaciones/models.py"
click node_evaluation_forms "https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/evaluaciones/forms.py"
click node_events "https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/eventoslaborales/models.py"
click node_event_forms "https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/eventoslaborales/forms.py"
click node_migrations "https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/funcionarios/migrations/0001_initial.py"
click node_templates "https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/templates/layouts/base.html"
click node_requirements "https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/requirements.txt"

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_manage,node_project,node_deployment,node_migrations,node_database,node_requirements toneBlue
class node_accounts,node_employees,node_employee_forms,node_documents,node_evaluations,node_evaluation_forms,node_events,node_event_forms toneAmber
class node_templates,node_static toneMint
class node_browser toneNeutral
```

## Components

### Django Runtime

- [Django entry point](https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/manage.py): Python runtime · `manage.py`
- [Project settings & routes](https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/legajosdefuncionarios/urls.py): Django project · `legajosdefuncionarios/urls.py`
- [WSGI / ASGI adapters](https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/legajosdefuncionarios/wsgi.py): deployment adapter · `legajosdefuncionarios/wsgi.py`
- [Migration contracts](https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/funcionarios/migrations/0001_initial.py): Django migrations · Per-app schema history defines the database contract. · `funcionarios/migrations/0001_initial.py`
- **Relational database**: SQLite / PostgreSQL · Development uses SQLite; production is intended for PostgreSQL.
- [Dependencies](https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/requirements.txt): Python dependencies · `requirements.txt`

### Personnel Domains

- [User accounts](https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/usuarios/views.py): Django app · Login and account concerns are isolated from personnel records. · `usuarios/views.py`
- [Employee records](https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/funcionarios/models.py): core Django app · Parent personnel-file entity for associated HR domains. · `funcionarios/models.py`
- [Employee validation](https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/funcionarios/forms.py): Django forms · `funcionarios/forms.py`
- [Personnel documents](https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/documentos/models.py): Django app · Manages digitized documents, types, and document status. · `documentos/models.py`
- [Employee evaluations](https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/evaluaciones/models.py): Django app · `evaluaciones/models.py`
- [Evaluation validation](https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/evaluaciones/forms.py): Django forms · `evaluaciones/forms.py`
- [Labor events](https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/eventoslaborales/models.py): Django app · Captures employee-linked events with end-date lifecycle handling. · `eventoslaborales/models.py`
- [Event validation](https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/eventoslaborales/forms.py): Django forms · `eventoslaborales/forms.py`

### Server-rendered UI

- [App templates](https://github.com/ivansosabz/legajos-de-funcionarios/blob/main/templates/layouts/base.html): Django templates · CRUD and login pages are rendered server-side. · `templates/layouts/base.html`
- **Static assets**: CSS / JavaScript · Bootstrap-based presentation assets.

### Other components

- **Browser**: client

## Connections

- Browser → Project settings & routes: HTTP requests
- Django entry point → Project settings & routes: starts Django
- WSGI / ASGI adapters → Project settings & routes: serves application
- Project settings & routes → User accounts: routes requests
- Project settings & routes → Employee records: routes requests
- Project settings & routes → Personnel documents: routes requests
- Project settings & routes → Employee evaluations: routes requests
- Project settings & routes → Labor events: routes requests
- User accounts → App templates: renders login
- Employee records → Employee validation: validates CRUD input
- Employee records → Relational database: persists employees
- Personnel documents → Employee records: belongs to employee
- Personnel documents → Relational database: persists document metadata
- Employee evaluations → Employee records: belongs to employee
- Employee evaluations → Evaluation validation: validates CRUD input
- Employee evaluations → Relational database: persists evaluations
- Labor events → Employee records: belongs to employee
- Labor events → Event validation: validates CRUD input
- Labor events → Relational database: persists events
- Migration contracts → Relational database: evolves schema
- Employee records → App templates: renders CRUD pages
- Personnel documents → App templates: renders CRUD pages
- Employee evaluations → App templates: renders CRUD pages
- Labor events → App templates: renders CRUD pages
- App templates → Static assets: uses UI assets
- Dependencies → Django entry point: provides Django dependencies
