# matifl3/tpvetcare architecture

> Architecture diagram of the GitHub repository matifl3/tpvetcare, 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/matifl3/tpvetcare
- Repository: https://github.com/matifl3/tpvetcare

## Overview

PetCare’s frontend supports owner, professional, and administrator workflows: users authenticate into a role-aware dashboard, then manage pets, appointments, shopping, clinical records, training progress, or administration. Domain pages call resource services, which use a shared HTTP client to reach the Spring Boot API; authentication adds JWTs to requests. The README documents the full product scope, while sampled frontend sources substantiate selected routing and service calls. Backend internals and several unsampled page implementations are not represented as inspected components.

Main entry points: [`PetCare/frontend/src/app/core/api.service.ts`](https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/core/api.service.ts) (HTTP client), [`PetCare/frontend/src/app/services/mascota.service.ts`](https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/services/mascota.service.ts) (Pet API service), [`PetCare/frontend/src/app/core/auth.service.ts`](https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/core/auth.service.ts) (Authentication), [`PetCare/frontend/src/app/layout/dashboard/dashboard.component.ts`](https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/layout/dashboard/dashboard.component.ts) (Dashboard shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application Core"]
  node_routes["App routes<br/>[app.routes.ts]"]
  node_dashboard["Dashboard shell"]
  node_auth["Authentication<br/>[auth.service.ts]"]
  node_login["Login and registration<br/>[login.component.ts]"]
end

subgraph group_owner["Owner Services"]
  node_pets["Owner pet management"]
  node_booking["Appointment booking"]
  node_shop["Product browsing"]
  node_cart["Shopping cart and purchase<br/>[carrito.service.ts]"]
  node_cards["Payment cards<br/>[tarjeta.service.ts]"]
  node_purchasehistory["Purchase history"]
end

subgraph group_professional["Professional Care"]
  node_clinical["Clinical record page"]
  node_patients["Patient management"]
  node_training["Training progress"]
end

subgraph group_admin["Administration"]
  node_admin["Administrative operations"]
  node_reports["Sales and profit reports"]
end

subgraph group_shared["Shared API Layer"]
  node_api["HTTP client<br/>[api.service.ts]"]
  node_petservice["Pet API service<br/>[mascota.service.ts]"]
  node_turnos["Appointment service<br/>[turno.service.ts]"]
  node_productservice["Product service"]
  node_clinicalservice["Clinical record service"]
  node_trainingservice["Progress service"]
  node_reportservice["Reporting service<br/>[reporte.service.ts]"]
  node_models["Shared domain models<br/>[models.ts]"]
end

node_user(("PetCare user"))
node_backend["Spring Boot API"]

node_user -->|"signs in"| node_login
node_login -->|"submits credentials"| node_auth
node_auth -->|"sends requests"| node_api
node_routes -->|"routes to"| node_login
node_routes -->|"routes to"| node_dashboard
node_dashboard -->|"checks session"| node_auth
node_user -->|"opens workspace"| node_dashboard
node_pets -->|"manages pets"| node_petservice
node_booking -->|"loads pets"| node_petservice
node_booking -->|"requests appointment"| node_turnos
node_shop -->|"loads products"| node_productservice
node_shop -->|"adds products"| node_cart
node_purchasehistory -.->|"loads history"| node_cart
node_clinical -->|"loads patient"| node_petservice
node_clinical -->|"reads and updates"| node_clinicalservice
node_patients -.->|"lists patients"| node_petservice
node_training -->|"manages progress"| node_trainingservice
node_admin -.->|"requests reports"| node_reportservice
node_reports -.->|"loads reports"| node_reportservice
node_petservice -->|"calls"| node_api
node_turnos -->|"calls"| node_api
node_cart -->|"calls"| node_api
node_productservice -.->|"calls"| node_api
node_cards -.->|"calls"| node_api
node_clinicalservice -->|"calls"| node_api
node_trainingservice -.->|"calls"| node_api
node_reportservice -->|"calls"| node_api
node_api -->|"sends HTTP"| node_backend
node_auth -->|"authenticates"| node_backend

click node_routes "https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/app.routes.ts"
click node_dashboard "https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/layout/dashboard/dashboard.component.ts"
click node_auth "https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/core/auth.service.ts"
click node_login "https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/pages/login/login.component.ts"
click node_api "https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/core/api.service.ts"
click node_pets "https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/pages/cliente/mascotas/mascotas-page.component.ts"
click node_petservice "https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/services/mascota.service.ts"
click node_booking "https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/pages/cliente/reservar-turno/reservar-turno-page.component.ts"
click node_turnos "https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/services/turno.service.ts"
click node_shop "https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/pages/cliente/tienda/tienda-page.component.ts"
click node_cart "https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/services/carrito.service.ts"
click node_productservice "https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/services/producto.service.ts"
click node_cards "https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/services/tarjeta.service.ts"
click node_purchasehistory "https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/pages/cliente/carrito/carrito-historial/carrito-historial.component.ts"
click node_clinical "https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/pages/profesional/historial-clinico/historial-clinico-profesional-page.component.ts"
click node_clinicalservice "https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/services/historial-clinico.service.ts"
click node_patients "https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/pages/profesional/mis-pacientes/mis-pacientes-profesional-page.component.ts"
click node_training "https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/pages/seguimiento/seguimiento-page.component.ts"
click node_trainingservice "https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/services/seguimiento.service.ts"
click node_admin "https://github.com/matifl3/tpvetcare/tree/main/PetCare/frontend/src/app/pages/admin"
click node_reports "https://github.com/matifl3/tpvetcare/tree/main/PetCare/frontend/src/app/pages/admin/reportes"
click node_reportservice "https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/services/reporte.service.ts"
click node_models "https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/core/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_dashboard,node_auth,node_login,node_user toneBlue
class node_pets,node_booking,node_shop,node_cart,node_cards,node_purchasehistory toneAmber
class node_clinical,node_patients,node_training,node_backend toneMint
class node_admin,node_reports toneRose
class node_api,node_petservice,node_turnos,node_productservice,node_clinicalservice,node_trainingservice,node_reportservice,node_models toneIndigo
```

## Components

### Application Core

- [App routes](https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/app.routes.ts): `PetCare/frontend/src/app/app.routes.ts`
- [Dashboard shell](https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/layout/dashboard/dashboard.component.ts): `PetCare/frontend/src/app/layout/dashboard/dashboard.component.ts`
- [Authentication](https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/core/auth.service.ts): `PetCare/frontend/src/app/core/auth.service.ts`
- [Login and registration](https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/pages/login/login.component.ts): `PetCare/frontend/src/app/pages/login/login.component.ts`

### Owner Services

- [Owner pet management](https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/pages/cliente/mascotas/mascotas-page.component.ts): `PetCare/frontend/src/app/pages/cliente/mascotas/mascotas-page.component.ts`
- [Appointment booking](https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/pages/cliente/reservar-turno/reservar-turno-page.component.ts): `PetCare/frontend/src/app/pages/cliente/reservar-turno/reservar-turno-page.component.ts`
- [Product browsing](https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/pages/cliente/tienda/tienda-page.component.ts): `PetCare/frontend/src/app/pages/cliente/tienda/tienda-page.component.ts`
- [Shopping cart and purchase](https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/services/carrito.service.ts): `PetCare/frontend/src/app/services/carrito.service.ts`
- [Payment cards](https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/services/tarjeta.service.ts): `PetCare/frontend/src/app/services/tarjeta.service.ts`
- [Purchase history](https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/pages/cliente/carrito/carrito-historial/carrito-historial.component.ts): `PetCare/frontend/src/app/pages/cliente/carrito/carrito-historial/carrito-historial.component.ts`

### Professional Care

- [Clinical record page](https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/pages/profesional/historial-clinico/historial-clinico-profesional-page.component.ts): `PetCare/frontend/src/app/pages/profesional/historial-clinico/historial-clinico-profesional-page.component.ts`
- [Patient management](https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/pages/profesional/mis-pacientes/mis-pacientes-profesional-page.component.ts): `PetCare/frontend/src/app/pages/profesional/mis-pacientes/mis-pacientes-profesional-page.component.ts`
- [Training progress](https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/pages/seguimiento/seguimiento-page.component.ts): `PetCare/frontend/src/app/pages/seguimiento/seguimiento-page.component.ts`

### Administration

- [Administrative operations](https://github.com/matifl3/tpvetcare/tree/main/PetCare/frontend/src/app/pages/admin): `PetCare/frontend/src/app/pages/admin`
- [Sales and profit reports](https://github.com/matifl3/tpvetcare/tree/main/PetCare/frontend/src/app/pages/admin/reportes): `PetCare/frontend/src/app/pages/admin/reportes`

### Shared API Layer

- [HTTP client](https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/core/api.service.ts): `PetCare/frontend/src/app/core/api.service.ts`
- [Pet API service](https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/services/mascota.service.ts): `PetCare/frontend/src/app/services/mascota.service.ts`
- [Appointment service](https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/services/turno.service.ts): `PetCare/frontend/src/app/services/turno.service.ts`
- [Product service](https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/services/producto.service.ts): `PetCare/frontend/src/app/services/producto.service.ts`
- [Clinical record service](https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/services/historial-clinico.service.ts): `PetCare/frontend/src/app/services/historial-clinico.service.ts`
- [Progress service](https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/services/seguimiento.service.ts): `PetCare/frontend/src/app/services/seguimiento.service.ts`
- [Reporting service](https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/services/reporte.service.ts): `PetCare/frontend/src/app/services/reporte.service.ts`
- [Shared domain models](https://github.com/matifl3/tpvetcare/blob/main/PetCare/frontend/src/app/core/models.ts): `PetCare/frontend/src/app/core/models.ts`

### Other components

- **PetCare user**
- **Spring Boot API**

## Connections

- PetCare user → Login and registration: signs in
- Login and registration → Authentication: submits credentials (evidence: `PetCare/frontend/src/app/pages/login/login.component.ts`)
- Authentication → HTTP client: sends requests (evidence: `PetCare/frontend/src/app/core/auth.service.ts`)
- App routes → Login and registration: routes to (evidence: `PetCare/frontend/src/app/app.routes.ts`)
- App routes → Dashboard shell: routes to (evidence: `PetCare/frontend/src/app/app.routes.ts`)
- Dashboard shell → Authentication: checks session (evidence: `PetCare/frontend/src/app/layout/dashboard/dashboard.component.ts`)
- PetCare user → Dashboard shell: opens workspace
- Owner pet management → Pet API service: manages pets (evidence: `PetCare/frontend/src/app/pages/cliente/mascotas/mascotas-page.component.ts`)
- Appointment booking → Pet API service: loads pets (evidence: `PetCare/frontend/src/app/pages/cliente/reservar-turno/reservar-turno-page.component.ts`)
- Appointment booking → Appointment service: requests appointment (evidence: `PetCare/frontend/src/app/pages/cliente/reservar-turno/reservar-turno-page.component.ts`)
- Product browsing → Product service: loads products (evidence: `PetCare/frontend/src/app/pages/cliente/tienda/tienda-page.component.ts`)
- Product browsing → Shopping cart and purchase: adds products (evidence: `PetCare/frontend/src/app/pages/cliente/tienda/tienda-page.component.ts`)
- Purchase history → Shopping cart and purchase: loads history
- Clinical record page → Pet API service: loads patient (evidence: `PetCare/frontend/src/app/pages/profesional/historial-clinico/historial-clinico-profesional-page.component.ts`)
- Clinical record page → Clinical record service: reads and updates (evidence: `PetCare/frontend/src/app/pages/profesional/historial-clinico/historial-clinico-profesional-page.component.ts`)
- Patient management → Pet API service: lists patients (evidence: `PetCare/frontend/src/app/pages/profesional/mis-pacientes/mis-pacientes-profesional-page.component.ts`)
- Training progress → Progress service: manages progress (evidence: `PetCare/frontend/src/app/pages/seguimiento/seguimiento-page.component.ts`)
- Administrative operations → Reporting service: requests reports
- Sales and profit reports → Reporting service: loads reports
- Pet API service → HTTP client: calls (evidence: `PetCare/frontend/src/app/services/mascota.service.ts`)
- Appointment service → HTTP client: calls (evidence: `PetCare/frontend/src/app/services/turno.service.ts`)
- Shopping cart and purchase → HTTP client: calls (evidence: `PetCare/frontend/src/app/services/carrito.service.ts`)
- Product service → HTTP client: calls (evidence: `PetCare/frontend/src/app/services/producto.service.ts`)
- Payment cards → HTTP client: calls
- Clinical record service → HTTP client: calls (evidence: `PetCare/frontend/src/app/services/historial-clinico.service.ts`)
- Progress service → HTTP client: calls
- Reporting service → HTTP client: calls (evidence: `PetCare/frontend/src/app/services/reporte.service.ts`)
- HTTP client → Spring Boot API: sends HTTP (evidence: `PetCare/frontend/src/app/core/api.service.ts`)
- Authentication → Spring Boot API: authenticates (evidence: `PetCare/frontend/src/app/core/auth.service.ts`)
