# manuelrisco/sigplast-transferencia-almacenes architecture

> Architecture diagram of the GitHub repository manuelrisco/sigplast-transferencia-almacenes, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/manuelrisco/sigplast-transferencia-almacenes
- Repository: https://github.com/manuelrisco/sigplast-transferencia-almacenes

## Overview

#### Purpose and deployment shape
This repository is an ERP-facing inventory/movement application with an Angular single-page frontend and PHP HTTP API backend. The frontend is served as static Angular output; PHP endpoints and Apache rewrite/access settings are rooted under `backend/` and `frontend/public/.htaccess`.

#### Frontend bootstrap and application shell
Angular starts at `frontend/src/main.ts`, bootstraps the root application in `frontend/src/app/app.ts`, and obtains providers/runtime setup from `frontend/src/app/app.config.ts`. The shell combines route content with persistent navigation and UI behavior, including `frontend/src/app/components/navbar/navbar.component.ts` and `frontend/src/app/components/sidebar/sidebar.component.ts`.

#### Routing, authentication, and request boundary
Client navigation is declared in `frontend/src/app/app.routes.ts`. Protected routes are enforced by `frontend/src/app/guards/auth.guard.ts`; login is handled by `frontend/src/app/components/login/login.component.ts` through `frontend/src/app/services/auth.service.ts`. Authentication state/credentials are attached to outbound HTTP requests at the shared client boundary in `frontend/src/app/interceptors/auth.interceptor.ts`.

#### API client layer
Angular domain services centralize calls to the PHP API, with common API behavior in `frontend/src/app/services/base-api.service.ts` and typed payload contracts in `frontend/src/app/models/api.models.ts`. Inventory/article and transfer workflows are represented by `frontend/src/app/services/articulos.service.ts` and `frontend/src/app/services/transferencias.service.ts`, keeping UI components separated from endpoint details.

#### ERP operational workflows
The main application workflows are movement browsing and new-record creation: `frontend/src/app/components/movimientos/movimientos.component.ts` and `frontend/src/app/components/nuevo-registro/nuevo-registro.component.ts`. They consume article, cost-center, detail, movement, and transfer backend resources, including `backend/api/erp/articulos.php`, `backend/api/erp/movimientos.php`, and `backend/api/erp/transferencias.php`.

#### PHP API and persistence boundary
The backend exposes endpoint-oriented PHP APIs. Login enters through `backend/api/auth/login.php`; ERP endpoints live under `backend/api/erp/`. Database connectivity is centralized in `backend/config/conexion.php`, while backend security behavior is centralized in `backend/config/seguridad.php`. These files form the critical boundary between browser-originated requests and the ERP/database environment.

#### Supporting user experience and infrastructure
Accessibility and visual preferences are client-side concerns, implemented through `frontend/src/app/components/accessibility-widget/accessibility-widget.component.ts` and `frontend/src/app/services/accessibility.service.ts`. The Angular development environment can proxy API calls via `frontend/proxy.conf.json`; production delivery depends on Angular build configuration in `frontend/angular.json` and Apache/PHP hosting rules in `backend/.htaccess`.

Main entry points: [`frontend/src/app/app.ts`](https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/src/app/app.ts) (Application shell), [`frontend/src/app/services/base-api.service.ts`](https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/src/app/services/base-api.service.ts) (API client boundary), [`backend/api/erp/movimientos.php`](https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/backend/api/erp/movimientos.php) (ERP resource endpoints), [`frontend/src/app/app.routes.ts`](https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/src/app/app.routes.ts) (Client routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Angular frontend"]
  node_main(("Angular bootstrap<br/>entrypoint<br/>[main.ts]"))
  node_app["Application shell<br/>root component<br/>[app.ts]"]
  node_app_config["Runtime providers<br/>Angular config<br/>[app.config.ts]"]
  node_routes["Client routes<br/>routing<br/>[app.routes.ts]"]
  node_navigation["Navigation UI<br/>shell components"]
  node_auth_guard["Route protection<br/>route guard<br/>[auth.guard.ts]"]
  node_login["Login UI<br/>page component<br/>[login.component.ts]"]
  node_auth_service["Authentication client<br/>Angular service<br/>[auth.service.ts]"]
  node_http_boundary{{"API client boundary<br/>base service + interceptor"}}
  node_api_contracts["API contracts<br/>typed models<br/>[api.models.ts]"]
  node_domain_services["ERP domain clients<br/>Angular services"]
  node_workflows["Movement workflows<br/>page components"]
  node_accessibility["Accessibility preferences<br/>client UX service"]
end

subgraph group_backend["PHP backend"]
  node_login_api["Login endpoint<br/>PHP endpoint<br/>[login.php]"]
  node_erp_api["ERP resource endpoints<br/>PHP endpoints<br/>[movimientos.php]"]
  node_security{{"Backend security<br/>PHP security config<br/>[seguridad.php]"}}
  node_database[("ERP database<br/>persistence<br/>[conexion.php]")]
end

subgraph group_delivery["Delivery"]
  node_dev_proxy["Development API proxy<br/>proxy config<br/>[proxy.conf.json]"]
  node_angular_build["Angular build<br/>build config<br/>[angular.json]"]
  node_apache_rules["Apache hosting rules<br/>server config<br/>[.htaccess]"]
end

node_main -->|"bootstraps"| node_app
node_main -->|"loads providers"| node_app_config
node_app -->|"renders"| node_routes
node_app -->|"includes"| node_navigation
node_routes -->|"protects routes"| node_auth_guard
node_routes -->|"navigates to"| node_workflows
node_login -->|"authenticates through"| node_auth_service
node_auth_guard -->|"checks session"| node_auth_service
node_auth_service -->|"uses"| node_http_boundary
node_workflows -->|"uses"| node_domain_services
node_domain_services -->|"uses types"| node_api_contracts
node_domain_services -->|"sends requests through"| node_http_boundary
node_app -->|"supports preferences"| node_accessibility
node_http_boundary -->|"login requests"| node_login_api
node_http_boundary -->|"ERP requests"| node_erp_api
node_login_api -->|"enforces"| node_security
node_erp_api -->|"enforces"| node_security
node_login_api -->|"uses connection"| node_database
node_erp_api -->|"reads and writes"| node_database
node_dev_proxy -.->|"forwards local API calls"| node_http_boundary
node_angular_build -.->|"builds static SPA"| node_app
node_apache_rules -.->|"hosts API"| node_erp_api

click node_main "https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/src/main.ts"
click node_app "https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/src/app/app.ts"
click node_app_config "https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/src/app/app.config.ts"
click node_routes "https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/src/app/app.routes.ts"
click node_navigation "https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/src/app/components/navbar/navbar.component.ts"
click node_auth_guard "https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/src/app/guards/auth.guard.ts"
click node_login "https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/src/app/components/login/login.component.ts"
click node_auth_service "https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/src/app/services/auth.service.ts"
click node_http_boundary "https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/src/app/services/base-api.service.ts"
click node_api_contracts "https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/src/app/models/api.models.ts"
click node_domain_services "https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/src/app/services/articulos.service.ts"
click node_workflows "https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/src/app/components/movimientos/movimientos.component.ts"
click node_accessibility "https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/src/app/services/accessibility.service.ts"
click node_login_api "https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/backend/api/auth/login.php"
click node_erp_api "https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/backend/api/erp/movimientos.php"
click node_security "https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/backend/config/seguridad.php"
click node_database "https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/backend/config/conexion.php"
click node_dev_proxy "https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/proxy.conf.json"
click node_angular_build "https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/angular.json"
click node_apache_rules "https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/backend/.htaccess"

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_main,node_app,node_app_config,node_routes,node_navigation,node_auth_guard,node_login,node_auth_service,node_http_boundary,node_api_contracts,node_domain_services,node_workflows,node_accessibility toneBlue
class node_login_api,node_erp_api,node_security,node_database toneAmber
class node_dev_proxy,node_angular_build,node_apache_rules toneMint
```

## Components

### Angular frontend

Single-page application and client request layer.

- [Angular bootstrap](https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/src/main.ts): entrypoint · `frontend/src/main.ts`
- [Application shell](https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/src/app/app.ts): root component · Combines routed content with persistent navigation. · `frontend/src/app/app.ts`
- [Runtime providers](https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/src/app/app.config.ts): Angular config · `frontend/src/app/app.config.ts`
- [Client routes](https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/src/app/app.routes.ts): routing · `frontend/src/app/app.routes.ts`
- [Navigation UI](https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/src/app/components/navbar/navbar.component.ts): shell components · `frontend/src/app/components/navbar/navbar.component.ts`
- [Route protection](https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/src/app/guards/auth.guard.ts): route guard · `frontend/src/app/guards/auth.guard.ts`
- [Login UI](https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/src/app/components/login/login.component.ts): page component · `frontend/src/app/components/login/login.component.ts`
- [Authentication client](https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/src/app/services/auth.service.ts): Angular service · `frontend/src/app/services/auth.service.ts`
- [API client boundary](https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/src/app/services/base-api.service.ts): base service + interceptor · Applies common API behavior and attached credentials. · `frontend/src/app/services/base-api.service.ts`
- [API contracts](https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/src/app/models/api.models.ts): typed models · `frontend/src/app/models/api.models.ts`
- [ERP domain clients](https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/src/app/services/articulos.service.ts): Angular services · Article and transfer calls are isolated from UI components. · `frontend/src/app/services/articulos.service.ts`
- [Movement workflows](https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/src/app/components/movimientos/movimientos.component.ts): page components · Browsing movements and creating records. · `frontend/src/app/components/movimientos/movimientos.component.ts`
- [Accessibility preferences](https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/src/app/services/accessibility.service.ts): client UX service · `frontend/src/app/services/accessibility.service.ts`

### PHP backend

Endpoint-oriented API and ERP persistence boundary.

- [Login endpoint](https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/backend/api/auth/login.php): PHP endpoint · `backend/api/auth/login.php`
- [ERP resource endpoints](https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/backend/api/erp/movimientos.php): PHP endpoints · Article, movement, and transfer resources. · `backend/api/erp/movimientos.php`
- [Backend security](https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/backend/config/seguridad.php): PHP security config · `backend/config/seguridad.php`
- [ERP database](https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/backend/config/conexion.php): persistence · Reached through centralized PHP connectivity. · `backend/config/conexion.php`

### Delivery

Development proxy and production hosting configuration.

- [Development API proxy](https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/proxy.conf.json): proxy config · `frontend/proxy.conf.json`
- [Angular build](https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/frontend/angular.json): build config · `frontend/angular.json`
- [Apache hosting rules](https://github.com/manuelrisco/sigplast-transferencia-almacenes/blob/main/backend/.htaccess): server config · Routes static SPA output and PHP backend access. · `backend/.htaccess`

## Connections

- Angular bootstrap → Application shell: bootstraps
- Angular bootstrap → Runtime providers: loads providers
- Application shell → Client routes: renders
- Application shell → Navigation UI: includes
- Client routes → Route protection: protects routes
- Client routes → Movement workflows: navigates to
- Login UI → Authentication client: authenticates through
- Route protection → Authentication client: checks session
- Authentication client → API client boundary: uses
- Movement workflows → ERP domain clients: uses
- ERP domain clients → API contracts: uses types
- ERP domain clients → API client boundary: sends requests through
- Application shell → Accessibility preferences: supports preferences
- API client boundary → Login endpoint: login requests
- API client boundary → ERP resource endpoints: ERP requests
- Login endpoint → Backend security: enforces
- ERP resource endpoints → Backend security: enforces
- Login endpoint → ERP database: uses connection
- ERP resource endpoints → ERP database: reads and writes
- Development API proxy → API client boundary: forwards local API calls
- Angular build → Application shell: builds static SPA
- Apache hosting rules → ERP resource endpoints: hosts API
