# acruzc/gestion-polizas architecture

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

- Interactive diagram: https://gitdiagram.com/acruzc/gestion-polizas
- Repository: https://github.com/acruzc/gestion-polizas

## Overview

MisPolizas is a full-stack insurance-policy viewer. A user opens the policy list, which loads policies through the Angular service and displays them; selecting a policy opens its detail route, which requests that policy by ID. The backend exposes list and detail endpoints backed by an in-memory policy array. The README also documents the Node/Express API and Angular frontend. The status-filter pipe is present, though its use by the list template was not shown; that connection is therefore marked unverified.

Main entry points: [`front/MisPolizas/src/app/services/poliza.service.ts`](https://github.com/acruzc/gestion-polizas/blob/main/front/MisPolizas/src/app/services/poliza.service.ts) (Policy service), [`front/MisPolizas/src/app/app-routing.module.ts`](https://github.com/acruzc/gestion-polizas/blob/main/front/MisPolizas/src/app/app-routing.module.ts) (Policy routes), [`front/MisPolizas/src/app/components/listado/listado.component.ts`](https://github.com/acruzc/gestion-polizas/blob/main/front/MisPolizas/src/app/components/listado/listado.component.ts) (Policy list), [`back/src/controllers/policiesController.ts`](https://github.com/acruzc/gestion-polizas/blob/main/back/src/controllers/policiesController.ts) (Policy controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Angular experience"]
  node_routes["Policy routes"]
  node_list["Policy list"]
  node_detail["Policy detail"]
  node_statusfilter["Status filter"]
end

subgraph group_clientdata["Client data access"]
  node_service["Policy service<br/>[poliza.service.ts]"]
end

subgraph group_server["Policy API"]
  node_api["Express API<br/>[index.ts]"]
  node_endpoints["Policy endpoints<br/>[policiesRoutes.ts]"]
  node_controller["Policy controller"]
  node_store[("In-memory policies")]
end

subgraph group_contracts["Policy contracts"]
  node_backendmodel["Backend policy type<br/>[models.ts]"]
  node_frontendmodel["Frontend policy type<br/>[models.ts]"]
end

node_viewer(("Policy viewer"))

node_viewer -->|"opens"| node_routes
node_routes -->|"routes list"| node_list
node_routes -->|"routes detail"| node_detail
node_list -->|"loads policies"| node_service
node_detail -->|"loads by ID"| node_service
node_service -->|"HTTP requests"| node_api
node_api -->|"mounts routes"| node_endpoints
node_endpoints -->|"dispatches"| node_controller
node_controller -->|"reads"| node_store
node_controller -->|"types as"| node_backendmodel
node_service -->|"returns typed data"| node_frontendmodel
node_statusfilter -->|"filters policies"| node_frontendmodel
node_list -.->|"may apply"| node_statusfilter

click node_routes "https://github.com/acruzc/gestion-polizas/blob/main/front/MisPolizas/src/app/app-routing.module.ts"
click node_list "https://github.com/acruzc/gestion-polizas/blob/main/front/MisPolizas/src/app/components/listado/listado.component.ts"
click node_detail "https://github.com/acruzc/gestion-polizas/blob/main/front/MisPolizas/src/app/components/poliza/poliza.component.ts"
click node_statusfilter "https://github.com/acruzc/gestion-polizas/blob/main/front/MisPolizas/src/app/pipes/filter-by-status-pipe.pipe.ts"
click node_service "https://github.com/acruzc/gestion-polizas/blob/main/front/MisPolizas/src/app/services/poliza.service.ts"
click node_api "https://github.com/acruzc/gestion-polizas/blob/main/back/src/index.ts"
click node_endpoints "https://github.com/acruzc/gestion-polizas/blob/main/back/src/routes/policiesRoutes.ts"
click node_controller "https://github.com/acruzc/gestion-polizas/blob/main/back/src/controllers/policiesController.ts"
click node_store "https://github.com/acruzc/gestion-polizas/blob/main/back/src/controllers/policiesController.ts"
click node_backendmodel "https://github.com/acruzc/gestion-polizas/blob/main/back/src/model/models.ts"
click node_frontendmodel "https://github.com/acruzc/gestion-polizas/blob/main/front/MisPolizas/src/app/models/models.ts"

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_routes,node_list,node_detail,node_statusfilter,node_viewer toneBlue
class node_service toneAmber
class node_api,node_endpoints,node_controller,node_store toneMint
class node_backendmodel,node_frontendmodel toneRose
```

## Components

### Angular experience

- [Policy routes](https://github.com/acruzc/gestion-polizas/blob/main/front/MisPolizas/src/app/app-routing.module.ts): `front/MisPolizas/src/app/app-routing.module.ts`
- [Policy list](https://github.com/acruzc/gestion-polizas/blob/main/front/MisPolizas/src/app/components/listado/listado.component.ts): `front/MisPolizas/src/app/components/listado/listado.component.ts`
- [Policy detail](https://github.com/acruzc/gestion-polizas/blob/main/front/MisPolizas/src/app/components/poliza/poliza.component.ts): `front/MisPolizas/src/app/components/poliza/poliza.component.ts`
- [Status filter](https://github.com/acruzc/gestion-polizas/blob/main/front/MisPolizas/src/app/pipes/filter-by-status-pipe.pipe.ts): `front/MisPolizas/src/app/pipes/filter-by-status-pipe.pipe.ts`

### Client data access

- [Policy service](https://github.com/acruzc/gestion-polizas/blob/main/front/MisPolizas/src/app/services/poliza.service.ts): `front/MisPolizas/src/app/services/poliza.service.ts`

### Policy API

- [Express API](https://github.com/acruzc/gestion-polizas/blob/main/back/src/index.ts): `back/src/index.ts`
- [Policy endpoints](https://github.com/acruzc/gestion-polizas/blob/main/back/src/routes/policiesRoutes.ts): `back/src/routes/policiesRoutes.ts`
- [Policy controller](https://github.com/acruzc/gestion-polizas/blob/main/back/src/controllers/policiesController.ts): `back/src/controllers/policiesController.ts`
- [In-memory policies](https://github.com/acruzc/gestion-polizas/blob/main/back/src/controllers/policiesController.ts): `back/src/controllers/policiesController.ts`

### Policy contracts

- [Backend policy type](https://github.com/acruzc/gestion-polizas/blob/main/back/src/model/models.ts): `back/src/model/models.ts`
- [Frontend policy type](https://github.com/acruzc/gestion-polizas/blob/main/front/MisPolizas/src/app/models/models.ts): `front/MisPolizas/src/app/models/models.ts`

### Other components

- **Policy viewer**

## Connections

- Policy viewer → Policy routes: opens (evidence: `README.md`)
- Policy routes → Policy list: routes list (evidence: `front/MisPolizas/src/app/app-routing.module.ts`)
- Policy routes → Policy detail: routes detail (evidence: `front/MisPolizas/src/app/app-routing.module.ts`)
- Policy list → Policy service: loads policies (evidence: `front/MisPolizas/src/app/components/listado/listado.component.ts`)
- Policy detail → Policy service: loads by ID (evidence: `front/MisPolizas/src/app/components/poliza/poliza.component.ts`)
- Policy service → Express API: HTTP requests (evidence: `front/MisPolizas/src/app/services/poliza.service.ts`)
- Express API → Policy endpoints: mounts routes (evidence: `back/src/index.ts`)
- Policy endpoints → Policy controller: dispatches (evidence: `back/src/routes/policiesRoutes.ts`)
- Policy controller → In-memory policies: reads (evidence: `back/src/controllers/policiesController.ts`)
- Policy controller → Backend policy type: types as (evidence: `back/src/controllers/policiesController.ts`)
- Policy service → Frontend policy type: returns typed data (evidence: `front/MisPolizas/src/app/services/poliza.service.ts`)
- Status filter → Frontend policy type: filters policies (evidence: `front/MisPolizas/src/app/pipes/filter-by-status-pipe.pipe.ts`)
- Policy list → Status filter: may apply
