# arunmanikandan-c/ai_sheets_does_mail_workauto architecture

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

- Interactive diagram: https://gitdiagram.com/arunmanikandan-c/ai_sheets_does_mail_workauto
- Repository: https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto

## Overview

Cloud Orchestrator is a browser dashboard backed by FastAPI for authenticated Google Workspace operations. The main workflow is Google sign-in, then browse or create Drive files, edit Docs or Sheets, and view or send Gmail messages; an AI agent provides an additional conversational workflow. The graph reflects documented capabilities and sampled calls; some router and agent details are only partially shown, so uncertain internal wiring is omitted.

Main entry points: [`backend/main.py`](https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/backend/main.py) (FastAPI app), [`frontend/app.js`](https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/frontend/app.js) (App coordinator), [`backend/dependencies.py`](https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/backend/dependencies.py) (Google clients), [`frontend/js/drive.js`](https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/frontend/js/drive.js) (Drive browser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web dashboard"]
  node_dashboard["Dashboard shell<br/>[index.html]"]
  node_app["App coordinator<br/>[app.js]"]
  node_auth["Sign-in<br/>[auth.js]"]
  node_driveui["Drive browser<br/>[drive.js]"]
  node_folders["Folder tree<br/>[folder_tree.js]"]
  node_docsui["Docs actions<br/>[docs.js]"]
  node_sheetsui["Sheets actions<br/>[sheets.js]"]
  node_gmailui["Gmail inbox<br/>[gmail.js]"]
  node_agentui["Agent chat<br/>[agent.js]"]
  node_state["Client state<br/>[state.js]"]
end

subgraph group_api["API backend"]
  node_fastapi["FastAPI app<br/>[main.py]"]
  node_quota["Quota middleware<br/>[rate_limiter.py]"]
  node_systemapi["System routes<br/>[system.py]"]
end

subgraph group_workspace["Workspace services"]
  node_driveapi["Drive routes<br/>[drive.py]"]
  node_docsapi["Docs routes<br/>[docs.py]"]
  node_sheetsapi["Sheets routes<br/>[sheets.py]"]
  node_gmailapi["Gmail routes<br/>[gmail.py]"]
  node_services["Google clients<br/>[dependencies.py]"]
end

subgraph group_assistant["AI assistant"]
  node_agentapi["Agent routes<br/>[agent.py]"]
end

node_user(("Workspace user"))
node_google{{"Google APIs"}}
node_gemini{{"Gemini API"}}
node_firebase{{"Firebase Auth"}}

node_user -->|"opens dashboard"| node_dashboard
node_dashboard -->|"loads interface"| node_app
node_app -->|"initializes sign-in"| node_auth
node_auth -->|"authenticates with"| node_firebase
node_auth -->|"stores token"| node_state
node_app -->|"loads files"| node_driveui
node_app -->|"loads inbox"| node_gmailui
node_app -->|"loads folders"| node_folders
node_app -->|"initializes chat"| node_agentui
node_driveui -->|"requests file list"| node_driveapi
node_folders -->|"requests folders"| node_driveapi
node_driveui -->|"opens document actions"| node_docsui
node_driveui -->|"opens sheet actions"| node_sheetsui
node_docsui -->|"creates or appends"| node_docsapi
node_sheetsui -->|"creates or appends"| node_sheetsapi
node_gmailui -->|"reads or sends mail"| node_gmailapi
node_agentui -->|"sends chat request"| node_agentapi
node_fastapi -->|"limits API requests"| node_quota
node_fastapi -->|"dispatches routes"| node_driveapi
node_fastapi -->|"dispatches routes"| node_docsapi
node_fastapi -->|"dispatches routes"| node_sheetsapi
node_fastapi -->|"dispatches routes"| node_gmailapi
node_fastapi -->|"dispatches routes"| node_agentapi
node_fastapi -->|"dispatches routes"| node_systemapi
node_driveapi -->|"builds API clients"| node_services
node_docsapi -->|"builds API clients"| node_services
node_sheetsapi -->|"builds API clients"| node_services
node_gmailapi -->|"builds API client"| node_services
node_agentapi -->|"builds Workspace clients"| node_services
node_services -->|"calls Workspace APIs"| node_google
node_agentapi -->|"calls model API"| node_gemini

click node_dashboard "https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/frontend/index.html"
click node_app "https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/frontend/app.js"
click node_auth "https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/frontend/js/auth.js"
click node_driveui "https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/frontend/js/drive.js"
click node_folders "https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/frontend/js/folder_tree.js"
click node_docsui "https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/frontend/js/docs.js"
click node_sheetsui "https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/frontend/js/sheets.js"
click node_gmailui "https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/frontend/js/gmail.js"
click node_agentui "https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/frontend/js/agent.js"
click node_state "https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/frontend/js/state.js"
click node_fastapi "https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/backend/main.py"
click node_quota "https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/backend/rate_limiter.py"
click node_driveapi "https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/backend/routers/drive.py"
click node_docsapi "https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/backend/routers/docs.py"
click node_sheetsapi "https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/backend/routers/sheets.py"
click node_gmailapi "https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/backend/routers/gmail.py"
click node_services "https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/backend/dependencies.py"
click node_agentapi "https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/backend/routers/agent.py"
click node_systemapi "https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/backend/routers/system.py"

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_dashboard,node_app,node_auth,node_driveui,node_folders,node_docsui,node_sheetsui,node_gmailui,node_agentui,node_state,node_user toneBlue
class node_fastapi,node_quota,node_systemapi toneAmber
class node_driveapi,node_docsapi,node_sheetsapi,node_gmailapi,node_services,node_google,node_gemini toneMint
class node_agentapi toneRose
class node_firebase toneIndigo
```

## Components

### Web dashboard

- [Dashboard shell](https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/frontend/index.html): `frontend/index.html`
- [App coordinator](https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/frontend/app.js): `frontend/app.js`
- [Sign-in](https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/frontend/js/auth.js): `frontend/js/auth.js`
- [Drive browser](https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/frontend/js/drive.js): `frontend/js/drive.js`
- [Folder tree](https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/frontend/js/folder_tree.js): `frontend/js/folder_tree.js`
- [Docs actions](https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/frontend/js/docs.js): `frontend/js/docs.js`
- [Sheets actions](https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/frontend/js/sheets.js): `frontend/js/sheets.js`
- [Gmail inbox](https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/frontend/js/gmail.js): `frontend/js/gmail.js`
- [Agent chat](https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/frontend/js/agent.js): `frontend/js/agent.js`
- [Client state](https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/frontend/js/state.js): `frontend/js/state.js`

### API backend

- [FastAPI app](https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/backend/main.py): `backend/main.py`
- [Quota middleware](https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/backend/rate_limiter.py): `backend/rate_limiter.py`
- [System routes](https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/backend/routers/system.py): `backend/routers/system.py`

### Workspace services

- [Drive routes](https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/backend/routers/drive.py): `backend/routers/drive.py`
- [Docs routes](https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/backend/routers/docs.py): `backend/routers/docs.py`
- [Sheets routes](https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/backend/routers/sheets.py): `backend/routers/sheets.py`
- [Gmail routes](https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/backend/routers/gmail.py): `backend/routers/gmail.py`
- [Google clients](https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/backend/dependencies.py): `backend/dependencies.py`

### AI assistant

- [Agent routes](https://github.com/arunmanikandan-c/ai_sheets_does_mail_workauto/blob/main/backend/routers/agent.py): `backend/routers/agent.py`

### Other components

- **Workspace user**
- **Google APIs**
- **Gemini API**
- **Firebase Auth**

## Connections

- Workspace user → Dashboard shell: opens dashboard
- Dashboard shell → App coordinator: loads interface
- App coordinator → Sign-in: initializes sign-in
- Sign-in → Firebase Auth: authenticates with
- Sign-in → Client state: stores token
- App coordinator → Drive browser: loads files
- App coordinator → Gmail inbox: loads inbox
- App coordinator → Folder tree: loads folders
- App coordinator → Agent chat: initializes chat
- Drive browser → Drive routes: requests file list
- Folder tree → Drive routes: requests folders
- Drive browser → Docs actions: opens document actions
- Drive browser → Sheets actions: opens sheet actions
- Docs actions → Docs routes: creates or appends
- Sheets actions → Sheets routes: creates or appends
- Gmail inbox → Gmail routes: reads or sends mail
- Agent chat → Agent routes: sends chat request
- FastAPI app → Quota middleware: limits API requests
- FastAPI app → Drive routes: dispatches routes
- FastAPI app → Docs routes: dispatches routes
- FastAPI app → Sheets routes: dispatches routes
- FastAPI app → Gmail routes: dispatches routes
- FastAPI app → Agent routes: dispatches routes
- FastAPI app → System routes: dispatches routes
- Drive routes → Google clients: builds API clients
- Docs routes → Google clients: builds API clients
- Sheets routes → Google clients: builds API clients
- Gmail routes → Google clients: builds API client
- Agent routes → Google clients: builds Workspace clients
- Google clients → Google APIs: calls Workspace APIs
- Agent routes → Gemini API: calls model API
