# antonioyg/trabajo architecture

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

- Interactive diagram: https://gitdiagram.com/antonioyg/trabajo
- Repository: https://github.com/antonioyg/trabajo

## Overview

WorkLog Pro is a workforce time-tracking application for managing employees, recording shifts, calculating regular and overtime hours, and reviewing or exporting work records. The frontend coordinates these workflows and uses a data service to communicate with the server; the server delegates persistence operations to MySQL. The sampled files also show settings for external MySQL, mobile/offline access, and server-side messaging and backup capabilities. Some backend routes and integrations are only partially excerpted, so uncertain connections are omitted or marked unverified.

Main entry points: [`src/App.tsx`](https://github.com/antonioyg/trabajo/blob/main/src/App.tsx) (App Coordinator), [`src/utils/calculations.ts`](https://github.com/antonioyg/trabajo/blob/main/src/utils/calculations.ts) (Time Calculations), [`src/components/Dashboard.tsx`](https://github.com/antonioyg/trabajo/blob/main/src/components/Dashboard.tsx) (Hours Dashboard), [`src/components/Logs.tsx`](https://github.com/antonioyg/trabajo/blob/main/src/components/Logs.tsx) (Shift Records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Workforce Interface"]
  node_app["App Coordinator<br/>[App.tsx]"]
  node_navigation["Navigation<br/>[Sidebar.tsx]"]
  node_navbar["Top Navigation<br/>[Navbar.tsx]"]
  node_settings["System Settings<br/>[Settings.tsx]"]
  node_mobile["Mobile Offline Access"]
end

subgraph group_domain["Time and Reporting"]
  node_employees["Employee Management<br/>[Employees.tsx]"]
  node_logs["Shift Records<br/>[Logs.tsx]"]
  node_quickclock["Quick Clock-In<br/>[QuickClockIn.tsx]"]
  node_dashboard["Hours Dashboard<br/>[Dashboard.tsx]"]
  node_holidays["Holiday Calendar<br/>[Holidays.tsx]"]
  node_reports["Reports<br/>[Reports.tsx]"]
  node_calculations["Time Calculations<br/>[calculations.ts]"]
  node_excel["Excel Export<br/>[excelExport.ts]"]
end

subgraph group_data["Data Services"]
  node_data_client["Data Service<br/>[db.ts]"]
  node_server["API Server<br/>[server.ts]"]
  node_mysql["MySQL Operations<br/>[mysql.ts]"]
end

subgraph group_integrations["External Services"]
  node_mysql_service[("MySQL Database")]
  node_twilio["Twilio Messaging"]
end

node_manager(("WorkLog User"))

node_manager -->|"uses"| node_app
node_app -->|"renders"| node_navigation
node_app -->|"renders"| node_navbar
node_app -->|"renders"| node_dashboard
node_app -->|"renders"| node_employees
node_app -->|"renders"| node_logs
node_app -->|"renders"| node_reports
node_app -->|"renders"| node_settings
node_app -->|"renders"| node_holidays
node_app -->|"renders"| node_mobile
node_app -->|"renders"| node_quickclock
node_app -->|"loads and updates"| node_data_client
node_logs -->|"uses"| node_calculations
node_quickclock -->|"calculates hours"| node_calculations
node_employees -->|"uses"| node_calculations
node_holidays -->|"uses"| node_calculations
node_dashboard -->|"uses"| node_calculations
node_dashboard -->|"renders"| node_quickclock
node_dashboard -->|"exports reports"| node_excel
node_logs -->|"exports records"| node_excel
node_reports -->|"exports reports"| node_excel
node_settings -->|"updates settings"| node_data_client
node_data_client -.->|"requests API"| node_server
node_server -->|"delegates persistence"| node_mysql
node_mysql -.->|"accesses database"| node_mysql_service
node_server -.->|"sends messages"| node_twilio

click node_app "https://github.com/antonioyg/trabajo/blob/main/src/App.tsx"
click node_navigation "https://github.com/antonioyg/trabajo/blob/main/src/components/Sidebar.tsx"
click node_navbar "https://github.com/antonioyg/trabajo/blob/main/src/components/Navbar.tsx"
click node_employees "https://github.com/antonioyg/trabajo/blob/main/src/components/Employees.tsx"
click node_logs "https://github.com/antonioyg/trabajo/blob/main/src/components/Logs.tsx"
click node_quickclock "https://github.com/antonioyg/trabajo/blob/main/src/components/QuickClockIn.tsx"
click node_dashboard "https://github.com/antonioyg/trabajo/blob/main/src/components/Dashboard.tsx"
click node_holidays "https://github.com/antonioyg/trabajo/blob/main/src/components/Holidays.tsx"
click node_reports "https://github.com/antonioyg/trabajo/blob/main/src/components/Reports.tsx"
click node_calculations "https://github.com/antonioyg/trabajo/blob/main/src/utils/calculations.ts"
click node_excel "https://github.com/antonioyg/trabajo/blob/main/src/utils/excelExport.ts"
click node_settings "https://github.com/antonioyg/trabajo/blob/main/src/components/Settings.tsx"
click node_mobile "https://github.com/antonioyg/trabajo/blob/main/src/components/MobileOfflineModal.tsx"
click node_data_client "https://github.com/antonioyg/trabajo/blob/main/src/DB/db.ts"
click node_server "https://github.com/antonioyg/trabajo/blob/main/server/server.ts"
click node_mysql "https://github.com/antonioyg/trabajo/blob/main/server/mysql.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_navigation,node_navbar,node_settings,node_mobile,node_manager toneBlue
class node_employees,node_logs,node_quickclock,node_dashboard,node_holidays,node_reports,node_calculations,node_excel toneAmber
class node_data_client,node_server,node_mysql toneMint
class node_mysql_service,node_twilio toneRose
```

## Components

### Workforce Interface

- [App Coordinator](https://github.com/antonioyg/trabajo/blob/main/src/App.tsx): `src/App.tsx`
- [Navigation](https://github.com/antonioyg/trabajo/blob/main/src/components/Sidebar.tsx): `src/components/Sidebar.tsx`
- [Top Navigation](https://github.com/antonioyg/trabajo/blob/main/src/components/Navbar.tsx): `src/components/Navbar.tsx`
- [System Settings](https://github.com/antonioyg/trabajo/blob/main/src/components/Settings.tsx): `src/components/Settings.tsx`
- [Mobile Offline Access](https://github.com/antonioyg/trabajo/blob/main/src/components/MobileOfflineModal.tsx): `src/components/MobileOfflineModal.tsx`

### Time and Reporting

- [Employee Management](https://github.com/antonioyg/trabajo/blob/main/src/components/Employees.tsx): `src/components/Employees.tsx`
- [Shift Records](https://github.com/antonioyg/trabajo/blob/main/src/components/Logs.tsx): `src/components/Logs.tsx`
- [Quick Clock-In](https://github.com/antonioyg/trabajo/blob/main/src/components/QuickClockIn.tsx): `src/components/QuickClockIn.tsx`
- [Hours Dashboard](https://github.com/antonioyg/trabajo/blob/main/src/components/Dashboard.tsx): `src/components/Dashboard.tsx`
- [Holiday Calendar](https://github.com/antonioyg/trabajo/blob/main/src/components/Holidays.tsx): `src/components/Holidays.tsx`
- [Reports](https://github.com/antonioyg/trabajo/blob/main/src/components/Reports.tsx): `src/components/Reports.tsx`
- [Time Calculations](https://github.com/antonioyg/trabajo/blob/main/src/utils/calculations.ts): `src/utils/calculations.ts`
- [Excel Export](https://github.com/antonioyg/trabajo/blob/main/src/utils/excelExport.ts): `src/utils/excelExport.ts`

### Data Services

- [Data Service](https://github.com/antonioyg/trabajo/blob/main/src/DB/db.ts): `src/DB/db.ts`
- [API Server](https://github.com/antonioyg/trabajo/blob/main/server/server.ts): `server/server.ts`
- [MySQL Operations](https://github.com/antonioyg/trabajo/blob/main/server/mysql.ts): `server/mysql.ts`

### External Services

- **MySQL Database**
- **Twilio Messaging**

### Other components

- **WorkLog User**

## Connections

- WorkLog User → App Coordinator: uses
- App Coordinator → Navigation: renders (evidence: `src/App.tsx`)
- App Coordinator → Top Navigation: renders (evidence: `src/App.tsx`)
- App Coordinator → Hours Dashboard: renders (evidence: `src/App.tsx`)
- App Coordinator → Employee Management: renders (evidence: `src/App.tsx`)
- App Coordinator → Shift Records: renders (evidence: `src/App.tsx`)
- App Coordinator → Reports: renders (evidence: `src/App.tsx`)
- App Coordinator → System Settings: renders (evidence: `src/App.tsx`)
- App Coordinator → Holiday Calendar: renders (evidence: `src/App.tsx`)
- App Coordinator → Mobile Offline Access: renders (evidence: `src/App.tsx`)
- App Coordinator → Quick Clock-In: renders (evidence: `src/App.tsx`)
- App Coordinator → Data Service: loads and updates (evidence: `src/App.tsx`)
- Shift Records → Time Calculations: uses (evidence: `src/components/Logs.tsx`)
- Quick Clock-In → Time Calculations: calculates hours (evidence: `src/components/QuickClockIn.tsx`)
- Employee Management → Time Calculations: uses (evidence: `src/components/Employees.tsx`)
- Holiday Calendar → Time Calculations: uses (evidence: `src/components/Holidays.tsx`)
- Hours Dashboard → Time Calculations: uses (evidence: `src/components/Dashboard.tsx`)
- Hours Dashboard → Quick Clock-In: renders (evidence: `src/components/Dashboard.tsx`)
- Hours Dashboard → Excel Export: exports reports (evidence: `src/components/Dashboard.tsx`)
- Shift Records → Excel Export: exports records (evidence: `src/components/Logs.tsx`)
- Reports → Excel Export: exports reports (evidence: `src/components/Reports.tsx`)
- System Settings → Data Service: updates settings (evidence: `src/components/Settings.tsx`)
- Data Service → API Server: requests API
- API Server → MySQL Operations: delegates persistence (evidence: `server/server.ts`)
- MySQL Operations → MySQL Database: accesses database
- API Server → Twilio Messaging: sends messages
