# imranpathan0603/automomgeneratorforcrm architecture

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

- Interactive diagram: https://gitdiagram.com/imranpathan0603/automomgeneratorforcrm
- Repository: https://github.com/imranpathan0603/automomgeneratorforcrm

## Overview

#### Purpose and Deployment

This repository delivers an embedded Zoho CRM widget that turns a meeting transcript into AI-generated Minutes of Meeting (MOM), previews it in an A4-oriented interface, and distributes it as a PDF. The packaged Zoho artifact is `dist/automom.zip`; widget metadata is defined in `plugin-manifest.json`.

#### Runtime Entry Points

The browser widget is rooted at `app/index.html`, with presentation in `app/css/style.css` and nearly all client-side orchestration in `app/js/script.js`. It runs inside the Zoho CRM widget runtime and depends on Zoho SDK APIs plus browser-side PDF/rendering libraries referenced by the UI.

A separate Node service entry point exists at `server/index.js`; repository-level Node dependencies and scripts are defined by `package.json`.

#### Widget UI and State Boundary

`app/index.html` defines the workflow-facing surfaces: transcript/MOM controls, style selection, A4 preview, zoom/full-screen controls, and output actions. `app/js/script.js` owns UI state and transitions between input, generated MOM, preview, and export/distribution actions. `app/css/style.css` establishes the editable/printable preview presentation.

The important boundary is between browser-rendered MOM content and CRM-side operations: the widget presents and prepares document data, while Zoho functions/services supply transcripts and perform CRM/WorkDrive actions.

#### Transcript-to-MOM Generation Flow

The primary control flow begins from the current CRM meeting context, retrieves its transcript through configured Zoho CRM functions, and submits transcript content to Claude AI for generation. The selected MOM mode—points, summary, or detailed—controls the AI request/prompt and resulting document format.

Implementation is concentrated in:
- `app/js/script.js`
- `app/index.html`
- `plugin-manifest.json`

Claude AI is an external AI service; its key/call is expected to be mediated by configured CRM function infrastructure rather than exposed as a standalone frontend service in the tree.

#### Preview and PDF Production

Generated MOM text is inserted into the live A4 preview, where users can inspect, zoom, fit, reset, or expand the document before output. PDF generation renders this DOM-oriented preview using html2canvas and jsPDF, then produces a binary/file representation suitable for local download or Zoho upload flows.

Core paths:
- `app/index.html`
- `app/js/script.js`
- `app/css/style.css`

#### CRM Distribution and WorkDrive

After PDF generation, the widget supports four destinations: direct download, CRM attachment, email, and Zoho WorkDrive. Email flow creates/attaches a temporary PDF, invokes a CRM email function, then cleans up the temporary attachment. WorkDrive flow supports browsing folders, creating a folder, selecting a destination, and copying/saving the PDF.

These operations cross from the client widget into Zoho CRM custom functions and WorkDrive APIs; their identifiers are deployment configuration, not separate local implementations. Relevant packaging/runtime files are:
- `app/js/script.js`
- `plugin-manifest.json`
- `dist/automom.zip`

#### Infrastructure and Release Artifacts

The frontend is static HTML/CSS/JavaScript packaged for Zoho. Node runtime material is present in `server/index.js`, with `package.json` and `package-lock.json` controlling its dependencies. TLS certificate/key files (`cert.pem`, `key.pem`) indicate the server may be intended for HTTPS local or hosted integration use. The deployable widget bundle is `dist/automom.zip`.

Main entry points: [`app/js/script.js`](https://github.com/imranpathan0603/automomgeneratorforcrm/blob/main/app/js/script.js) (Workflow controller), [`app/index.html`](https://github.com/imranpathan0603/automomgeneratorforcrm/blob/main/app/index.html) (Live A4 preview), [`dist/automom.zip`](https://github.com/imranpathan0603/automomgeneratorforcrm/blob/main/dist/automom.zip) (Deployable bundle), [`app/css/style.css`](https://github.com/imranpathan0603/automomgeneratorforcrm/blob/main/app/css/style.css) (Preview styles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_widget["Zoho Widget"]
  node_widget_html["Widget UI<br/>HTML entry<br/>[index.html]"]
  node_widget_state["Workflow controller<br/>client orchestration<br/>[script.js]"]
  node_widget_styles["Preview styles<br/>CSS<br/>[style.css]"]
  node_mom_document["Generated MOM<br/>document state"]
  node_a4_preview["Live A4 preview<br/>DOM preview<br/>[index.html]"]
  node_pdf_renderer["PDF renderer<br/>browser libraries<br/>[script.js]"]
end

subgraph group_zoho["Zoho Services"]
  node_zoho_runtime{{"Zoho CRM widget runtime<br/>host SDK"}}
  node_meeting_context[("Current meeting context<br/>CRM record")]
  node_crm_functions{{"CRM custom functions<br/>configured backend"}}
  node_workdrive[("Zoho WorkDrive<br/>file API")]
end

subgraph group_server["Node Service"]
  node_node_service["Service entry<br/>Node.js server<br/>[index.js]"]
  node_node_package["Node dependencies<br/>package manifest<br/>[package.json]"]
end

subgraph group_release["Packaging"]
  node_widget_manifest["Widget manifest<br/>Zoho metadata"]
  node_widget_bundle["Deployable bundle<br/>Zoho artifact<br/>[automom.zip]"]
end

node_claude{{"Claude AI<br/>external AI service"}}
node_pdf_file["PDF output<br/>binary document"]

node_zoho_runtime -->|"hosts"| node_widget_html
node_widget_html -->|"user actions"| node_widget_state
node_widget_styles -->|"styles"| node_a4_preview
node_widget_state -->|"uses SDK"| node_zoho_runtime
node_widget_state -->|"reads context"| node_meeting_context
node_widget_state -->|"invokes"| node_crm_functions
node_crm_functions -->|"mediates request"| node_claude
node_claude -->|"generated minutes"| node_mom_document
node_widget_state -->|"selects mode"| node_mom_document
node_mom_document -->|"renders into"| node_a4_preview
node_widget_state -->|"controls view"| node_a4_preview
node_a4_preview -->|"DOM capture"| node_pdf_renderer
node_pdf_renderer -->|"produces"| node_pdf_file
node_pdf_file -->|"attach or email"| node_crm_functions
node_pdf_file -->|"save or copy"| node_workdrive
node_widget_html -->|"packaged in"| node_widget_bundle
node_widget_state -->|"packaged in"| node_widget_bundle
node_widget_styles -->|"packaged in"| node_widget_bundle
node_widget_manifest -->|"defines package"| node_widget_bundle
node_node_package -->|"dependencies and scripts"| node_node_service

click node_widget_html "https://github.com/imranpathan0603/automomgeneratorforcrm/blob/main/app/index.html"
click node_widget_state "https://github.com/imranpathan0603/automomgeneratorforcrm/blob/main/app/js/script.js"
click node_widget_styles "https://github.com/imranpathan0603/automomgeneratorforcrm/blob/main/app/css/style.css"
click node_a4_preview "https://github.com/imranpathan0603/automomgeneratorforcrm/blob/main/app/index.html"
click node_pdf_renderer "https://github.com/imranpathan0603/automomgeneratorforcrm/blob/main/app/js/script.js"
click node_node_service "https://github.com/imranpathan0603/automomgeneratorforcrm/blob/main/server/index.js"
click node_node_package "https://github.com/imranpathan0603/automomgeneratorforcrm/blob/main/package.json"
click node_widget_manifest "https://github.com/imranpathan0603/automomgeneratorforcrm/blob/main/plugin-manifest.json"
click node_widget_bundle "https://github.com/imranpathan0603/automomgeneratorforcrm/blob/main/dist/automom.zip"

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_widget_html,node_widget_state,node_widget_styles,node_mom_document,node_a4_preview,node_pdf_renderer toneBlue
class node_zoho_runtime,node_meeting_context,node_crm_functions,node_workdrive toneAmber
class node_node_service,node_node_package toneMint
class node_widget_manifest,node_widget_bundle toneRose
class node_claude,node_pdf_file toneNeutral
```

## Components

### Zoho Widget

Static browser application running inside Zoho CRM.

- [Widget UI](https://github.com/imranpathan0603/automomgeneratorforcrm/blob/main/app/index.html): HTML entry · Defines controls, A4 preview, and output surfaces. · `app/index.html`
- [Workflow controller](https://github.com/imranpathan0603/automomgeneratorforcrm/blob/main/app/js/script.js): client orchestration · Manages UI state, generation, preview, export, and distribution. · `app/js/script.js`
- [Preview styles](https://github.com/imranpathan0603/automomgeneratorforcrm/blob/main/app/css/style.css): CSS · Provides editable and printable A4 presentation. · `app/css/style.css`
- **Generated MOM**: document state · Points, summary, or detailed meeting minutes rendered into the preview.
- [Live A4 preview](https://github.com/imranpathan0603/automomgeneratorforcrm/blob/main/app/index.html): DOM preview · Supports inspection, zoom, fit, reset, and full-screen viewing. · `app/index.html`
- [PDF renderer](https://github.com/imranpathan0603/automomgeneratorforcrm/blob/main/app/js/script.js): browser libraries · Uses html2canvas and jsPDF to turn the DOM preview into a PDF. · `app/js/script.js`

### Zoho Services

Configured CRM functions and WorkDrive APIs.

- **Zoho CRM widget runtime**: host SDK
- **Current meeting context**: CRM record
- **CRM custom functions**: configured backend · Retrieves transcripts and performs CRM-side actions including AI mediation.
- **Zoho WorkDrive**: file API · Browses, creates, and selects destination folders for PDFs.

### Node Service

Separate HTTPS-capable Node runtime.

- [Service entry](https://github.com/imranpathan0603/automomgeneratorforcrm/blob/main/server/index.js): Node.js server · Separate service runtime, potentially HTTPS-enabled. · `server/index.js`
- [Node dependencies](https://github.com/imranpathan0603/automomgeneratorforcrm/blob/main/package.json): package manifest · `package.json`

### Packaging

- [Widget manifest](https://github.com/imranpathan0603/automomgeneratorforcrm/blob/main/plugin-manifest.json): Zoho metadata · Defines widget metadata and deployment configuration. · `plugin-manifest.json`
- [Deployable bundle](https://github.com/imranpathan0603/automomgeneratorforcrm/blob/main/dist/automom.zip): Zoho artifact · Packaged widget artifact. · `dist/automom.zip`

### Other components

- **Claude AI**: external AI service · Generates MOM content for the selected mode.
- **PDF output**: binary document · Used for download and Zoho distribution destinations.

## Connections

- Zoho CRM widget runtime → Widget UI: hosts
- Widget UI → Workflow controller: user actions
- Preview styles → Live A4 preview: styles
- Workflow controller → Zoho CRM widget runtime: uses SDK
- Workflow controller → Current meeting context: reads context
- Workflow controller → CRM custom functions: invokes
- CRM custom functions → Claude AI: mediates request
- Claude AI → Generated MOM: generated minutes
- Workflow controller → Generated MOM: selects mode
- Generated MOM → Live A4 preview: renders into
- Workflow controller → Live A4 preview: controls view
- Live A4 preview → PDF renderer: DOM capture
- PDF renderer → PDF output: produces
- PDF output → CRM custom functions: attach or email
- PDF output → Zoho WorkDrive: save or copy
- Widget UI → Deployable bundle: packaged in
- Workflow controller → Deployable bundle: packaged in
- Preview styles → Deployable bundle: packaged in
- Widget manifest → Deployable bundle: defines package
- Node dependencies → Service entry: dependencies and scripts
