# lalitkumarjogi/complain-project architecture

> Architecture diagram of the GitHub repository lalitkumarjogi/complain-project, 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/lalitkumarjogi/complain-project
- Repository: https://github.com/lalitkumarjogi/complain-project

## Overview

This is a Google Apps Script service-complaint and field-service management web app, implemented largely as a monolith in Code.js. The principal workflow runs from complaint submission through ticket creation and confirmation, coordinator assignment, engineer service reporting and file upload, then accounts reconciliation and dashboard viewing. The README documents the domain stages and integrations; the excerpts show ticket generation, email handling, cache operations, role-based report filtering, and browser UI behavior. Because the source is partial, links for other documented features rely on the README rather than inspected implementation.

Main entry points: [`Code.js`](https://github.com/lalitkumarjogi/complain-project/blob/master/Code.js) (Ticket Registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Complaint Intake"]
  node_complaint_form["Complaint Form<br/>[Code.js]"]
  node_ticket["Ticket Registration<br/>[Code.js]"]
  node_confirmation["Email Confirmation<br/>[Code.js]"]
end

subgraph group_service["Service Operations"]
  node_assignment["Engineer Assignment<br/>[Code.js]"]
  node_name_migration["Legacy Name Migration<br/>[Code.js]"]
  node_service_report["Service Reports<br/>[Code.js]"]
  node_file_upload["Photo and Document Upload<br/>[Code.js]"]
  node_drive["Google Drive"]
end

subgraph group_records["Records and Performance"]
  node_sheets[("Google Sheets")]
  node_cache["Chunked Read Cache<br/>[Code.js]"]
  node_reconciliation["Invoice and Payment Records<br/>[Code.js]"]
end

subgraph group_presentation["User Interfaces"]
  node_dashboard["Admin and Accounts Dashboard<br/>[Code.js]"]
  node_status_tracking["Ticket Status Tracking<br/>[Code.js]"]
end

node_customer(("Customer / Client"))
node_coordinator(("Coordinator"))
node_engineer(("Field Engineer"))
node_accounts(("Accounts Team"))
node_email_service["Gmail / Mail"]

node_customer -->|"submits complaint"| node_complaint_form
node_coordinator -->|"submits request"| node_complaint_form
node_complaint_form -->|"registers complaint"| node_ticket
node_ticket -->|"writes complaint"| node_sheets
node_ticket -->|"triggers receipt"| node_confirmation
node_confirmation -->|"sends email"| node_email_service
node_coordinator -->|"assigns engineer"| node_assignment
node_assignment -->|"stores assignment"| node_sheets
node_name_migration -->|"normalizes names"| node_sheets
node_engineer -->|"submits report"| node_service_report
node_service_report -->|"stores report"| node_sheets
node_engineer -->|"uploads files"| node_file_upload
node_file_upload -->|"stores files"| node_drive
node_file_upload -->|"catalogs metadata"| node_sheets
node_dashboard -->|"uses read cache"| node_cache
node_cache -->|"reads cached data"| node_sheets
node_accounts -->|"views records"| node_dashboard
node_dashboard -->|"manages billing"| node_reconciliation
node_reconciliation -->|"stores invoices"| node_sheets
node_customer -->|"tracks ticket"| node_status_tracking
node_status_tracking -->|"reads complaint"| node_sheets

click node_complaint_form "https://github.com/lalitkumarjogi/complain-project/blob/master/Code.js"
click node_ticket "https://github.com/lalitkumarjogi/complain-project/blob/master/Code.js"
click node_confirmation "https://github.com/lalitkumarjogi/complain-project/blob/master/Code.js"
click node_assignment "https://github.com/lalitkumarjogi/complain-project/blob/master/Code.js"
click node_name_migration "https://github.com/lalitkumarjogi/complain-project/blob/master/Code.js"
click node_service_report "https://github.com/lalitkumarjogi/complain-project/blob/master/Code.js"
click node_file_upload "https://github.com/lalitkumarjogi/complain-project/blob/master/Code.js"
click node_cache "https://github.com/lalitkumarjogi/complain-project/blob/master/Code.js"
click node_reconciliation "https://github.com/lalitkumarjogi/complain-project/blob/master/Code.js"
click node_dashboard "https://github.com/lalitkumarjogi/complain-project/blob/master/Code.js"
click node_status_tracking "https://github.com/lalitkumarjogi/complain-project/blob/master/Code.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_complaint_form,node_ticket,node_confirmation,node_customer toneBlue
class node_assignment,node_name_migration,node_service_report,node_file_upload,node_drive toneAmber
class node_sheets,node_cache,node_reconciliation toneMint
class node_dashboard,node_status_tracking toneRose
class node_coordinator,node_engineer,node_accounts,node_email_service toneIndigo
```

## Components

### Complaint Intake

- [Complaint Form](https://github.com/lalitkumarjogi/complain-project/blob/master/Code.js): `Code.js`
- [Ticket Registration](https://github.com/lalitkumarjogi/complain-project/blob/master/Code.js): `Code.js`
- [Email Confirmation](https://github.com/lalitkumarjogi/complain-project/blob/master/Code.js): `Code.js`

### Service Operations

- [Engineer Assignment](https://github.com/lalitkumarjogi/complain-project/blob/master/Code.js): `Code.js`
- [Legacy Name Migration](https://github.com/lalitkumarjogi/complain-project/blob/master/Code.js): `Code.js`
- [Service Reports](https://github.com/lalitkumarjogi/complain-project/blob/master/Code.js): `Code.js`
- [Photo and Document Upload](https://github.com/lalitkumarjogi/complain-project/blob/master/Code.js): `Code.js`
- **Google Drive**

### Records and Performance

- **Google Sheets**
- [Chunked Read Cache](https://github.com/lalitkumarjogi/complain-project/blob/master/Code.js): `Code.js`
- [Invoice and Payment Records](https://github.com/lalitkumarjogi/complain-project/blob/master/Code.js): `Code.js`

### User Interfaces

- [Admin and Accounts Dashboard](https://github.com/lalitkumarjogi/complain-project/blob/master/Code.js): `Code.js`
- [Ticket Status Tracking](https://github.com/lalitkumarjogi/complain-project/blob/master/Code.js): `Code.js`

### Other components

- **Customer / Client**
- **Coordinator**
- **Field Engineer**
- **Accounts Team**
- **Gmail / Mail**

## Connections

- Customer / Client → Complaint Form: submits complaint (evidence: `README.md`)
- Coordinator → Complaint Form: submits request (evidence: `README.md`)
- Complaint Form → Ticket Registration: registers complaint (evidence: `README.md`)
- Ticket Registration → Google Sheets: writes complaint (evidence: `README.md`)
- Ticket Registration → Email Confirmation: triggers receipt (evidence: `README.md`)
- Email Confirmation → Gmail / Mail: sends email (evidence: `README.md`)
- Coordinator → Engineer Assignment: assigns engineer (evidence: `README.md`)
- Engineer Assignment → Google Sheets: stores assignment (evidence: `README.md`)
- Legacy Name Migration → Google Sheets: normalizes names (evidence: `README.md`)
- Field Engineer → Service Reports: submits report (evidence: `README.md`)
- Service Reports → Google Sheets: stores report (evidence: `README.md`)
- Field Engineer → Photo and Document Upload: uploads files (evidence: `README.md`)
- Photo and Document Upload → Google Drive: stores files (evidence: `README.md`)
- Photo and Document Upload → Google Sheets: catalogs metadata (evidence: `README.md`)
- Admin and Accounts Dashboard → Chunked Read Cache: uses read cache (evidence: `README.md`)
- Chunked Read Cache → Google Sheets: reads cached data (evidence: `README.md`)
- Accounts Team → Admin and Accounts Dashboard: views records (evidence: `README.md`)
- Admin and Accounts Dashboard → Invoice and Payment Records: manages billing (evidence: `README.md`)
- Invoice and Payment Records → Google Sheets: stores invoices (evidence: `README.md`)
- Customer / Client → Ticket Status Tracking: tracks ticket (evidence: `README.md`)
- Ticket Status Tracking → Google Sheets: reads complaint (evidence: `README.md`)
