# cth-sla/devicerepairmanager architecture

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

- Interactive diagram: https://gitdiagram.com/cth-sla/devicerepairmanager
- Repository: https://github.com/cth-sla/devicerepairmanager

## Overview

DeviceRepairManager is a device-repair operations application. Staff sign in, then manage organizations, customers and devices alongside repair tickets and warranty cases; a separate public registration flow collects service-support requests that staff can review and update. Dashboard and statistics provide operational views. The React pages use shared storage/API services, with server-side local storage and MySQL support; the client can also route requests to the Hostinger PHP backend. The README is empty, and unsampled page/backend details limit some wiring shown here.

Main entry points: [`App.tsx`](https://github.com/cth-sla/devicerepairmanager/blob/main/App.tsx) (App routing), [`services/client.ts`](https://github.com/cth-sla/devicerepairmanager/blob/main/services/client.ts) (API client), [`server.ts`](https://github.com/cth-sla/devicerepairmanager/blob/main/server.ts) (Node API), [`services/storage.ts`](https://github.com/cth-sla/devicerepairmanager/blob/main/services/storage.ts) (Storage service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application access"]
  node_app_router["App routing<br/>[App.tsx]"]
  node_auth["Session and auth<br/>[AuthContext.tsx]"]
  node_login["Login<br/>[Login.tsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_statistics["Statistics<br/>[Statistics.tsx]"]
end

subgraph group_operations["Repair operations"]
  node_organizations["Organizations<br/>[Organizations.tsx]"]
  node_customers["Customers<br/>[Customers.tsx]"]
  node_devices["Devices<br/>[Devices.tsx]"]
  node_repairs["Repair tickets<br/>[Repairs.tsx]"]
  node_warranty["Warranty cases<br/>[Warranty.tsx]"]
end

subgraph group_service["Service support"]
  node_register_page["Public registration"]
  node_register_card["Registration form"]
  node_service_admin["Service requests<br/>[Services.tsx]"]
end

subgraph group_data["API and persistence"]
  node_storage["Storage service<br/>[storage.ts]"]
  node_api_client["API client<br/>[client.ts]"]
  node_node_backend["Node API<br/>[server.ts]"]
  node_php_backend["Hostinger API<br/>[hostinger_api.php]"]
  node_mysql[("MySQL")]
  node_local_store[("Local store<br/>[db_store.json]")]
end

node_staff(("Staff"))
node_public_user(("Public requester"))

node_staff -->|"opens"| node_app_router
node_public_user -->|"opens"| node_app_router
node_app_router -->|"provides session"| node_auth
node_app_router -->|"routes"| node_login
node_app_router -->|"routes"| node_dashboard
node_app_router -->|"routes"| node_statistics
node_app_router -->|"routes"| node_organizations
node_app_router -->|"routes"| node_customers
node_app_router -->|"routes"| node_devices
node_app_router -->|"routes"| node_repairs
node_app_router -->|"routes"| node_warranty
node_app_router -->|"routes"| node_register_page
node_app_router -->|"routes"| node_service_admin
node_register_page -->|"submits through"| node_storage
node_service_admin -->|"manages requests"| node_storage
node_auth -->|"checks health"| node_api_client
node_storage -->|"sends API requests"| node_api_client
node_api_client -->|"requests"| node_node_backend
node_api_client -.->|"fallback requests"| node_php_backend
node_node_backend -->|"reads and writes"| node_mysql
node_node_backend -->|"persists fallback"| node_local_store
node_php_backend -->|"reads and writes"| node_mysql

click node_app_router "https://github.com/cth-sla/devicerepairmanager/blob/main/App.tsx"
click node_auth "https://github.com/cth-sla/devicerepairmanager/blob/main/contexts/AuthContext.tsx"
click node_login "https://github.com/cth-sla/devicerepairmanager/blob/main/pages/Login.tsx"
click node_dashboard "https://github.com/cth-sla/devicerepairmanager/blob/main/pages/Dashboard.tsx"
click node_statistics "https://github.com/cth-sla/devicerepairmanager/blob/main/pages/Statistics.tsx"
click node_organizations "https://github.com/cth-sla/devicerepairmanager/blob/main/pages/Organizations.tsx"
click node_customers "https://github.com/cth-sla/devicerepairmanager/blob/main/pages/Customers.tsx"
click node_devices "https://github.com/cth-sla/devicerepairmanager/blob/main/pages/Devices.tsx"
click node_repairs "https://github.com/cth-sla/devicerepairmanager/blob/main/pages/Repairs.tsx"
click node_warranty "https://github.com/cth-sla/devicerepairmanager/blob/main/pages/Warranty.tsx"
click node_register_page "https://github.com/cth-sla/devicerepairmanager/blob/main/pages/ServiceRegisterPage.tsx"
click node_register_card "https://github.com/cth-sla/devicerepairmanager/blob/main/components/ServiceRegisterCard.tsx"
click node_service_admin "https://github.com/cth-sla/devicerepairmanager/blob/main/pages/Services.tsx"
click node_storage "https://github.com/cth-sla/devicerepairmanager/blob/main/services/storage.ts"
click node_api_client "https://github.com/cth-sla/devicerepairmanager/blob/main/services/client.ts"
click node_node_backend "https://github.com/cth-sla/devicerepairmanager/blob/main/server.ts"
click node_php_backend "https://github.com/cth-sla/devicerepairmanager/blob/main/public/hostinger_api.php"
click node_local_store "https://github.com/cth-sla/devicerepairmanager/blob/main/data/db_store.json"

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_router,node_auth,node_login,node_dashboard,node_statistics toneBlue
class node_organizations,node_customers,node_devices,node_repairs,node_warranty toneAmber
class node_register_page,node_register_card,node_service_admin,node_public_user toneMint
class node_storage,node_api_client,node_node_backend,node_php_backend,node_mysql,node_local_store toneRose
class node_staff toneIndigo
```

## Components

### Application access

- [App routing](https://github.com/cth-sla/devicerepairmanager/blob/main/App.tsx): `App.tsx`
- [Session and auth](https://github.com/cth-sla/devicerepairmanager/blob/main/contexts/AuthContext.tsx): `contexts/AuthContext.tsx`
- [Login](https://github.com/cth-sla/devicerepairmanager/blob/main/pages/Login.tsx): `pages/Login.tsx`
- [Dashboard](https://github.com/cth-sla/devicerepairmanager/blob/main/pages/Dashboard.tsx): `pages/Dashboard.tsx`
- [Statistics](https://github.com/cth-sla/devicerepairmanager/blob/main/pages/Statistics.tsx): `pages/Statistics.tsx`

### Repair operations

- [Organizations](https://github.com/cth-sla/devicerepairmanager/blob/main/pages/Organizations.tsx): `pages/Organizations.tsx`
- [Customers](https://github.com/cth-sla/devicerepairmanager/blob/main/pages/Customers.tsx): `pages/Customers.tsx`
- [Devices](https://github.com/cth-sla/devicerepairmanager/blob/main/pages/Devices.tsx): `pages/Devices.tsx`
- [Repair tickets](https://github.com/cth-sla/devicerepairmanager/blob/main/pages/Repairs.tsx): `pages/Repairs.tsx`
- [Warranty cases](https://github.com/cth-sla/devicerepairmanager/blob/main/pages/Warranty.tsx): `pages/Warranty.tsx`

### Service support

- [Public registration](https://github.com/cth-sla/devicerepairmanager/blob/main/pages/ServiceRegisterPage.tsx): `pages/ServiceRegisterPage.tsx`
- [Registration form](https://github.com/cth-sla/devicerepairmanager/blob/main/components/ServiceRegisterCard.tsx): `components/ServiceRegisterCard.tsx`
- [Service requests](https://github.com/cth-sla/devicerepairmanager/blob/main/pages/Services.tsx): `pages/Services.tsx`

### API and persistence

- [Storage service](https://github.com/cth-sla/devicerepairmanager/blob/main/services/storage.ts): `services/storage.ts`
- [API client](https://github.com/cth-sla/devicerepairmanager/blob/main/services/client.ts): `services/client.ts`
- [Node API](https://github.com/cth-sla/devicerepairmanager/blob/main/server.ts): `server.ts`
- [Hostinger API](https://github.com/cth-sla/devicerepairmanager/blob/main/public/hostinger_api.php): `public/hostinger_api.php`
- **MySQL**
- [Local store](https://github.com/cth-sla/devicerepairmanager/blob/main/data/db_store.json): `data/db_store.json`

### Other components

- **Staff**
- **Public requester**

## Connections

- Staff → App routing: opens
- Public requester → App routing: opens
- App routing → Session and auth: provides session
- App routing → Login: routes
- App routing → Dashboard: routes
- App routing → Statistics: routes
- App routing → Organizations: routes
- App routing → Customers: routes
- App routing → Devices: routes
- App routing → Repair tickets: routes
- App routing → Warranty cases: routes
- App routing → Public registration: routes
- App routing → Service requests: routes
- Public registration → Storage service: submits through
- Service requests → Storage service: manages requests
- Session and auth → API client: checks health
- Storage service → API client: sends API requests
- API client → Node API: requests
- API client → Hostinger API: fallback requests
- Node API → MySQL: reads and writes
- Node API → Local store: persists fallback
- Hostinger API → MySQL: reads and writes
