# mostafamahmoudov/aitc-systems architecture

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

- Interactive diagram: https://gitdiagram.com/mostafamahmoudov/aitc-systems
- Repository: https://github.com/mostafamahmoudov/aitc-systems

## Overview

AITC Systems combines two independent Cloudflare Worker applications. In timesheets, staff submit daily work and break details, the Worker calculates hours, and entries and date totals are persisted in D1. Handover supports task and daily handover workflows, role-based access, invites, notifications, and Google Sheets synchronization. The sampled source shows API handling and D1 access, but not the complete handover implementations; those capability branches are therefore represented at the Worker level, with uncertain integration wiring left unasserted.

Main entry points: [`handover/src/index.js`](https://github.com/mostafamahmoudov/aitc-systems/blob/main/handover/src/index.js) (Handover API), [`timesheet/src/index.js`](https://github.com/mostafamahmoudov/aitc-systems/blob/main/timesheet/src/index.js) (Timesheet API), [`timesheet/schema.sql`](https://github.com/mostafamahmoudov/aitc-systems/blob/main/timesheet/schema.sql) (Time entries), [`timesheet/public/index.html`](https://github.com/mostafamahmoudov/aitc-systems/blob/main/timesheet/public/index.html) (Timesheet UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_timesheet["Timesheet system"]
  node_timesheet_worker["Timesheet API<br/>[index.js]"]
  node_hours_calc["Hours calculator<br/>[index.js]"]
  node_entries[("Time entries<br/>[schema.sql]")]
  node_timesheet_ui["Timesheet UI<br/>[index.html]"]
end

subgraph group_handover["Handover system"]
  node_handover_users["Handover users<br/>[index.js]"]
  node_handover_tasks["Task dashboard<br/>[index.js]"]
  node_daily_handover["Daily handovers<br/>[index.js]"]
  node_roles_invites["Roles and invites<br/>[index.js]"]
  node_notifications["Notifications<br/>[index.js]"]
  node_email_ingest["Email ingest<br/>[index.js]"]
  node_sheet_sync["Sheets sync<br/>[index.js]"]
  node_handover_worker["Handover API<br/>[index.js]"]
  node_handover_db[("Handover data<br/>[schema.sql]")]
  node_handover_ui["Handover UI<br/>[index.html]"]
end

node_staff(("Staff"))
node_google_sheets[("Google Sheets")]

node_staff -->|"submits entries"| node_timesheet_worker
node_timesheet_worker -->|"calculates hours"| node_hours_calc
node_timesheet_worker -->|"reads and writes"| node_entries
node_timesheet_worker -->|"serves assets"| node_timesheet_ui
node_staff -->|"uses system"| node_handover_worker
node_handover_worker -->|"handles accounts"| node_handover_users
node_handover_worker -->|"handles tasks"| node_handover_tasks
node_handover_worker -->|"handles handovers"| node_daily_handover
node_handover_worker -->|"handles access"| node_roles_invites
node_handover_worker -->|"supports notifications"| node_notifications
node_handover_worker -->|"ingests email"| node_email_ingest
node_handover_worker -->|"supports sync"| node_sheet_sync
node_handover_worker -->|"reads and writes"| node_handover_db
node_handover_worker -->|"serves assets"| node_handover_ui
node_sheet_sync -.->|"syncs tasks"| node_google_sheets

click node_timesheet_worker "https://github.com/mostafamahmoudov/aitc-systems/blob/main/timesheet/src/index.js"
click node_hours_calc "https://github.com/mostafamahmoudov/aitc-systems/blob/main/timesheet/src/index.js"
click node_entries "https://github.com/mostafamahmoudov/aitc-systems/blob/main/timesheet/schema.sql"
click node_timesheet_ui "https://github.com/mostafamahmoudov/aitc-systems/blob/main/timesheet/public/index.html"
click node_handover_users "https://github.com/mostafamahmoudov/aitc-systems/blob/main/handover/src/index.js"
click node_handover_tasks "https://github.com/mostafamahmoudov/aitc-systems/blob/main/handover/src/index.js"
click node_daily_handover "https://github.com/mostafamahmoudov/aitc-systems/blob/main/handover/src/index.js"
click node_roles_invites "https://github.com/mostafamahmoudov/aitc-systems/blob/main/handover/src/index.js"
click node_notifications "https://github.com/mostafamahmoudov/aitc-systems/blob/main/handover/src/index.js"
click node_email_ingest "https://github.com/mostafamahmoudov/aitc-systems/blob/main/handover/src/index.js"
click node_sheet_sync "https://github.com/mostafamahmoudov/aitc-systems/blob/main/handover/src/index.js"
click node_handover_worker "https://github.com/mostafamahmoudov/aitc-systems/blob/main/handover/src/index.js"
click node_handover_db "https://github.com/mostafamahmoudov/aitc-systems/blob/main/handover/schema.sql"
click node_handover_ui "https://github.com/mostafamahmoudov/aitc-systems/blob/main/handover/public/index.html"

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_timesheet_worker,node_hours_calc,node_entries,node_timesheet_ui toneBlue
class node_handover_users,node_handover_tasks,node_daily_handover,node_roles_invites,node_notifications,node_email_ingest,node_sheet_sync,node_handover_worker,node_handover_db,node_handover_ui,node_google_sheets toneAmber
class node_staff toneIndigo
```

## Components

### Timesheet system

- [Timesheet API](https://github.com/mostafamahmoudov/aitc-systems/blob/main/timesheet/src/index.js): `timesheet/src/index.js`
- [Hours calculator](https://github.com/mostafamahmoudov/aitc-systems/blob/main/timesheet/src/index.js): `timesheet/src/index.js`
- [Time entries](https://github.com/mostafamahmoudov/aitc-systems/blob/main/timesheet/schema.sql): `timesheet/schema.sql`
- [Timesheet UI](https://github.com/mostafamahmoudov/aitc-systems/blob/main/timesheet/public/index.html): `timesheet/public/index.html`

### Handover system

- [Handover users](https://github.com/mostafamahmoudov/aitc-systems/blob/main/handover/src/index.js): `handover/src/index.js`
- [Task dashboard](https://github.com/mostafamahmoudov/aitc-systems/blob/main/handover/src/index.js): `handover/src/index.js`
- [Daily handovers](https://github.com/mostafamahmoudov/aitc-systems/blob/main/handover/src/index.js): `handover/src/index.js`
- [Roles and invites](https://github.com/mostafamahmoudov/aitc-systems/blob/main/handover/src/index.js): `handover/src/index.js`
- [Notifications](https://github.com/mostafamahmoudov/aitc-systems/blob/main/handover/src/index.js): `handover/src/index.js`
- [Email ingest](https://github.com/mostafamahmoudov/aitc-systems/blob/main/handover/src/index.js): `handover/src/index.js`
- [Sheets sync](https://github.com/mostafamahmoudov/aitc-systems/blob/main/handover/src/index.js): `handover/src/index.js`
- [Handover API](https://github.com/mostafamahmoudov/aitc-systems/blob/main/handover/src/index.js): `handover/src/index.js`
- [Handover data](https://github.com/mostafamahmoudov/aitc-systems/blob/main/handover/schema.sql): `handover/schema.sql`
- [Handover UI](https://github.com/mostafamahmoudov/aitc-systems/blob/main/handover/public/index.html): `handover/public/index.html`

### Other components

- **Staff**
- **Google Sheets**

## Connections

- Staff → Timesheet API: submits entries (evidence: `timesheet/src/index.js`)
- Timesheet API → Hours calculator: calculates hours (evidence: `timesheet/src/index.js`)
- Timesheet API → Time entries: reads and writes (evidence: `timesheet/src/index.js`)
- Timesheet API → Timesheet UI: serves assets (evidence: `timesheet/src/index.js`)
- Staff → Handover API: uses system (evidence: `README.md`)
- Handover API → Handover users: handles accounts (evidence: `handover/src/index.js`)
- Handover API → Task dashboard: handles tasks (evidence: `handover/src/index.js`)
- Handover API → Daily handovers: handles handovers (evidence: `handover/src/index.js`)
- Handover API → Roles and invites: handles access (evidence: `README.md`)
- Handover API → Notifications: supports notifications (evidence: `README.md`)
- Handover API → Email ingest: ingests email (evidence: `handover/src/index.js`)
- Handover API → Sheets sync: supports sync (evidence: `README.md`)
- Handover API → Handover data: reads and writes (evidence: `handover/src/index.js`)
- Handover API → Handover UI: serves assets (evidence: `handover/src/index.js`)
- Sheets sync → Google Sheets: syncs tasks (evidence: `README.md`)
