# davidalcrca/proyectofinalprogramacionweb architecture

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

- Interactive diagram: https://gitdiagram.com/davidalcrca/proyectofinalprogramacionweb
- Repository: https://github.com/davidalcrca/proyectofinalprogramacionweb

## Overview

Orígenes SV is a restaurant operations ERP. Staff sign in, select a branch, and use the workspace pages to manage sales, invoices, inventory and recipes, purchasing, cash, payroll, and security. Requests pass through the frontend API to the backend routes and domain services, which persist operational state in PostgreSQL. The graph preserves capabilities present in the application navigation and source tree; several backend route and service implementations were not excerpted, so their internal links are omitted or marked unverified.

Main entry points: [`origenes-sv/Frontend/src/App.jsx`](https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Frontend/src/App.jsx) (Workspace and navigation), [`origenes-sv/Frontend/src/api/api.js`](https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Frontend/src/api/api.js) (Frontend API client), [`origenes-sv/Backend/src/services`](https://github.com/davidalcrca/proyectofinalprogramacionweb/tree/main/origenes-sv/Backend/src/services) (Operational services), [`origenes-sv/Frontend/src/pages/Dashboard/Dashboard.jsx`](https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Frontend/src/pages/Dashboard/Dashboard.jsx) (Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Workspace"]
  node_workspace_app["Workspace and navigation<br/>[App.jsx]"]
  node_workspace_context["Branch context"]
  node_client_api["Frontend API client<br/>[api.js]"]
end

subgraph group_operations["Restaurant operations"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_point_sale["Point of sale<br/>[Pos.jsx]"]
  node_invoices["Sales invoices<br/>[Invoices.jsx]"]
  node_inventory["Inventory<br/>[Inventory.jsx]"]
  node_recipes["Product recipes<br/>[ProductRecipe.jsx]"]
  node_purchases["Purchases and suppliers<br/>[Purchases.jsx]"]
  node_cash["Cash and shifts<br/>[Cash.jsx]"]
  node_payroll["Staff and payroll<br/>[Payroll.jsx]"]
  node_security["Security settings<br/>[Security.jsx]"]
end

subgraph group_backend["Backend API"]
  node_backend_app["HTTP application<br/>[app.js]"]
  node_route_registry["API route registry<br/>[index.js]"]
  node_domain_routes["Operational routes"]
  node_domain_controllers["Operational controllers"]
  node_domain_services["Operational services"]
  node_domain_rules["Domain rules<br/>[domain.js]"]
end

subgraph group_platform["Identity and persistence"]
  node_auth_controller["Authentication controller<br/>[authController.js]"]
  node_auth_service["Authentication service<br/>[authService.js]"]
  node_database[("PostgreSQL<br/>[db.js]")]
end

node_staff(("Restaurant staff"))

node_staff -->|"uses"| node_workspace_app
node_workspace_app -->|"provides context"| node_workspace_context
node_workspace_app -->|"routes to"| node_dashboard
node_workspace_app -->|"routes to"| node_point_sale
node_workspace_app -->|"routes to"| node_invoices
node_workspace_app -->|"routes to"| node_inventory
node_workspace_app -->|"routes to"| node_recipes
node_workspace_app -->|"routes to"| node_purchases
node_workspace_app -->|"routes to"| node_cash
node_workspace_app -->|"routes to"| node_payroll
node_workspace_app -->|"routes to"| node_security
node_workspace_app -->|"calls"| node_client_api
node_dashboard -->|"calls"| node_client_api
node_point_sale -->|"calls"| node_client_api
node_invoices -->|"calls"| node_client_api
node_inventory -->|"calls"| node_client_api
node_recipes -->|"calls"| node_client_api
node_purchases -->|"calls"| node_client_api
node_cash -->|"calls"| node_client_api
node_payroll -->|"calls"| node_client_api
node_security -->|"calls"| node_client_api
node_client_api -->|"HTTP requests"| node_backend_app
node_backend_app -->|"mounts routes"| node_route_registry
node_route_registry -->|"mounts routes"| node_domain_routes
node_domain_routes -.->|"dispatches"| node_domain_controllers
node_domain_controllers -.->|"delegates to"| node_domain_services
node_auth_controller -->|"calls"| node_auth_service
node_auth_service -->|"queries"| node_database
node_domain_services -.->|"persists data"| node_database
node_domain_services -.->|"uses rules"| node_domain_rules

click node_workspace_app "https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Frontend/src/App.jsx"
click node_workspace_context "https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Frontend/src/context/WorkspaceContext.js"
click node_client_api "https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Frontend/src/api/api.js"
click node_dashboard "https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Frontend/src/pages/Dashboard/Dashboard.jsx"
click node_point_sale "https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Frontend/src/pages/Pos/Pos.jsx"
click node_invoices "https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Frontend/src/pages/Invoices/Invoices.jsx"
click node_inventory "https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Frontend/src/pages/Inventory/Inventory.jsx"
click node_recipes "https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Frontend/src/pages/ProductRecipe/ProductRecipe.jsx"
click node_purchases "https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Frontend/src/pages/Purchases/Purchases.jsx"
click node_cash "https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Frontend/src/pages/Cash/Cash.jsx"
click node_payroll "https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Frontend/src/pages/Payroll/Payroll.jsx"
click node_security "https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Frontend/src/pages/Security/Security.jsx"
click node_backend_app "https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Backend/src/app.js"
click node_route_registry "https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Backend/src/routes/index.js"
click node_domain_routes "https://github.com/davidalcrca/proyectofinalprogramacionweb/tree/main/origenes-sv/Backend/src/routes"
click node_domain_controllers "https://github.com/davidalcrca/proyectofinalprogramacionweb/tree/main/origenes-sv/Backend/src/controllers"
click node_domain_services "https://github.com/davidalcrca/proyectofinalprogramacionweb/tree/main/origenes-sv/Backend/src/services"
click node_domain_rules "https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Backend/src/domain/domain.js"
click node_auth_controller "https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Backend/src/controllers/authController.js"
click node_auth_service "https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Backend/src/services/authService.js"
click node_database "https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Backend/src/config/db.js"

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_workspace_app,node_workspace_context,node_client_api toneBlue
class node_dashboard,node_point_sale,node_invoices,node_inventory,node_recipes,node_purchases,node_cash,node_payroll,node_security toneAmber
class node_backend_app,node_route_registry,node_domain_routes,node_domain_controllers,node_domain_services,node_domain_rules toneMint
class node_auth_controller,node_auth_service,node_database toneRose
class node_staff toneIndigo
```

## Components

### Workspace

- [Workspace and navigation](https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Frontend/src/App.jsx): `origenes-sv/Frontend/src/App.jsx`
- [Branch context](https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Frontend/src/context/WorkspaceContext.js): `origenes-sv/Frontend/src/context/WorkspaceContext.js`
- [Frontend API client](https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Frontend/src/api/api.js): `origenes-sv/Frontend/src/api/api.js`

### Restaurant operations

- [Dashboard](https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Frontend/src/pages/Dashboard/Dashboard.jsx): `origenes-sv/Frontend/src/pages/Dashboard/Dashboard.jsx`
- [Point of sale](https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Frontend/src/pages/Pos/Pos.jsx): `origenes-sv/Frontend/src/pages/Pos/Pos.jsx`
- [Sales invoices](https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Frontend/src/pages/Invoices/Invoices.jsx): `origenes-sv/Frontend/src/pages/Invoices/Invoices.jsx`
- [Inventory](https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Frontend/src/pages/Inventory/Inventory.jsx): `origenes-sv/Frontend/src/pages/Inventory/Inventory.jsx`
- [Product recipes](https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Frontend/src/pages/ProductRecipe/ProductRecipe.jsx): `origenes-sv/Frontend/src/pages/ProductRecipe/ProductRecipe.jsx`
- [Purchases and suppliers](https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Frontend/src/pages/Purchases/Purchases.jsx): `origenes-sv/Frontend/src/pages/Purchases/Purchases.jsx`
- [Cash and shifts](https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Frontend/src/pages/Cash/Cash.jsx): `origenes-sv/Frontend/src/pages/Cash/Cash.jsx`
- [Staff and payroll](https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Frontend/src/pages/Payroll/Payroll.jsx): `origenes-sv/Frontend/src/pages/Payroll/Payroll.jsx`
- [Security settings](https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Frontend/src/pages/Security/Security.jsx): `origenes-sv/Frontend/src/pages/Security/Security.jsx`

### Backend API

- [HTTP application](https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Backend/src/app.js): `origenes-sv/Backend/src/app.js`
- [API route registry](https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Backend/src/routes/index.js): `origenes-sv/Backend/src/routes/index.js`
- [Operational routes](https://github.com/davidalcrca/proyectofinalprogramacionweb/tree/main/origenes-sv/Backend/src/routes): `origenes-sv/Backend/src/routes`
- [Operational controllers](https://github.com/davidalcrca/proyectofinalprogramacionweb/tree/main/origenes-sv/Backend/src/controllers): `origenes-sv/Backend/src/controllers`
- [Operational services](https://github.com/davidalcrca/proyectofinalprogramacionweb/tree/main/origenes-sv/Backend/src/services): `origenes-sv/Backend/src/services`
- [Domain rules](https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Backend/src/domain/domain.js): `origenes-sv/Backend/src/domain/domain.js`

### Identity and persistence

- [Authentication controller](https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Backend/src/controllers/authController.js): `origenes-sv/Backend/src/controllers/authController.js`
- [Authentication service](https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Backend/src/services/authService.js): `origenes-sv/Backend/src/services/authService.js`
- [PostgreSQL](https://github.com/davidalcrca/proyectofinalprogramacionweb/blob/main/origenes-sv/Backend/src/config/db.js): `origenes-sv/Backend/src/config/db.js`

### Other components

- **Restaurant staff**

## Connections

- Restaurant staff → Workspace and navigation: uses (evidence: `origenes-sv/Frontend/src/App.jsx`)
- Workspace and navigation → Branch context: provides context (evidence: `origenes-sv/Frontend/src/App.jsx`)
- Workspace and navigation → Dashboard: routes to (evidence: `origenes-sv/Frontend/src/App.jsx`)
- Workspace and navigation → Point of sale: routes to (evidence: `origenes-sv/Frontend/src/App.jsx`)
- Workspace and navigation → Sales invoices: routes to (evidence: `origenes-sv/Frontend/src/App.jsx`)
- Workspace and navigation → Inventory: routes to (evidence: `origenes-sv/Frontend/src/App.jsx`)
- Workspace and navigation → Product recipes: routes to (evidence: `origenes-sv/Frontend/src/App.jsx`)
- Workspace and navigation → Purchases and suppliers: routes to (evidence: `origenes-sv/Frontend/src/App.jsx`)
- Workspace and navigation → Cash and shifts: routes to (evidence: `origenes-sv/Frontend/src/App.jsx`)
- Workspace and navigation → Staff and payroll: routes to (evidence: `origenes-sv/Frontend/src/App.jsx`)
- Workspace and navigation → Security settings: routes to (evidence: `origenes-sv/Frontend/src/App.jsx`)
- Workspace and navigation → Frontend API client: calls (evidence: `origenes-sv/Frontend/src/App.jsx`)
- Dashboard → Frontend API client: calls (evidence: `origenes-sv/Frontend/src/pages/Dashboard/Dashboard.jsx`)
- Point of sale → Frontend API client: calls (evidence: `origenes-sv/Frontend/src/pages/Pos/Pos.jsx`)
- Sales invoices → Frontend API client: calls (evidence: `origenes-sv/Frontend/src/pages/Invoices/Invoices.jsx`)
- Inventory → Frontend API client: calls (evidence: `origenes-sv/Frontend/src/pages/Inventory/Inventory.jsx`)
- Product recipes → Frontend API client: calls (evidence: `origenes-sv/Frontend/src/pages/ProductRecipe/ProductRecipe.jsx`)
- Purchases and suppliers → Frontend API client: calls (evidence: `origenes-sv/Frontend/src/pages/Purchases/Purchases.jsx`)
- Cash and shifts → Frontend API client: calls (evidence: `origenes-sv/Frontend/src/pages/Cash/Cash.jsx`)
- Staff and payroll → Frontend API client: calls (evidence: `origenes-sv/Frontend/src/pages/Payroll/Payroll.jsx`)
- Security settings → Frontend API client: calls (evidence: `origenes-sv/Frontend/src/pages/Security/Security.jsx`)
- Frontend API client → HTTP application: HTTP requests (evidence: `origenes-sv/Frontend/src/api/api.js`)
- HTTP application → API route registry: mounts routes (evidence: `origenes-sv/Backend/src/app.js`)
- API route registry → Operational routes: mounts routes (evidence: `origenes-sv/Backend/src/routes/index.js`)
- Operational routes → Operational controllers: dispatches (evidence: `origenes-sv/Backend/src/routes/employee.routes.js`)
- Operational controllers → Operational services: delegates to (evidence: `origenes-sv/Backend/src/controllers/authController.js`)
- Authentication controller → Authentication service: calls (evidence: `origenes-sv/Backend/src/controllers/authController.js`)
- Authentication service → PostgreSQL: queries (evidence: `origenes-sv/Backend/src/services/authService.js`)
- Operational services → PostgreSQL: persists data (evidence: `origenes-sv/Backend/src/services/authService.js`)
- Operational services → Domain rules: uses rules (evidence: `origenes-sv/Backend/src/services/saleService.js`)
