# rosauracotos/pedidofronted architecture

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

- Interactive diagram: https://gitdiagram.com/rosauracotos/pedidofronted
- Repository: https://github.com/rosauracotos/pedidofronted

## Overview

1. **Overall shape**
   - This is an **Angular 17 single-page application** named `Pedidofronted`.
   - The architecture is classic Angular: a root app module and router, feature components for screens, shared services for cross-cutting concerns, DTO/model types for API contracts, and an HTTP interceptor for request-wide behavior.

2. **UI shell and navigation**
   - The top-level app lives in `app.component.*` and `app-routing.module.ts`.
   - The shell likely combines the main layout pieces: `menu`, `aside`, and routed content such as `inicio`, `login`, `pedido`, `operario`, and `vehiculo`.
   - This means navigation is route-driven, with the shell persisting while feature views swap in/out.

3. **Feature domains**
   - The repository is organized around a few clear business areas:
     - **Pedidos**: `pedido` and `pedido-formulario`
     - **Operarios**: `operario` and `operario-formulario`
     - **Vehículos**: `vehiculo`
     - **Authentication**: `login`
     - **Landing/home**: `inicio`
   - This suggests a back-office/admin style app for managing orders, operators, and vehicles.

4. **Forms vs. list/detail views**
   - Each domain appears split into a **listing/management component** and, where needed, a **form component**.
   - Examples:
     - `pedido` plus `pedido-formulario`
     - `operario` plus `operario-formulario`
     - `vehiculo` with a specialized create dialog
   - That separation is important for diagramming: list pages likely fetch data and trigger modals/forms; form components handle create/edit workflows.

5. **Dialog-driven interactions**
   - `confirm-dialog` and `create-vehiculo-dialog` indicate the app uses **modal dialogs** for user confirmation and entity creation.
   - These are not separate route pages; they are interaction overlays invoked from feature screens.
   - In the architecture diagram, they should sit as UI helpers adjacent to the relevant domain screens.

6. **Backend integration layer**
   - API communication is isolated in `src/app/services/ApiBackendService/`.
   - There are at least two service entry points:
     - `api.backend.service.ts`
     - `apiBackendVehiculo.service.ts`
   - This suggests either domain-specific API clients or a split between general backend access and vehicle-specific endpoints.
   - These services are the main bridge between Angular components and the server-side backend.

7. **Cross-cutting HTTP behavior**
   - `loader.interceptor.ts` is a global HTTP interceptor.
   - Its role is likely to capture outgoing requests and toggle a loading state, so the UI can show a spinner or busy indicator consistently.
   - In a diagram, this sits between all `HttpClient` calls and the backend API.

8. **Authentication and session state**
   - Authentication is handled by `AuthService`, with persistence in `LocalStorageService`.
   - This points to a token/session model stored in the browser, likely used to keep the user logged in across refreshes.
   - `login` is the user entry point, while auth-related state is shared by the rest of the app through services rather than being managed directly inside components.

9. **Feedback and UX helpers**
   - `SweetAlertService` wraps alert/confirmation messaging, likely standardizing success/error/toast dialogs.
   - Together with the confirm dialog component, it forms the app’s user feedback layer.
   - This is a reusable UI boundary separate from business features.

10. **Shared domain types**
   - The `models` folder contains DTOs and types such as `OperarioDTO`, `PedidoDTO`, `ProductoDTO`, `TipoDocumento`, and `vehiculo.type`.
   - These define the contract between UI forms/services and backend payloads.
   - For architecture diagrams, these are the shared data shapes that flow through services and components.

11. **Utilities and validation**
   - `utils/utilidades.ts` and `utils/validatciones.util.ts` indicate shared helper functions and validation logic.
   - These likely support form validation and common transformations across multiple feature forms.
   - They are a utility boundary reused by the form-heavy parts of the app.

12. **Assets and configuration**
   - Static assets are under `src/assets/images`, with image handling abstracted via `AssetsService/image.service.ts`.
   - Environment-specific configuration lives in `src/environments/enviroment.ts`, which is typically where API base URLs and runtime settings are defined.
   - These are the main non-UI dependencies feeding the frontend at build/runtime.

13. **Runtime and tooling**
   - The app is built and run with the Angular CLI (`ng serve`, `ng build`, `ng test`), using TypeScript and standard Angular project structure.
   - No server code is present in this repo; the application is a frontend client that depends on an external backend API.

14. **Primary data flow**
   - User action in a feature component → component calls a domain service → service sends HTTP request to backend → interceptor handles global loading behavior → response returns to component → UI updates and feedback is shown via dialogs/alerts.
   - Authentication and local persistence sit alongside this flow, providing session continuity and access control state.

Main entry points: [`src/app/app-routing.module.ts`](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/app-routing.module.ts) (Routing), [`src/app/components/vehiculo/vehiculo.component.ts`](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/components/vehiculo/vehiculo.component.ts) (Vehiculo), [`src/app/app.component.ts`](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/app.component.ts) (App shell), [`src/app/components/pedido/pedido.component.ts`](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/components/pedido/pedido.component.ts) (Pedido)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_app["App shell"]
  node_app_module["App module<br/>Angular module<br/>[app.module.ts]"]
  node_app_routing["Routing<br/>Router config"]
  node_app_shell["App shell<br/>Root component<br/>[app.component.ts]"]
end

subgraph group_group_features["Features"]
  node_menu["Menu<br/>Nav component<br/>[menu.component.ts]"]
  node_aside["Aside<br/>Layout component<br/>[aside.component.ts]"]
  node_inicio["Inicio<br/>Landing view"]
  node_login["Login<br/>Auth view<br/>[login.component.ts]"]
  node_pedido["Pedido<br/>Orders view"]
  node_pedido_form["Pedido form<br/>Order form"]
  node_operario["Operario<br/>Workers view"]
  node_operario_form["Operario form<br/>Worker form"]
  node_vehiculo["Vehiculo<br/>Fleet view"]
  node_confirm_dialog["Confirm dialog<br/>Modal"]
  node_create_vehicle_dialog["Create vehicle<br/>Modal"]
end

subgraph group_group_services["Services"]
  node_api_backend["API backend<br/>Backend client"]
  node_api_vehicle["Vehicle API<br/>Backend client"]
  node_auth_service["Auth service<br/>Session service<br/>[auth.service.ts]"]
  node_local_storage["Local storage<br/>Persistence service"]
  node_sweet_alert["Alerts<br/>UX service"]
  node_image_service["Images<br/>Asset service<br/>[image.service.ts]"]
end

subgraph group_group_shared["Shared"]
  node_loader_interceptor["Loader<br/>HTTP interceptor"]
  node_pedido_dto["PedidoDTO<br/>[PedidoDTO.ts]"]
  node_operario_dto["OperarioDTO<br/>[OperarioDTO.ts]"]
  node_producto_dto["ProductoDTO<br/>[ProductoDTO.ts]"]
  node_tipo_documento["TipoDocumento<br/>Enum/type<br/>[TipoDocumento.ts]"]
  node_vehiculo_type["Vehiculo type<br/>[vehiculo.type.ts]"]
  node_utilidades["Utils<br/>Helpers<br/>[utilidades.ts]"]
  node_validaciones["Validations<br/>Helpers"]
  node_env["Environment<br/>Config<br/>[enviroment.ts]"]
end

node_app_module -->|"imports"| node_app_routing
node_app_module -->|"boots"| node_app_shell
node_app_module -->|"provides"| node_loader_interceptor
node_app_shell -->|"contains"| node_menu
node_app_shell -->|"contains"| node_aside
node_app_shell -->|"hosts"| node_app_routing
node_app_routing -->|"routes to"| node_inicio
node_app_routing -->|"routes to"| node_login
node_app_routing -->|"routes to"| node_pedido
node_app_routing -->|"routes to"| node_operario
node_app_routing -->|"routes to"| node_vehiculo
node_pedido -->|"opens"| node_pedido_form
node_operario -->|"opens"| node_operario_form
node_vehiculo -->|"opens"| node_create_vehicle_dialog
node_pedido -->|"uses"| node_confirm_dialog
node_operario -->|"uses"| node_confirm_dialog
node_vehiculo -->|"uses"| node_confirm_dialog
node_pedido -->|"calls"| node_api_backend
node_operario -->|"calls"| node_api_backend
node_vehiculo -->|"calls"| node_api_vehicle
node_login -->|"authenticates"| node_auth_service
node_auth_service -->|"persists"| node_local_storage
node_api_backend -->|"configures"| node_env
node_api_vehicle -->|"configures"| node_env
node_api_backend -->|"passes through"| node_loader_interceptor
node_api_vehicle -->|"passes through"| node_loader_interceptor
node_pedido_form -->|"binds"| node_pedido_dto
node_operario_form -->|"binds"| node_operario_dto
node_vehiculo -->|"binds"| node_vehiculo_type
node_pedido_form -->|"uses"| node_producto_dto
node_operario_form -->|"uses"| node_tipo_documento
node_pedido_form -->|"uses"| node_utilidades
node_operario_form -->|"uses"| node_validaciones
node_vehiculo -->|"uses"| node_image_service
node_inicio -->|"uses"| node_sweet_alert
node_login -->|"uses"| node_sweet_alert

click node_app_module "https://github.com/rosauracotos/pedidofronted/blob/master/src/app/app.module.ts"
click node_app_routing "https://github.com/rosauracotos/pedidofronted/blob/master/src/app/app-routing.module.ts"
click node_app_shell "https://github.com/rosauracotos/pedidofronted/blob/master/src/app/app.component.ts"
click node_menu "https://github.com/rosauracotos/pedidofronted/blob/master/src/app/components/menu/menu.component.ts"
click node_aside "https://github.com/rosauracotos/pedidofronted/blob/master/src/app/components/aside/aside.component.ts"
click node_inicio "https://github.com/rosauracotos/pedidofronted/blob/master/src/app/components/inicio/inicio.component.ts"
click node_login "https://github.com/rosauracotos/pedidofronted/blob/master/src/app/components/login/login.component.ts"
click node_pedido "https://github.com/rosauracotos/pedidofronted/blob/master/src/app/components/pedido/pedido.component.ts"
click node_pedido_form "https://github.com/rosauracotos/pedidofronted/blob/master/src/app/components/pedido-formulario/pedido-formulario.component.ts"
click node_operario "https://github.com/rosauracotos/pedidofronted/blob/master/src/app/components/operario/operario.component.ts"
click node_operario_form "https://github.com/rosauracotos/pedidofronted/blob/master/src/app/components/operario-formulario/operario-formulario.component.ts"
click node_vehiculo "https://github.com/rosauracotos/pedidofronted/blob/master/src/app/components/vehiculo/vehiculo.component.ts"
click node_confirm_dialog "https://github.com/rosauracotos/pedidofronted/blob/master/src/app/components/confirm-dialog/confirm-dialog.component.ts"
click node_create_vehicle_dialog "https://github.com/rosauracotos/pedidofronted/blob/master/src/app/components/create-vehiculo-dialog/create-confirm-dialog.component.ts"
click node_api_backend "https://github.com/rosauracotos/pedidofronted/blob/master/src/app/services/ApiBackendService/api.backend.service.ts"
click node_api_vehicle "https://github.com/rosauracotos/pedidofronted/blob/master/src/app/services/ApiBackendService/apiBackendVehiculo.service.ts"
click node_auth_service "https://github.com/rosauracotos/pedidofronted/blob/master/src/app/services/AuthService/auth.service.ts"
click node_local_storage "https://github.com/rosauracotos/pedidofronted/blob/master/src/app/services/LocalStorageService/local.storage.service.ts"
click node_sweet_alert "https://github.com/rosauracotos/pedidofronted/blob/master/src/app/services/SweetAlertService/sweet.alert.service.ts"
click node_image_service "https://github.com/rosauracotos/pedidofronted/blob/master/src/app/services/AssetsService/image.service.ts"
click node_loader_interceptor "https://github.com/rosauracotos/pedidofronted/blob/master/src/app/interceptors/loader.interceptor.ts"
click node_pedido_dto "https://github.com/rosauracotos/pedidofronted/blob/master/src/app/models/PedidoDTO.ts"
click node_operario_dto "https://github.com/rosauracotos/pedidofronted/blob/master/src/app/models/OperarioDTO.ts"
click node_producto_dto "https://github.com/rosauracotos/pedidofronted/blob/master/src/app/models/ProductoDTO.ts"
click node_tipo_documento "https://github.com/rosauracotos/pedidofronted/blob/master/src/app/models/TipoDocumento.ts"
click node_vehiculo_type "https://github.com/rosauracotos/pedidofronted/blob/master/src/app/models/vehiculo.type.ts"
click node_utilidades "https://github.com/rosauracotos/pedidofronted/blob/master/src/utils/utilidades.ts"
click node_validaciones "https://github.com/rosauracotos/pedidofronted/blob/master/src/utils/validatciones.util.ts"
click node_env "https://github.com/rosauracotos/pedidofronted/blob/master/src/environments/enviroment.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_app_module,node_app_routing,node_app_shell toneBlue
class node_menu,node_aside,node_inicio,node_login,node_pedido,node_pedido_form,node_operario,node_operario_form,node_vehiculo,node_confirm_dialog,node_create_vehicle_dialog toneAmber
class node_api_backend,node_api_vehicle,node_auth_service,node_local_storage,node_sweet_alert,node_image_service toneMint
class node_loader_interceptor,node_pedido_dto,node_operario_dto,node_producto_dto,node_tipo_documento,node_vehiculo_type,node_utilidades,node_validaciones,node_env toneRose
```

## Components

### App shell

Root module, routing, and persistent layout

- [App module](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/app.module.ts): Angular module · Root composition and dependency wiring · `src/app/app.module.ts`
- [Routing](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/app-routing.module.ts): Router config · Route table for the SPA · `src/app/app-routing.module.ts`
- [App shell](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/app.component.ts): Root component · Top-level layout and routed outlet · `src/app/app.component.ts`

### Features

Route-driven screens and dialogs

- [Menu](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/components/menu/menu.component.ts): Nav component · Primary navigation · `src/app/components/menu/menu.component.ts`
- [Aside](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/components/aside/aside.component.ts): Layout component · Persistent side panel · `src/app/components/aside/aside.component.ts`
- [Inicio](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/components/inicio/inicio.component.ts): Landing view · Home or dashboard entry screen · `src/app/components/inicio/inicio.component.ts`
- [Login](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/components/login/login.component.ts): Auth view · User sign-in screen · `src/app/components/login/login.component.ts`
- [Pedido](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/components/pedido/pedido.component.ts): Orders view · Order management screen · `src/app/components/pedido/pedido.component.ts`
- [Pedido form](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/components/pedido-formulario/pedido-formulario.component.ts): Order form · Create/edit order workflow · `src/app/components/pedido-formulario/pedido-formulario.component.ts`
- [Operario](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/components/operario/operario.component.ts): Workers view · Operator management screen · `src/app/components/operario/operario.component.ts`
- [Operario form](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/components/operario-formulario/operario-formulario.component.ts): Worker form · Create/edit operator workflow · `src/app/components/operario-formulario/operario-formulario.component.ts`
- [Vehiculo](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/components/vehiculo/vehiculo.component.ts): Fleet view · Vehicle management screen · `src/app/components/vehiculo/vehiculo.component.ts`
- [Confirm dialog](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/components/confirm-dialog/confirm-dialog.component.ts): Modal · Reusable confirmation overlay · `src/app/components/confirm-dialog/confirm-dialog.component.ts`
- [Create vehicle](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/components/create-vehiculo-dialog/create-confirm-dialog.component.ts): Modal · Vehicle creation dialog · `src/app/components/create-vehiculo-dialog/create-confirm-dialog.component.ts`

### Services

Backend access, auth, storage, alerts, and assets

- [API backend](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/services/ApiBackendService/api.backend.service.ts): Backend client · General HTTP service for domain data · `src/app/services/ApiBackendService/api.backend.service.ts`
- [Vehicle API](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/services/ApiBackendService/apiBackendVehiculo.service.ts): Backend client · Vehicle-specific HTTP service · `src/app/services/ApiBackendService/apiBackendVehiculo.service.ts`
- [Auth service](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/services/AuthService/auth.service.ts): Session service · Authentication and access state · `src/app/services/AuthService/auth.service.ts`
- [Local storage](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/services/LocalStorageService/local.storage.service.ts): Persistence service · Browser session persistence · `src/app/services/LocalStorageService/local.storage.service.ts`
- [Alerts](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/services/SweetAlertService/sweet.alert.service.ts): UX service · Shared success/error/confirm messaging · `src/app/services/SweetAlertService/sweet.alert.service.ts`
- [Images](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/services/AssetsService/image.service.ts): Asset service · Image and asset helper · `src/app/services/AssetsService/image.service.ts`

### Shared

DTOs, utilities, and cross-cutting HTTP behavior

- [Loader](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/interceptors/loader.interceptor.ts): HTTP interceptor · Global request loading behavior · `src/app/interceptors/loader.interceptor.ts`
- [PedidoDTO](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/models/PedidoDTO.ts): DTO · Order contract · `src/app/models/PedidoDTO.ts`
- [OperarioDTO](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/models/OperarioDTO.ts): DTO · Operator contract · `src/app/models/OperarioDTO.ts`
- [ProductoDTO](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/models/ProductoDTO.ts): DTO · Product contract · `src/app/models/ProductoDTO.ts`
- [TipoDocumento](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/models/TipoDocumento.ts): Enum/type · Document type contract · `src/app/models/TipoDocumento.ts`
- [Vehiculo type](https://github.com/rosauracotos/pedidofronted/blob/master/src/app/models/vehiculo.type.ts): Type · Vehicle contract · `src/app/models/vehiculo.type.ts`
- [Utils](https://github.com/rosauracotos/pedidofronted/blob/master/src/utils/utilidades.ts): Helpers · Shared transformations and helpers · `src/utils/utilidades.ts`
- [Validations](https://github.com/rosauracotos/pedidofronted/blob/master/src/utils/validatciones.util.ts): Helpers · Shared validation logic · `src/utils/validatciones.util.ts`
- [Environment](https://github.com/rosauracotos/pedidofronted/blob/master/src/environments/enviroment.ts): Config · Runtime configuration such as API base URLs · `src/environments/enviroment.ts`

## Connections

- App module → Routing: imports · Registers route configuration
- App module → App shell: boots · Declares root component
- App module → Loader: provides · Adds global HTTP behavior
- App shell → Menu: contains · Persistent navigation
- App shell → Aside: contains · Persistent layout panel
- App shell → Routing: hosts · Displays routed screens
- Routing → Inicio: routes to · Home route
- Routing → Login: routes to · Login route
- Routing → Pedido: routes to · Order management route
- Routing → Operario: routes to · Worker management route
- Routing → Vehiculo: routes to · Vehicle management route
- Pedido → Pedido form: opens · Create/edit order form
- Operario → Operario form: opens · Create/edit operator form
- Vehiculo → Create vehicle: opens · Vehicle creation dialog
- Pedido → Confirm dialog: uses · Deletion or approval confirmation
- Operario → Confirm dialog: uses · Deletion or approval confirmation
- Vehiculo → Confirm dialog: uses · Confirmation overlay
- Pedido → API backend: calls · Fetches and mutates orders
- Operario → API backend: calls · Fetches and mutates operators
- Vehiculo → Vehicle API: calls · Fetches and mutates vehicles
- Login → Auth service: authenticates · Submits credentials and session state
- Auth service → Local storage: persists · Stores token or user session
- API backend → Environment: configures · Uses runtime API settings
- Vehicle API → Environment: configures · Uses runtime API settings
- API backend → Loader: passes through · HTTP requests are intercepted globally
- Vehicle API → Loader: passes through · HTTP requests are intercepted globally
- Pedido form → PedidoDTO: binds · Order form model
- Operario form → OperarioDTO: binds · Operator form model
- Vehiculo → Vehiculo type: binds · Vehicle list/detail model
- Pedido form → ProductoDTO: uses · Product selection data
- Operario form → TipoDocumento: uses · Document type options
- Pedido form → Utils: uses · Shared helpers
- Operario form → Validations: uses · Shared validation rules
- Vehiculo → Images: uses · Image handling support
- Inicio → Alerts: uses · User feedback and notifications
- Login → Alerts: uses · Login feedback
