How manuelrisco/sigplast-transferencia-almacenes works
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: app.ts Application shell · base-api.service.ts API client boundary · movimientos.php ERP resource endpoints · app.routes.ts Client routes
Components 20
Angular frontend
Single-page application and client request layer.
- Angular bootstrap
frontend/src/main.ts - Application shell · Combines routed content with persistent navigation.
frontend/src/app/app.ts - Runtime providers
frontend/src/app/app.config.ts - Client routes
frontend/src/app/app.routes.ts - Navigation UI
frontend/src/app/components/navbar/navbar.component.ts - Route protection
frontend/src/app/guards/auth.guard.ts - Login UI
frontend/src/app/components/login/login.component.ts - Authentication client
frontend/src/app/services/auth.service.ts - API client boundary · Applies common API behavior and attached credentials.
frontend/src/app/services/base-api.service.ts - API contracts
frontend/src/app/models/api.models.ts - ERP domain clients · Article and transfer calls are isolated from UI components.
frontend/src/app/services/articulos.service.ts - Movement workflows · Browsing movements and creating records.
frontend/src/app/components/movimientos/movimientos.component.ts - Accessibility preferences
frontend/src/app/services/accessibility.service.ts
PHP backend
Endpoint-oriented API and ERP persistence boundary.
- Login endpoint
backend/api/auth/login.php - ERP resource endpoints · Article, movement, and transfer resources.
backend/api/erp/movimientos.php - Backend security
backend/config/seguridad.php - ERP database · Reached through centralized PHP connectivity.
backend/config/conexion.php
Delivery
Development proxy and production hosting configuration.
- Development API proxy
frontend/proxy.conf.json - Angular build
frontend/angular.json - Apache hosting rules · Routes static SPA output and PHP backend access.
backend/.htaccess
Connections 22
- 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