# denispham1107/quanlynhansu architecture

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

- Interactive diagram: https://gitdiagram.com/denispham1107/quanlynhansu
- Repository: https://github.com/denispham1107/quanlynhansu

## Overview

Culao Task is a Firebase-backed workforce and task-management PWA. Employees and administrators use the web app to manage work, while backend functions coordinate scheduled work orders, assignment, notifications, and operational workflows. The tree and excerpts support the major task, staff, schedule, hotel/shipping, chat, reporting, and calendar capabilities, but the empty README and partial backend excerpts limit certainty about detailed UI-to-function wiring.

Main entry points: [`app.js`](https://github.com/denispham1107/quanlynhansu/blob/main/app.js) (Task PWA), [`functions/index.js`](https://github.com/denispham1107/quanlynhansu/blob/main/functions/index.js) (Cloud functions), [`sw.js`](https://github.com/denispham1107/quanlynhansu/blob/main/sw.js) (Push service worker), [`firebase-config.js`](https://github.com/denispham1107/quanlynhansu/blob/main/firebase-config.js) (Firebase services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_webapp["Task PWA<br/>[app.js]"]
  node_shell["App shell<br/>[index.html]"]
end

subgraph group_workflows["Workforce workflows"]
  node_taskops["Task operations<br/>[app.js]"]
  node_staffops["Staff management<br/>[app.js]"]
  node_scheduleops["Scheduled work orders<br/>[app.js]"]
  node_hotelship["Hotel and shipping<br/>[app.js]"]
  node_chatreports["Chat and reports<br/>[app.js]"]
end

subgraph group_backend["Backend services"]
  node_functions["Cloud functions<br/>[index.js]"]
  node_availability["Availability rules"]
  node_datekeys["Schedule date keys"]
  node_worker["Push service worker<br/>[sw.js]"]
end

subgraph group_state["Data and integrations"]
  node_firestore[("Firestore")]
  node_taskqueue["Task queue"]
  node_firebase["Firebase services<br/>[firebase-config.js]"]
  node_calendar["Google Calendar"]
end

node_user(("Employee or admin"))

node_user -->|"uses"| node_webapp
node_webapp -->|"renders"| node_shell
node_webapp -->|"manages tasks"| node_taskops
node_webapp -->|"manages staff"| node_staffops
node_webapp -->|"manages schedules"| node_scheduleops
node_webapp -->|"manages work"| node_hotelship
node_webapp -->|"uses"| node_chatreports
node_webapp -->|"uses configuration"| node_firebase
node_taskops -->|"reads and writes"| node_firestore
node_staffops -->|"reads and writes"| node_firestore
node_scheduleops -->|"reads and writes"| node_firestore
node_scheduleops -->|"requests operations"| node_functions
node_functions -->|"reads and writes"| node_firestore
node_functions -->|"checks availability"| node_availability
node_functions -->|"derives task dates"| node_datekeys
node_functions -->|"enqueues work"| node_taskqueue
node_hotelship -->|"reads and writes"| node_firestore
node_chatreports -->|"reads and writes"| node_firestore
node_functions -.->|"imports calendar"| node_calendar
node_firebase -->|"delivers push"| node_worker
node_worker -->|"shows notification"| node_user

click node_webapp "https://github.com/denispham1107/quanlynhansu/blob/main/app.js"
click node_shell "https://github.com/denispham1107/quanlynhansu/blob/main/index.html"
click node_taskops "https://github.com/denispham1107/quanlynhansu/blob/main/app.js"
click node_staffops "https://github.com/denispham1107/quanlynhansu/blob/main/app.js"
click node_scheduleops "https://github.com/denispham1107/quanlynhansu/blob/main/app.js"
click node_hotelship "https://github.com/denispham1107/quanlynhansu/blob/main/app.js"
click node_chatreports "https://github.com/denispham1107/quanlynhansu/blob/main/app.js"
click node_functions "https://github.com/denispham1107/quanlynhansu/blob/main/functions/index.js"
click node_availability "https://github.com/denispham1107/quanlynhansu/blob/main/functions/scheduled-availability.js"
click node_datekeys "https://github.com/denispham1107/quanlynhansu/blob/main/functions/scheduled-task-date.js"
click node_worker "https://github.com/denispham1107/quanlynhansu/blob/main/sw.js"
click node_firebase "https://github.com/denispham1107/quanlynhansu/blob/main/firebase-config.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_webapp,node_shell toneBlue
class node_taskops,node_staffops,node_scheduleops,node_hotelship,node_chatreports toneAmber
class node_functions,node_availability,node_datekeys,node_worker toneMint
class node_firestore,node_taskqueue,node_firebase,node_calendar toneRose
class node_user toneIndigo
```

## Components

### Web application

- [Task PWA](https://github.com/denispham1107/quanlynhansu/blob/main/app.js): `app.js`
- [App shell](https://github.com/denispham1107/quanlynhansu/blob/main/index.html): `index.html`

### Workforce workflows

- [Task operations](https://github.com/denispham1107/quanlynhansu/blob/main/app.js): `app.js`
- [Staff management](https://github.com/denispham1107/quanlynhansu/blob/main/app.js): `app.js`
- [Scheduled work orders](https://github.com/denispham1107/quanlynhansu/blob/main/app.js): `app.js`
- [Hotel and shipping](https://github.com/denispham1107/quanlynhansu/blob/main/app.js): `app.js`
- [Chat and reports](https://github.com/denispham1107/quanlynhansu/blob/main/app.js): `app.js`

### Backend services

- [Cloud functions](https://github.com/denispham1107/quanlynhansu/blob/main/functions/index.js): `functions/index.js`
- [Availability rules](https://github.com/denispham1107/quanlynhansu/blob/main/functions/scheduled-availability.js): `functions/scheduled-availability.js`
- [Schedule date keys](https://github.com/denispham1107/quanlynhansu/blob/main/functions/scheduled-task-date.js): `functions/scheduled-task-date.js`
- [Push service worker](https://github.com/denispham1107/quanlynhansu/blob/main/sw.js): `sw.js`

### Data and integrations

- **Firestore**
- **Task queue**
- [Firebase services](https://github.com/denispham1107/quanlynhansu/blob/main/firebase-config.js): `firebase-config.js`
- **Google Calendar**

### Other components

- **Employee or admin**

## Connections

- Employee or admin → Task PWA: uses
- Task PWA → App shell: renders
- Task PWA → Task operations: manages tasks
- Task PWA → Staff management: manages staff
- Task PWA → Scheduled work orders: manages schedules
- Task PWA → Hotel and shipping: manages work
- Task PWA → Chat and reports: uses
- Task PWA → Firebase services: uses configuration
- Task operations → Firestore: reads and writes
- Staff management → Firestore: reads and writes
- Scheduled work orders → Firestore: reads and writes
- Scheduled work orders → Cloud functions: requests operations
- Cloud functions → Firestore: reads and writes
- Cloud functions → Availability rules: checks availability
- Cloud functions → Schedule date keys: derives task dates
- Cloud functions → Task queue: enqueues work
- Hotel and shipping → Firestore: reads and writes
- Chat and reports → Firestore: reads and writes
- Cloud functions → Google Calendar: imports calendar
- Firebase services → Push service worker: delivers push
- Push service worker → Employee or admin: shows notification
