# haroldducon/reparacion_celular architecture

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

- Interactive diagram: https://gitdiagram.com/haroldducon/reparacion_celular
- Repository: https://github.com/haroldducon/reparacion_celular

## Overview

Tech Tinker is a repair-shop management application. Staff create and track repair orders through diagnosis, budgeting, repair, and delivery; customers can follow an order through a public tracking page. The frontend calls a NestJS API for authentication, order operations, reporting, and administration, backed by Prisma/Postgres and Redis. Reports can also be generated asynchronously, and order photos use Cloudinary when configured or local disk otherwise. The README is empty; relationships involving unsampled subsystems are included only when the source index documents them.

Main entry points: [`frontend/src/lib/api.ts`](https://github.com/haroldducon/reparacion_celular/blob/main/frontend/src/lib/api.ts) (API client), [`backend/src/prisma/prisma.service.ts`](https://github.com/haroldducon/reparacion_celular/blob/main/backend/src/prisma/prisma.service.ts) (Postgres data), [`frontend/src/App.tsx`](https://github.com/haroldducon/reparacion_celular/blob/main/frontend/src/App.tsx) (Route application), [`backend/src/modules/ordenes/ordenes.controller.ts`](https://github.com/haroldducon/reparacion_celular/blob/main/backend/src/modules/ordenes/ordenes.controller.ts) (Order endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Web application"]
  node_app["Route application<br/>[App.tsx]"]
  node_auth_ui["Session context<br/>[auth-context.tsx]"]
  node_api["API client<br/>[api.ts]"]
  node_order_ui["Order workflow pages"]
  node_repair_ui["Repair pages<br/>[ReparacionPage.tsx]"]
  node_reports_ui["Reports page<br/>[ReportesPage.tsx]"]
end

subgraph group_identity["Identity and access"]
  node_auth["Authentication<br/>[auth.service.ts]"]
  node_users["User administration"]
  node_tenants["Tenant administration<br/>[tenant.service.ts]"]
end

subgraph group_workshop["Workshop operations"]
  node_orders_api["Order endpoints"]
  node_orders["Order lifecycle<br/>[ordenes.service.ts]"]
  node_photo_storage["Photo storage<br/>[storage.service.ts]"]
  node_public_tracking["Public tracking<br/>[public.service.ts]"]
  node_reports_api["Report endpoints"]
  node_reports["Report generation"]
end

subgraph group_platform["Data and services"]
  node_database[("Postgres data<br/>[prisma.service.ts]")]
  node_cache[("Redis cache<br/>[cache.service.ts]")]
  node_queue["Background jobs<br/>[queue.service.ts]"]
end

node_staff(("Shop staff"))
node_customer(("Customer"))
node_cloudinary["Cloudinary"]
node_local_disk[("Local photo disk")]

node_staff -->|"uses"| node_app
node_customer -->|"opens tracking"| node_app
node_app -->|"routes to"| node_order_ui
node_app -->|"routes to"| node_repair_ui
node_app -->|"routes to"| node_reports_ui
node_auth_ui -->|"requests login"| node_api
node_order_ui -->|"requests order data"| node_api
node_repair_ui -->|"requests repair data"| node_api
node_reports_ui -->|"requests reports"| node_api
node_api -.->|"calls API"| node_auth
node_api -.->|"calls API"| node_orders_api
node_api -.->|"calls API"| node_reports_api
node_orders_api -->|"delegates to"| node_orders
node_orders_api -->|"stores photos"| node_photo_storage
node_orders_api -.->|"checks access"| node_users
node_orders -->|"reads and writes"| node_database
node_orders -->|"invalidates cache"| node_cache
node_orders -->|"enqueues jobs"| node_queue
node_photo_storage -->|"uploads optionally"| node_cloudinary
node_photo_storage -->|"writes fallback"| node_local_disk
node_public_tracking -->|"reads order"| node_database
node_reports_api -->|"delegates to"| node_reports
node_reports -->|"queries data"| node_database
node_reports -->|"uses cache"| node_cache
node_reports -->|"enqueues report"| node_queue
node_auth -->|"reads and updates"| node_database
node_auth -->|"tracks login failures"| node_cache
node_users -->|"reads and writes"| node_database
node_tenants -->|"reads and writes"| node_database

click node_app "https://github.com/haroldducon/reparacion_celular/blob/main/frontend/src/App.tsx"
click node_auth_ui "https://github.com/haroldducon/reparacion_celular/blob/main/frontend/src/lib/auth-context.tsx"
click node_api "https://github.com/haroldducon/reparacion_celular/blob/main/frontend/src/lib/api.ts"
click node_order_ui "https://github.com/haroldducon/reparacion_celular/blob/main/frontend/src/pages/DiagnosticoPage.tsx"
click node_repair_ui "https://github.com/haroldducon/reparacion_celular/blob/main/frontend/src/pages/ReparacionPage.tsx"
click node_reports_ui "https://github.com/haroldducon/reparacion_celular/blob/main/frontend/src/pages/ReportesPage.tsx"
click node_auth "https://github.com/haroldducon/reparacion_celular/blob/main/backend/src/auth/auth.service.ts"
click node_orders_api "https://github.com/haroldducon/reparacion_celular/blob/main/backend/src/modules/ordenes/ordenes.controller.ts"
click node_orders "https://github.com/haroldducon/reparacion_celular/blob/main/backend/src/modules/ordenes/ordenes.service.ts"
click node_photo_storage "https://github.com/haroldducon/reparacion_celular/blob/main/backend/src/modules/ordenes/storage.service.ts"
click node_public_tracking "https://github.com/haroldducon/reparacion_celular/blob/main/backend/src/modules/public/public.service.ts"
click node_reports_api "https://github.com/haroldducon/reparacion_celular/blob/main/backend/src/modules/reportes/reportes.controller.ts"
click node_reports "https://github.com/haroldducon/reparacion_celular/blob/main/backend/src/modules/reportes/reportes.service.ts"
click node_users "https://github.com/haroldducon/reparacion_celular/blob/main/backend/src/modules/usuarios/usuarios.service.ts"
click node_tenants "https://github.com/haroldducon/reparacion_celular/blob/main/backend/src/modules/tenant/tenant.service.ts"
click node_database "https://github.com/haroldducon/reparacion_celular/blob/main/backend/src/prisma/prisma.service.ts"
click node_cache "https://github.com/haroldducon/reparacion_celular/blob/main/backend/src/modules/cache/cache.service.ts"
click node_queue "https://github.com/haroldducon/reparacion_celular/blob/main/backend/src/modules/queue/queue.service.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,node_auth_ui,node_api,node_order_ui,node_repair_ui,node_reports_ui toneBlue
class node_auth,node_users,node_tenants,node_local_disk toneAmber
class node_orders_api,node_orders,node_photo_storage,node_public_tracking,node_reports_api,node_reports toneMint
class node_database,node_cache,node_queue toneRose
class node_staff,node_customer,node_cloudinary toneIndigo
```

## Components

### Web application

- [Route application](https://github.com/haroldducon/reparacion_celular/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Session context](https://github.com/haroldducon/reparacion_celular/blob/main/frontend/src/lib/auth-context.tsx): `frontend/src/lib/auth-context.tsx`
- [API client](https://github.com/haroldducon/reparacion_celular/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`
- [Order workflow pages](https://github.com/haroldducon/reparacion_celular/blob/main/frontend/src/pages/DiagnosticoPage.tsx): `frontend/src/pages/DiagnosticoPage.tsx`
- [Repair pages](https://github.com/haroldducon/reparacion_celular/blob/main/frontend/src/pages/ReparacionPage.tsx): `frontend/src/pages/ReparacionPage.tsx`
- [Reports page](https://github.com/haroldducon/reparacion_celular/blob/main/frontend/src/pages/ReportesPage.tsx): `frontend/src/pages/ReportesPage.tsx`

### Identity and access

- [Authentication](https://github.com/haroldducon/reparacion_celular/blob/main/backend/src/auth/auth.service.ts): `backend/src/auth/auth.service.ts`
- [User administration](https://github.com/haroldducon/reparacion_celular/blob/main/backend/src/modules/usuarios/usuarios.service.ts): `backend/src/modules/usuarios/usuarios.service.ts`
- [Tenant administration](https://github.com/haroldducon/reparacion_celular/blob/main/backend/src/modules/tenant/tenant.service.ts): `backend/src/modules/tenant/tenant.service.ts`

### Workshop operations

- [Order endpoints](https://github.com/haroldducon/reparacion_celular/blob/main/backend/src/modules/ordenes/ordenes.controller.ts): `backend/src/modules/ordenes/ordenes.controller.ts`
- [Order lifecycle](https://github.com/haroldducon/reparacion_celular/blob/main/backend/src/modules/ordenes/ordenes.service.ts): `backend/src/modules/ordenes/ordenes.service.ts`
- [Photo storage](https://github.com/haroldducon/reparacion_celular/blob/main/backend/src/modules/ordenes/storage.service.ts): `backend/src/modules/ordenes/storage.service.ts`
- [Public tracking](https://github.com/haroldducon/reparacion_celular/blob/main/backend/src/modules/public/public.service.ts): `backend/src/modules/public/public.service.ts`
- [Report endpoints](https://github.com/haroldducon/reparacion_celular/blob/main/backend/src/modules/reportes/reportes.controller.ts): `backend/src/modules/reportes/reportes.controller.ts`
- [Report generation](https://github.com/haroldducon/reparacion_celular/blob/main/backend/src/modules/reportes/reportes.service.ts): `backend/src/modules/reportes/reportes.service.ts`

### Data and services

- [Postgres data](https://github.com/haroldducon/reparacion_celular/blob/main/backend/src/prisma/prisma.service.ts): `backend/src/prisma/prisma.service.ts`
- [Redis cache](https://github.com/haroldducon/reparacion_celular/blob/main/backend/src/modules/cache/cache.service.ts): `backend/src/modules/cache/cache.service.ts`
- [Background jobs](https://github.com/haroldducon/reparacion_celular/blob/main/backend/src/modules/queue/queue.service.ts): `backend/src/modules/queue/queue.service.ts`

### Other components

- **Shop staff**
- **Customer**
- **Cloudinary**
- **Local photo disk**

## Connections

- Shop staff → Route application: uses (evidence: `frontend/src/App.tsx`)
- Customer → Route application: opens tracking (evidence: `frontend/src/App.tsx`)
- Route application → Order workflow pages: routes to (evidence: `frontend/src/App.tsx`)
- Route application → Repair pages: routes to (evidence: `frontend/src/App.tsx`)
- Route application → Reports page: routes to (evidence: `frontend/src/App.tsx`)
- Session context → API client: requests login (evidence: `frontend/src/lib/auth-context.tsx`)
- Order workflow pages → API client: requests order data (evidence: `frontend/src/pages/DiagnosticoPage.tsx`)
- Repair pages → API client: requests repair data (evidence: `frontend/src/pages/ReparacionPage.tsx`)
- Reports page → API client: requests reports (evidence: `frontend/src/pages/ReportesPage.tsx`)
- API client → Authentication: calls API
- API client → Order endpoints: calls API
- API client → Report endpoints: calls API
- Order endpoints → Order lifecycle: delegates to (evidence: `backend/src/modules/ordenes/ordenes.controller.ts`)
- Order endpoints → Photo storage: stores photos (evidence: `backend/src/modules/ordenes/ordenes.controller.ts`)
- Order endpoints → User administration: checks access
- Order lifecycle → Postgres data: reads and writes (evidence: `backend/src/modules/ordenes/ordenes.service.ts`)
- Order lifecycle → Redis cache: invalidates cache (evidence: `backend/src/modules/ordenes/ordenes.service.ts`)
- Order lifecycle → Background jobs: enqueues jobs (evidence: `backend/src/modules/ordenes/ordenes.service.ts`)
- Photo storage → Cloudinary: uploads optionally (evidence: `backend/src/modules/ordenes/storage.service.ts`)
- Photo storage → Local photo disk: writes fallback (evidence: `backend/src/modules/ordenes/storage.service.ts`)
- Public tracking → Postgres data: reads order (evidence: `backend/src/modules/public/public.service.ts`)
- Report endpoints → Report generation: delegates to (evidence: `backend/src/modules/reportes/reportes.controller.ts`)
- Report generation → Postgres data: queries data (evidence: `backend/src/modules/reportes/reportes.service.ts`)
- Report generation → Redis cache: uses cache (evidence: `backend/src/modules/reportes/reportes.service.ts`)
- Report generation → Background jobs: enqueues report (evidence: `backend/src/modules/reportes/reportes.service.ts`)
- Authentication → Postgres data: reads and updates (evidence: `backend/src/auth/auth.service.ts`)
- Authentication → Redis cache: tracks login failures (evidence: `backend/src/auth/auth.service.ts`)
- User administration → Postgres data: reads and writes (evidence: `backend/src/modules/usuarios/usuarios.service.ts`)
- Tenant administration → Postgres data: reads and writes (evidence: `backend/src/modules/tenant/tenant.service.ts`)
