# gutierrez101/proyecto_construccion architecture

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

- Interactive diagram: https://gitdiagram.com/gutierrez101/proyecto_construccion
- Repository: https://github.com/gutierrez101/proyecto_construccion

## Overview

QueueLess is a web-based service queue system. Citizens select a service, request a turn, and track or cancel it; employees call and advance turns; administrators manage services and review filtered turn records. The frontend routes role-specific screens to a Django REST API, whose turn handlers use service, turn, and visitor-session records and can send Firebase push notifications. The excerpts establish the main API calls and push registration; some turn and notification internals are partial or unsampled, so uncertain links are omitted.

Main entry points: [`backend/turnos/views.py`](https://github.com/gutierrez101/proyecto_construccion/blob/master/backend/turnos/views.py) (Turn and service API), [`frontend/src/App.jsx`](https://github.com/gutierrez101/proyecto_construccion/blob/master/frontend/src/App.jsx) (Role routing), [`backend/notificaciones/views.py`](https://github.com/gutierrez101/proyecto_construccion/blob/master/backend/notificaciones/views.py) (Subscription endpoint), [`frontend/src/views/VistaCiudadano.jsx`](https://github.com/gutierrez101/proyecto_construccion/blob/master/frontend/src/views/VistaCiudadano.jsx) (Citizen queue)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Role routing<br/>[App.jsx]"]
  node_login["Sign-in<br/>[Login.jsx]"]
  node_citizen_ui["Citizen queue<br/>[VistaCiudadano.jsx]"]
  node_employee_ui["Counter desk<br/>[VistaEmpleado.jsx]"]
  node_admin_ui["Admin dashboard<br/>[VistaAdmin.jsx]"]
end

subgraph group_turns["Turn management"]
  node_turn_api["Turn and service API<br/>[views.py]"]
  node_turn_models[("Queue records<br/>[models.py]")]
  node_turn_serializers["API serialization<br/>[serializers.py]"]
end

subgraph group_push["Push notifications"]
  node_push_views["Subscription endpoint<br/>[views.py]"]
  node_push_records[("Push subscriptions<br/>[models.py]")]
  node_firebase_service["Firebase setup"]
  node_push_frontend["Browser messaging<br/>[firebase.js]"]
  node_push_activation["Push activation"]
end

subgraph group_platform["API platform"]
  node_django_routes["API routing<br/>[urls.py]"]
end

node_citizen(("Citizen"))
node_employee(("Employee"))
node_administrator(("Administrator"))
node_firebase["Firebase Cloud Messaging"]

node_citizen -->|"opens"| node_app
node_employee -->|"opens"| node_app
node_administrator -->|"opens"| node_app
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_citizen_ui
node_app -->|"routes to"| node_employee_ui
node_app -->|"routes to"| node_admin_ui
node_login -.->|"authenticates via"| node_turn_api
node_citizen_ui -->|"requests turns"| node_turn_api
node_employee_ui -->|"manages turns"| node_turn_api
node_admin_ui -->|"manages records"| node_turn_api
node_turn_api -->|"reads and writes"| node_turn_models
node_turn_api -->|"serializes"| node_turn_serializers
node_turn_api -.->|"registers subscriptions"| node_push_views
node_push_views -->|"validates session"| node_turn_models
node_push_views -->|"updates subscription"| node_push_records
node_citizen_ui -->|"gets token"| node_push_frontend
node_push_activation -->|"uses Firebase app"| node_push_frontend
node_push_activation -->|"registers device"| node_push_views
node_push_frontend -->|"requests messaging"| node_firebase
node_firebase_service -->|"initializes app"| node_firebase
node_turn_api -.->|"sends push"| node_firebase
node_django_routes -.->|"routes API"| node_turn_api

click node_app "https://github.com/gutierrez101/proyecto_construccion/blob/master/frontend/src/App.jsx"
click node_login "https://github.com/gutierrez101/proyecto_construccion/blob/master/frontend/src/views/Login.jsx"
click node_citizen_ui "https://github.com/gutierrez101/proyecto_construccion/blob/master/frontend/src/views/VistaCiudadano.jsx"
click node_employee_ui "https://github.com/gutierrez101/proyecto_construccion/blob/master/frontend/src/views/VistaEmpleado.jsx"
click node_admin_ui "https://github.com/gutierrez101/proyecto_construccion/blob/master/frontend/src/views/VistaAdmin.jsx"
click node_turn_api "https://github.com/gutierrez101/proyecto_construccion/blob/master/backend/turnos/views.py"
click node_turn_models "https://github.com/gutierrez101/proyecto_construccion/blob/master/backend/turnos/models.py"
click node_turn_serializers "https://github.com/gutierrez101/proyecto_construccion/blob/master/backend/turnos/serializers.py"
click node_push_views "https://github.com/gutierrez101/proyecto_construccion/blob/master/backend/notificaciones/views.py"
click node_push_records "https://github.com/gutierrez101/proyecto_construccion/blob/master/backend/notificaciones/models.py"
click node_firebase_service "https://github.com/gutierrez101/proyecto_construccion/blob/master/backend/notificaciones/firebase_service.py"
click node_push_frontend "https://github.com/gutierrez101/proyecto_construccion/blob/master/frontend/src/services/firebase.js"
click node_push_activation "https://github.com/gutierrez101/proyecto_construccion/blob/master/frontend/src/services/pushNotifications.js"
click node_django_routes "https://github.com/gutierrez101/proyecto_construccion/blob/master/backend/config/urls.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_app,node_login,node_citizen_ui,node_employee_ui,node_admin_ui toneBlue
class node_turn_api,node_turn_models,node_turn_serializers toneAmber
class node_push_views,node_push_records,node_firebase_service,node_push_frontend,node_push_activation toneMint
class node_django_routes toneRose
class node_citizen,node_employee,node_administrator,node_firebase toneIndigo
```

## Components

### Web client

- [Role routing](https://github.com/gutierrez101/proyecto_construccion/blob/master/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Sign-in](https://github.com/gutierrez101/proyecto_construccion/blob/master/frontend/src/views/Login.jsx): `frontend/src/views/Login.jsx`
- [Citizen queue](https://github.com/gutierrez101/proyecto_construccion/blob/master/frontend/src/views/VistaCiudadano.jsx): `frontend/src/views/VistaCiudadano.jsx`
- [Counter desk](https://github.com/gutierrez101/proyecto_construccion/blob/master/frontend/src/views/VistaEmpleado.jsx): `frontend/src/views/VistaEmpleado.jsx`
- [Admin dashboard](https://github.com/gutierrez101/proyecto_construccion/blob/master/frontend/src/views/VistaAdmin.jsx): `frontend/src/views/VistaAdmin.jsx`

### Turn management

- [Turn and service API](https://github.com/gutierrez101/proyecto_construccion/blob/master/backend/turnos/views.py): `backend/turnos/views.py`
- [Queue records](https://github.com/gutierrez101/proyecto_construccion/blob/master/backend/turnos/models.py): `backend/turnos/models.py`
- [API serialization](https://github.com/gutierrez101/proyecto_construccion/blob/master/backend/turnos/serializers.py): `backend/turnos/serializers.py`

### Push notifications

- [Subscription endpoint](https://github.com/gutierrez101/proyecto_construccion/blob/master/backend/notificaciones/views.py): `backend/notificaciones/views.py`
- [Push subscriptions](https://github.com/gutierrez101/proyecto_construccion/blob/master/backend/notificaciones/models.py): `backend/notificaciones/models.py`
- [Firebase setup](https://github.com/gutierrez101/proyecto_construccion/blob/master/backend/notificaciones/firebase_service.py): `backend/notificaciones/firebase_service.py`
- [Browser messaging](https://github.com/gutierrez101/proyecto_construccion/blob/master/frontend/src/services/firebase.js): `frontend/src/services/firebase.js`
- [Push activation](https://github.com/gutierrez101/proyecto_construccion/blob/master/frontend/src/services/pushNotifications.js): `frontend/src/services/pushNotifications.js`

### API platform

- [API routing](https://github.com/gutierrez101/proyecto_construccion/blob/master/backend/config/urls.py): `backend/config/urls.py`

### Other components

- **Citizen**
- **Employee**
- **Administrator**
- **Firebase Cloud Messaging**

## Connections

- Citizen → Role routing: opens (evidence: `frontend/src/App.jsx`)
- Employee → Role routing: opens (evidence: `frontend/src/App.jsx`)
- Administrator → Role routing: opens (evidence: `frontend/src/App.jsx`)
- Role routing → Sign-in: routes to (evidence: `frontend/src/App.jsx`)
- Role routing → Citizen queue: routes to (evidence: `frontend/src/App.jsx`)
- Role routing → Counter desk: routes to (evidence: `frontend/src/App.jsx`)
- Role routing → Admin dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Sign-in → Turn and service API: authenticates via
- Citizen queue → Turn and service API: requests turns (evidence: `frontend/src/views/VistaCiudadano.jsx`)
- Counter desk → Turn and service API: manages turns (evidence: `frontend/src/views/VistaEmpleado.jsx`)
- Admin dashboard → Turn and service API: manages records (evidence: `frontend/src/views/VistaAdmin.jsx`)
- Turn and service API → Queue records: reads and writes (evidence: `backend/turnos/views.py`)
- Turn and service API → API serialization: serializes (evidence: `backend/turnos/views.py`)
- Turn and service API → Subscription endpoint: registers subscriptions
- Subscription endpoint → Queue records: validates session (evidence: `backend/notificaciones/views.py`)
- Subscription endpoint → Push subscriptions: updates subscription (evidence: `backend/notificaciones/views.py`)
- Citizen queue → Browser messaging: gets token (evidence: `frontend/src/views/VistaCiudadano.jsx`)
- Push activation → Browser messaging: uses Firebase app (evidence: `frontend/src/services/pushNotifications.js`)
- Push activation → Subscription endpoint: registers device (evidence: `frontend/src/services/pushNotifications.js`)
- Browser messaging → Firebase Cloud Messaging: requests messaging (evidence: `frontend/src/services/firebase.js`)
- Firebase setup → Firebase Cloud Messaging: initializes app (evidence: `backend/notificaciones/firebase_service.py`)
- Turn and service API → Firebase Cloud Messaging: sends push
- API routing → Turn and service API: routes API
