# danielr81/gap architecture

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

- Interactive diagram: https://gitdiagram.com/danielr81/gap
- Repository: https://github.com/danielr81/gap

## Overview

GAP is a Django application for preparing privacy notices (Avisos de Privacidad) through a saved, multi-section questionnaire. Users sign in, create or continue a questionnaire, complete its sections, and can generate integral or simplified notice documents. The application also supports selecting an obligated entity from a hierarchical registry and managing questionnaire-related records. The graph reflects the sampled source and SOURCE INDEX references; where browser-to-server wiring or unsampled implementation details are not established, relationships are omitted or marked unverified.

Main entry points: [`GAP/apps/cuestionarios/views/cuestionario.py`](https://github.com/danielr81/gap/blob/main/GAP/apps/cuestionarios/views/cuestionario.py) (Questionnaire workflow), [`GAP/static/js/main.js`](https://github.com/danielr81/gap/blob/main/GAP/static/js/main.js) (Browser entry), [`GAP/config/settings/base.py`](https://github.com/danielr81/gap/blob/main/GAP/config/settings/base.py) (Django settings), [`GAP/static/js/sections`](https://github.com/danielr81/gap/tree/main/GAP/static/js/sections) (Section interactions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Accounts"]
  node_account_views["Account views<br/>[views.py]"]
  node_account_forms["Account forms<br/>[forms.py]"]
  node_account_model["User model<br/>[models.py]"]
  node_account_urls["Account routes<br/>[urls.py]"]
end

subgraph group_questionnaire["Questionnaire"]
  node_question_routes["Questionnaire routes<br/>[urls.py]"]
  node_question_views["Questionnaire workflow<br/>[cuestionario.py]"]
  node_question_forms["Section forms<br/>[forms.py]"]
  node_question_model["Questionnaire records<br/>[models.py]"]
  node_section_views["Section handlers"]
  node_registry_views["Entity registry API<br/>[views.py]"]
  node_registry_model["Entity hierarchy<br/>[models.py]"]
  node_registry_routes["Registry routes<br/>[urls.py]"]
end

subgraph group_documents["Notice generation"]
  node_service_views["Notice endpoints<br/>[views.py]"]
  node_generator["Document generator<br/>[models.py]"]
end

subgraph group_browser["Browser interface"]
  node_main_js["Browser entry<br/>[main.js]"]
  node_navigation["Section navigation<br/>[navigation.js]"]
  node_messages["Message UI<br/>[messages.js]"]
  node_section_js["Section interactions"]
  node_registry_js["Registry selector<br/>[padronso.js]"]
end

node_visitor(("User"))
node_settings["Django settings<br/>[base.py]"]
node_database[("SQLite database")]

node_visitor -.->|"opens account"| node_account_urls
node_account_urls -->|"routes requests"| node_account_views
node_account_views -->|"uses forms"| node_account_forms
node_account_forms -->|"validates against"| node_account_model
node_settings -->|"sets user model"| node_account_model
node_settings -.->|"sets root routing"| node_question_routes
node_visitor -.->|"opens questionnaire"| node_question_routes
node_question_routes -->|"routes requests"| node_question_views
node_question_views -->|"builds forms"| node_question_forms
node_question_views -->|"reads and saves"| node_question_model
node_question_forms -->|"models fields"| node_question_model
node_question_views -.->|"dispatches sections"| node_section_views
node_settings -->|"configures SQLite"| node_database
node_registry_routes -->|"routes requests"| node_registry_views
node_registry_views -->|"queries hierarchy"| node_registry_model
node_service_views -->|"loads questionnaire data"| node_question_model
node_service_views -->|"builds notice document"| node_generator
node_main_js -->|"initializes"| node_navigation
node_main_js -->|"initializes"| node_messages
node_main_js -->|"loads section module"| node_section_js
node_section_js -->|"shows messages"| node_messages
node_registry_js -.->|"requests registry data"| node_registry_routes
node_section_js -.->|"submits section data"| node_question_views

click node_account_views "https://github.com/danielr81/gap/blob/main/GAP/apps/usuarios/views.py"
click node_account_forms "https://github.com/danielr81/gap/blob/main/GAP/apps/usuarios/forms.py"
click node_account_model "https://github.com/danielr81/gap/blob/main/GAP/apps/usuarios/models.py"
click node_account_urls "https://github.com/danielr81/gap/blob/main/GAP/apps/usuarios/urls.py"
click node_question_routes "https://github.com/danielr81/gap/blob/main/GAP/apps/cuestionarios/urls.py"
click node_question_views "https://github.com/danielr81/gap/blob/main/GAP/apps/cuestionarios/views/cuestionario.py"
click node_question_forms "https://github.com/danielr81/gap/blob/main/GAP/apps/cuestionarios/forms.py"
click node_question_model "https://github.com/danielr81/gap/blob/main/GAP/apps/cuestionarios/models.py"
click node_section_views "https://github.com/danielr81/gap/tree/main/GAP/apps/cuestionarios/views"
click node_registry_views "https://github.com/danielr81/gap/blob/main/GAP/apps/padronso/views.py"
click node_registry_model "https://github.com/danielr81/gap/blob/main/GAP/apps/padronso/models.py"
click node_registry_routes "https://github.com/danielr81/gap/blob/main/GAP/apps/padronso/urls.py"
click node_service_views "https://github.com/danielr81/gap/blob/main/GAP/apps/servicios/views.py"
click node_generator "https://github.com/danielr81/gap/blob/main/GAP/apps/servicios/models.py"
click node_settings "https://github.com/danielr81/gap/blob/main/GAP/config/settings/base.py"
click node_main_js "https://github.com/danielr81/gap/blob/main/GAP/static/js/main.js"
click node_navigation "https://github.com/danielr81/gap/blob/main/GAP/static/js/ui/navigation.js"
click node_messages "https://github.com/danielr81/gap/blob/main/GAP/static/js/ui/messages.js"
click node_section_js "https://github.com/danielr81/gap/tree/main/GAP/static/js/sections"
click node_registry_js "https://github.com/danielr81/gap/blob/main/GAP/static/js/padronso.js"

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_account_views,node_account_forms,node_account_model,node_account_urls,node_visitor toneBlue
class node_question_routes,node_question_views,node_question_forms,node_question_model,node_section_views,node_registry_views,node_registry_model,node_registry_routes,node_database toneAmber
class node_service_views,node_generator toneMint
class node_main_js,node_navigation,node_messages,node_section_js,node_registry_js toneRose
class node_settings toneTeal
```

## Components

### Accounts

- [Account views](https://github.com/danielr81/gap/blob/main/GAP/apps/usuarios/views.py): `GAP/apps/usuarios/views.py`
- [Account forms](https://github.com/danielr81/gap/blob/main/GAP/apps/usuarios/forms.py): `GAP/apps/usuarios/forms.py`
- [User model](https://github.com/danielr81/gap/blob/main/GAP/apps/usuarios/models.py): `GAP/apps/usuarios/models.py`
- [Account routes](https://github.com/danielr81/gap/blob/main/GAP/apps/usuarios/urls.py): `GAP/apps/usuarios/urls.py`

### Questionnaire

- [Questionnaire routes](https://github.com/danielr81/gap/blob/main/GAP/apps/cuestionarios/urls.py): `GAP/apps/cuestionarios/urls.py`
- [Questionnaire workflow](https://github.com/danielr81/gap/blob/main/GAP/apps/cuestionarios/views/cuestionario.py): `GAP/apps/cuestionarios/views/cuestionario.py`
- [Section forms](https://github.com/danielr81/gap/blob/main/GAP/apps/cuestionarios/forms.py): `GAP/apps/cuestionarios/forms.py`
- [Questionnaire records](https://github.com/danielr81/gap/blob/main/GAP/apps/cuestionarios/models.py): `GAP/apps/cuestionarios/models.py`
- [Section handlers](https://github.com/danielr81/gap/tree/main/GAP/apps/cuestionarios/views): `GAP/apps/cuestionarios/views`
- [Entity registry API](https://github.com/danielr81/gap/blob/main/GAP/apps/padronso/views.py): `GAP/apps/padronso/views.py`
- [Entity hierarchy](https://github.com/danielr81/gap/blob/main/GAP/apps/padronso/models.py): `GAP/apps/padronso/models.py`
- [Registry routes](https://github.com/danielr81/gap/blob/main/GAP/apps/padronso/urls.py): `GAP/apps/padronso/urls.py`

### Notice generation

- [Notice endpoints](https://github.com/danielr81/gap/blob/main/GAP/apps/servicios/views.py): `GAP/apps/servicios/views.py`
- [Document generator](https://github.com/danielr81/gap/blob/main/GAP/apps/servicios/models.py): `GAP/apps/servicios/models.py`

### Browser interface

- [Browser entry](https://github.com/danielr81/gap/blob/main/GAP/static/js/main.js): `GAP/static/js/main.js`
- [Section navigation](https://github.com/danielr81/gap/blob/main/GAP/static/js/ui/navigation.js): `GAP/static/js/ui/navigation.js`
- [Message UI](https://github.com/danielr81/gap/blob/main/GAP/static/js/ui/messages.js): `GAP/static/js/ui/messages.js`
- [Section interactions](https://github.com/danielr81/gap/tree/main/GAP/static/js/sections): `GAP/static/js/sections`
- [Registry selector](https://github.com/danielr81/gap/blob/main/GAP/static/js/padronso.js): `GAP/static/js/padronso.js`

### Other components

- **User**
- [Django settings](https://github.com/danielr81/gap/blob/main/GAP/config/settings/base.py): `GAP/config/settings/base.py`
- **SQLite database**

## Connections

- User → Account routes: opens account
- Account routes → Account views: routes requests
- Account views → Account forms: uses forms (evidence: `GAP/apps/usuarios/views.py`)
- Account forms → User model: validates against (evidence: `GAP/apps/usuarios/forms.py`)
- Django settings → User model: sets user model (evidence: `GAP/config/settings/base.py`)
- Django settings → Questionnaire routes: sets root routing
- User → Questionnaire routes: opens questionnaire
- Questionnaire routes → Questionnaire workflow: routes requests (evidence: `GAP/apps/cuestionarios/urls.py`)
- Questionnaire workflow → Section forms: builds forms (evidence: `GAP/apps/cuestionarios/views/cuestionario.py`)
- Questionnaire workflow → Questionnaire records: reads and saves (evidence: `GAP/apps/cuestionarios/views/cuestionario.py`)
- Section forms → Questionnaire records: models fields (evidence: `GAP/apps/cuestionarios/forms.py`)
- Questionnaire workflow → Section handlers: dispatches sections
- Django settings → SQLite database: configures SQLite (evidence: `GAP/config/settings/base.py`)
- Registry routes → Entity registry API: routes requests (evidence: `GAP/apps/padronso/urls.py`)
- Entity registry API → Entity hierarchy: queries hierarchy (evidence: `GAP/apps/padronso/views.py`)
- Notice endpoints → Questionnaire records: loads questionnaire data (evidence: `GAP/apps/servicios/views.py`)
- Notice endpoints → Document generator: builds notice document (evidence: `GAP/apps/servicios/views.py`)
- Browser entry → Section navigation: initializes (evidence: `GAP/static/js/main.js`)
- Browser entry → Message UI: initializes (evidence: `GAP/static/js/main.js`)
- Browser entry → Section interactions: loads section module (evidence: `GAP/static/js/main.js`)
- Section interactions → Message UI: shows messages (evidence: `GAP/static/js/sections/section3.js`)
- Registry selector → Registry routes: requests registry data
- Section interactions → Questionnaire workflow: submits section data
