# etson0987musuline/taller_mecanico_rujim architecture

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

- Interactive diagram: https://gitdiagram.com/etson0987musuline/taller_mecanico_rujim
- Repository: https://github.com/etson0987musuline/taller_mecanico_rujim

## Overview

This is a vehicle-repair shop management application: staff manage customers, vehicles, work orders, services, parts, sales and invoices, while customers can publicly check repair progress. The Angular frontend routes users to role-aware pages and services; an Express API handles domain operations and uses Supabase for persistence. The index supports many page-to-service and route-to-controller links, but the backend entrypoint and several route/controller implementations were not sampled, so frontend-to-API links are marked unverified.

Main entry points: [`taller-frontend/src/app/app.routes.ts`](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/app.routes.ts) (App routes), [`taller-backend/src/index.js`](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/index.js) (Backend API), [`taller-backend/src/config/supabase.js`](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/config/supabase.js) (Supabase data store), [`taller-backend/src/controllers/repuestos.controller.js`](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/controllers/repuestos.controller.js) (Parts inventory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_routing["App routes<br/>[app.routes.ts]"]
  node_auth_ui["Login and session<br/>[auth.service.ts]"]
  node_roles["Role permissions<br/>[rol.service.ts]"]
  node_customer_ui["Customer records<br/>[clientes.ts]"]
  node_vehicle_ui["Vehicle records<br/>[vehiculos.ts]"]
  node_order_ui["Work orders<br/>[ordenes.ts]"]
  node_mechanic_ui["Mechanic workspace<br/>[mecanico.ts]"]
  node_public_ui["Public tracking"]
  node_catalog_ui["Parts and services<br/>[repuestos.ts]"]
  node_sales_ui["Sales<br/>[ventas.ts]"]
  node_invoice_ui["Invoices<br/>[facturas.ts]"]
  node_users_ui["User administration<br/>[usuarios.ts]"]
  node_client_service["Customer API client"]
  node_vehicle_service["Vehicle API client"]
  node_order_service["Order API client<br/>[ordenes.service.ts]"]
  node_tracking_service["Tracking API client"]
end

subgraph group_backend["API and access"]
  node_api["Backend API<br/>[index.js]"]
  node_auth_api["Token authentication<br/>[auth.controller.js]"]
  node_auth_middleware["Authorization middleware<br/>[auth.middleware.js]"]
end

subgraph group_workshop["Workshop operations"]
  node_orders["Work order lifecycle"]
  node_parts["Parts inventory"]
  node_services["Service catalog"]
  node_tracking["Repair tracking"]
end

subgraph group_business["Business management"]
  node_customers["Customer operations"]
  node_vehicles["Vehicle operations"]
  node_sales["Sales processing"]
  node_invoices["Invoice operations"]
  node_users["User operations"]
  node_document_lookup["Document lookup"]
end

subgraph group_data["Persistence and files"]
  node_supabase[("Supabase data store<br/>[supabase.js]")]
  node_image_storage["Parts image storage<br/>[storage.js]"]
end

node_staff(("Staff"))
node_customer(("Public customer"))

node_staff -->|"uses"| node_routing
node_customer -->|"checks progress"| node_public_ui
node_routing -->|"routes login"| node_auth_ui
node_routing -->|"routes to"| node_customer_ui
node_routing -->|"routes to"| node_vehicle_ui
node_routing -->|"routes to"| node_order_ui
node_routing -->|"routes to"| node_mechanic_ui
node_routing -->|"routes to"| node_public_ui
node_routing -->|"routes to"| node_catalog_ui
node_routing -->|"routes to"| node_sales_ui
node_routing -->|"routes to"| node_invoice_ui
node_routing -->|"routes to"| node_users_ui
node_customer_ui -->|"calls"| node_client_service
node_vehicle_ui -->|"calls"| node_vehicle_service
node_order_ui -->|"calls"| node_order_service
node_public_ui -->|"calls"| node_tracking_service
node_sales_ui -->|"checks permissions"| node_roles
node_invoice_ui -.->|"checks permissions"| node_roles
node_users_ui -.->|"checks permissions"| node_roles
node_auth_ui -.->|"sends login request"| node_api
node_client_service -.->|"requests customer data"| node_api
node_vehicle_service -.->|"requests vehicle data"| node_api
node_order_service -.->|"requests order data"| node_api
node_tracking_service -.->|"requests tracking data"| node_api
node_api -.->|"dispatches auth"| node_auth_api
node_api -.->|"applies access checks"| node_auth_middleware
node_api -->|"dispatches customer routes"| node_customers
node_api -->|"dispatches order routes"| node_orders
node_api -->|"dispatches parts routes"| node_parts
node_customers -->|"reads and writes"| node_supabase
node_vehicles -->|"reads and writes"| node_supabase
node_orders -->|"reads and writes"| node_supabase
node_parts -->|"reads and writes"| node_supabase
node_invoices -->|"reads and writes"| node_supabase
node_parts -.->|"processes images"| node_image_storage
node_document_lookup -.->|"looks up documents"| node_customer

click node_routing "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/app.routes.ts"
click node_auth_ui "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/core/services/auth.service.ts"
click node_roles "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/core/services/rol.service.ts"
click node_customer_ui "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/pages/clientes/clientes.ts"
click node_vehicle_ui "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/pages/vehiculos/vehiculos.ts"
click node_order_ui "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/pages/ordenes/ordenes.ts"
click node_mechanic_ui "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/pages/mecanico/mecanico.ts"
click node_public_ui "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/pages/consulta-publica/consulta-publica.ts"
click node_catalog_ui "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/pages/repuestos/repuestos.ts"
click node_sales_ui "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/pages/ventas/ventas.ts"
click node_invoice_ui "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/pages/facturas/facturas.ts"
click node_users_ui "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/pages/usuarios/usuarios.ts"
click node_client_service "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/core/services/clientes.service.ts"
click node_vehicle_service "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/core/services/vehiculos.service.ts"
click node_order_service "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/core/services/ordenes.service.ts"
click node_tracking_service "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/core/services/seguimiento.service.ts"
click node_api "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/index.js"
click node_auth_api "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/controllers/auth.controller.js"
click node_auth_middleware "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/middlewares/auth.middleware.js"
click node_customers "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/controllers/clientes.controller.js"
click node_vehicles "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/controllers/vehiculos.controller.js"
click node_orders "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/controllers/ordenes.controller.js"
click node_parts "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/controllers/repuestos.controller.js"
click node_services "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/controllers/servicios.controller.js"
click node_tracking "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/controllers/seguimiento.controller.js"
click node_sales "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/controllers/ventas.controller.js"
click node_invoices "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/controllers/facturas.controller.js"
click node_users "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/controllers/usuarios.controller.js"
click node_document_lookup "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/routes/consulta-doc.routes.js"
click node_supabase "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/config/supabase.js"
click node_image_storage "https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/config/storage.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_routing,node_auth_ui,node_roles,node_customer_ui,node_vehicle_ui,node_order_ui,node_mechanic_ui,node_public_ui,node_catalog_ui,node_sales_ui,node_invoice_ui,node_users_ui,node_client_service,node_vehicle_service,node_order_service,node_tracking_service toneBlue
class node_api,node_auth_api,node_auth_middleware toneAmber
class node_orders,node_parts,node_services,node_tracking toneMint
class node_customers,node_vehicles,node_sales,node_invoices,node_users,node_document_lookup toneRose
class node_supabase,node_image_storage,node_staff,node_customer toneIndigo
```

## Components

### Web application

- [App routes](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/app.routes.ts): `taller-frontend/src/app/app.routes.ts`
- [Login and session](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/core/services/auth.service.ts): `taller-frontend/src/app/core/services/auth.service.ts`
- [Role permissions](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/core/services/rol.service.ts): `taller-frontend/src/app/core/services/rol.service.ts`
- [Customer records](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/pages/clientes/clientes.ts): `taller-frontend/src/app/pages/clientes/clientes.ts`
- [Vehicle records](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/pages/vehiculos/vehiculos.ts): `taller-frontend/src/app/pages/vehiculos/vehiculos.ts`
- [Work orders](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/pages/ordenes/ordenes.ts): `taller-frontend/src/app/pages/ordenes/ordenes.ts`
- [Mechanic workspace](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/pages/mecanico/mecanico.ts): `taller-frontend/src/app/pages/mecanico/mecanico.ts`
- [Public tracking](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/pages/consulta-publica/consulta-publica.ts): `taller-frontend/src/app/pages/consulta-publica/consulta-publica.ts`
- [Parts and services](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/pages/repuestos/repuestos.ts): `taller-frontend/src/app/pages/repuestos/repuestos.ts`
- [Sales](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/pages/ventas/ventas.ts): `taller-frontend/src/app/pages/ventas/ventas.ts`
- [Invoices](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/pages/facturas/facturas.ts): `taller-frontend/src/app/pages/facturas/facturas.ts`
- [User administration](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/pages/usuarios/usuarios.ts): `taller-frontend/src/app/pages/usuarios/usuarios.ts`
- [Customer API client](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/core/services/clientes.service.ts): `taller-frontend/src/app/core/services/clientes.service.ts`
- [Vehicle API client](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/core/services/vehiculos.service.ts): `taller-frontend/src/app/core/services/vehiculos.service.ts`
- [Order API client](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/core/services/ordenes.service.ts): `taller-frontend/src/app/core/services/ordenes.service.ts`
- [Tracking API client](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-frontend/src/app/core/services/seguimiento.service.ts): `taller-frontend/src/app/core/services/seguimiento.service.ts`

### API and access

- [Backend API](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/index.js): `taller-backend/src/index.js`
- [Token authentication](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/controllers/auth.controller.js): `taller-backend/src/controllers/auth.controller.js`
- [Authorization middleware](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/middlewares/auth.middleware.js): `taller-backend/src/middlewares/auth.middleware.js`

### Workshop operations

- [Work order lifecycle](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/controllers/ordenes.controller.js): `taller-backend/src/controllers/ordenes.controller.js`
- [Parts inventory](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/controllers/repuestos.controller.js): `taller-backend/src/controllers/repuestos.controller.js`
- [Service catalog](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/controllers/servicios.controller.js): `taller-backend/src/controllers/servicios.controller.js`
- [Repair tracking](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/controllers/seguimiento.controller.js): `taller-backend/src/controllers/seguimiento.controller.js`

### Business management

- [Customer operations](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/controllers/clientes.controller.js): `taller-backend/src/controllers/clientes.controller.js`
- [Vehicle operations](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/controllers/vehiculos.controller.js): `taller-backend/src/controllers/vehiculos.controller.js`
- [Sales processing](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/controllers/ventas.controller.js): `taller-backend/src/controllers/ventas.controller.js`
- [Invoice operations](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/controllers/facturas.controller.js): `taller-backend/src/controllers/facturas.controller.js`
- [User operations](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/controllers/usuarios.controller.js): `taller-backend/src/controllers/usuarios.controller.js`
- [Document lookup](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/routes/consulta-doc.routes.js): `taller-backend/src/routes/consulta-doc.routes.js`

### Persistence and files

- [Supabase data store](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/config/supabase.js): `taller-backend/src/config/supabase.js`
- [Parts image storage](https://github.com/etson0987musuline/taller_mecanico_rujim/blob/main/taller-backend/src/config/storage.js): `taller-backend/src/config/storage.js`

### Other components

- **Staff**
- **Public customer**

## Connections

- Staff → App routes: uses (evidence: `taller-frontend/src/app/app.routes.ts`)
- Public customer → Public tracking: checks progress
- App routes → Login and session: routes login (evidence: `taller-frontend/src/app/app.routes.ts`)
- App routes → Customer records: routes to (evidence: `taller-frontend/src/app/app.routes.ts`)
- App routes → Vehicle records: routes to (evidence: `taller-frontend/src/app/app.routes.ts`)
- App routes → Work orders: routes to (evidence: `taller-frontend/src/app/app.routes.ts`)
- App routes → Mechanic workspace: routes to (evidence: `taller-frontend/src/app/app.routes.ts`)
- App routes → Public tracking: routes to (evidence: `taller-frontend/src/app/app.routes.ts`)
- App routes → Parts and services: routes to (evidence: `taller-frontend/src/app/app.routes.ts`)
- App routes → Sales: routes to (evidence: `taller-frontend/src/app/app.routes.ts`)
- App routes → Invoices: routes to (evidence: `taller-frontend/src/app/app.routes.ts`)
- App routes → User administration: routes to (evidence: `taller-frontend/src/app/app.routes.ts`)
- Customer records → Customer API client: calls (evidence: `taller-frontend/src/app/pages/clientes/clientes.ts`)
- Vehicle records → Vehicle API client: calls (evidence: `taller-frontend/src/app/pages/vehiculos/vehiculos.ts`)
- Work orders → Order API client: calls (evidence: `taller-frontend/src/app/pages/ordenes/ordenes.ts`)
- Public tracking → Tracking API client: calls (evidence: `taller-frontend/src/app/pages/consulta-publica/consulta-publica.ts`)
- Sales → Role permissions: checks permissions (evidence: `taller-frontend/src/app/pages/ventas/ventas.ts`)
- Invoices → Role permissions: checks permissions
- User administration → Role permissions: checks permissions
- Login and session → Backend API: sends login request
- Customer API client → Backend API: requests customer data
- Vehicle API client → Backend API: requests vehicle data
- Order API client → Backend API: requests order data
- Tracking API client → Backend API: requests tracking data
- Backend API → Token authentication: dispatches auth
- Backend API → Authorization middleware: applies access checks
- Backend API → Customer operations: dispatches customer routes
- Backend API → Work order lifecycle: dispatches order routes
- Backend API → Parts inventory: dispatches parts routes
- Customer operations → Supabase data store: reads and writes (evidence: `taller-backend/src/controllers/clientes.controller.js`)
- Vehicle operations → Supabase data store: reads and writes (evidence: `taller-backend/src/controllers/vehiculos.controller.js`)
- Work order lifecycle → Supabase data store: reads and writes (evidence: `taller-backend/src/controllers/ordenes.controller.js`)
- Parts inventory → Supabase data store: reads and writes (evidence: `taller-backend/src/controllers/repuestos.controller.js`)
- Invoice operations → Supabase data store: reads and writes (evidence: `taller-backend/src/controllers/facturas.controller.js`)
- Parts inventory → Parts image storage: processes images
- Document lookup → Public customer: looks up documents
