# facuavero/telar architecture

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

- Interactive diagram: https://gitdiagram.com/facuavero/telar
- Repository: https://github.com/facuavero/telar

## Overview

Telar is a workflow-automation product: users configure automations and integrations in the web app, then trigger runs manually, by webhook, on a schedule, or from Gmail. The Worker authorizes requests, executes steps, and records results; Gmail, Slack, and Gemini provide integrations. The desktop app is a wrapper around the web app. The README is empty, and several frontend and Worker modules were only partially sampled, so the graph omits unverified connections rather than inferring them.

Main entry points: [`worker/index.js`](https://github.com/facuavero/telar/blob/master/worker/index.js) (HTTP and trigger routes), [`worker/motor.js`](https://github.com/facuavero/telar/blob/master/worker/motor.js) (Workflow execution), [`worker/slack.js`](https://github.com/facuavero/telar/blob/master/worker/slack.js) (Slack integration), [`worker/gmail.js`](https://github.com/facuavero/telar/blob/master/worker/gmail.js) (Gmail integration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_webapp["Automation interface<br/>[app.js]"]
  node_appdata["App data access<br/>[datos.js]"]
  node_auth["Web authentication<br/>[auth.js]"]
  node_desktop["Desktop wrapper<br/>[main.js]"]
end

subgraph group_runtime["Automation runtime"]
  node_worker["HTTP and trigger routes<br/>[index.js]"]
  node_engine["Workflow execution<br/>[motor.js]"]
  node_scheduler["Schedule interpretation<br/>[programado.js]"]
end

subgraph group_integrations["Integrations"]
  node_gmail["Gmail integration<br/>[gmail.js]"]
  node_slack["Slack integration<br/>[slack.js]"]
  node_ai["AI step<br/>[ia.js]"]
end

subgraph group_persistence["Persistence and security"]
  node_crypto["Signing and encryption<br/>[cripto.js]"]
  node_dbadapter["Supabase access<br/>[supabase.js]"]
  node_schema["Application data schema<br/>[schema.sql]"]
end

node_user(("User"))
node_supabase[("Supabase service")]
node_google["Google APIs"]
node_slackservice["Slack API"]
node_gemini["Gemini API"]
node_browser(("Browser"))

node_user -->|"configures workflows"| node_webapp
node_webapp -->|"loads and saves"| node_appdata
node_browser -.->|"authenticates"| node_auth
node_desktop -->|"loads web app"| node_webapp
node_worker -->|"runs automation"| node_engine
node_worker -.->|"checks schedule"| node_scheduler
node_worker -->|"authorizes and reads"| node_dbadapter
node_worker -->|"signs and validates"| node_crypto
node_worker -->|"handles OAuth"| node_gmail
node_worker -->|"handles OAuth"| node_slack
node_engine -->|"requests AI step"| node_ai
node_engine -.->|"uses mail actions"| node_gmail
node_engine -->|"sends messages"| node_slack
node_engine -.->|"stores run data"| node_dbadapter
node_gmail -->|"encrypts tokens"| node_crypto
node_gmail -->|"reads and updates connections"| node_dbadapter
node_slack -->|"encrypts tokens"| node_crypto
node_slack -->|"reads and writes connections"| node_dbadapter
node_dbadapter -->|"reads and writes"| node_supabase
node_google -.->|"OAuth and mail API"| node_gmail
node_slack -->|"calls API"| node_slackservice
node_ai -->|"requests generation"| node_gemini

click node_webapp "https://github.com/facuavero/telar/blob/master/diseno/app/app.js"
click node_appdata "https://github.com/facuavero/telar/blob/master/diseno/app/datos.js"
click node_auth "https://github.com/facuavero/telar/blob/master/diseno/auth.js"
click node_desktop "https://github.com/facuavero/telar/blob/master/desktop/main.js"
click node_worker "https://github.com/facuavero/telar/blob/master/worker/index.js"
click node_engine "https://github.com/facuavero/telar/blob/master/worker/motor.js"
click node_scheduler "https://github.com/facuavero/telar/blob/master/worker/programado.js"
click node_gmail "https://github.com/facuavero/telar/blob/master/worker/gmail.js"
click node_slack "https://github.com/facuavero/telar/blob/master/worker/slack.js"
click node_ai "https://github.com/facuavero/telar/blob/master/worker/ia.js"
click node_crypto "https://github.com/facuavero/telar/blob/master/worker/cripto.js"
click node_dbadapter "https://github.com/facuavero/telar/blob/master/worker/supabase.js"
click node_schema "https://github.com/facuavero/telar/blob/master/db/schema.sql"

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_appdata,node_auth,node_desktop,node_user,node_browser toneBlue
class node_worker,node_engine,node_scheduler,node_supabase toneAmber
class node_gmail,node_slack,node_ai,node_google,node_slackservice,node_gemini toneMint
class node_crypto,node_dbadapter,node_schema toneRose
```

## Components

### Web application

- [Automation interface](https://github.com/facuavero/telar/blob/master/diseno/app/app.js): `diseno/app/app.js`
- [App data access](https://github.com/facuavero/telar/blob/master/diseno/app/datos.js): `diseno/app/datos.js`
- [Web authentication](https://github.com/facuavero/telar/blob/master/diseno/auth.js): `diseno/auth.js`
- [Desktop wrapper](https://github.com/facuavero/telar/blob/master/desktop/main.js): `desktop/main.js`

### Automation runtime

- [HTTP and trigger routes](https://github.com/facuavero/telar/blob/master/worker/index.js): `worker/index.js`
- [Workflow execution](https://github.com/facuavero/telar/blob/master/worker/motor.js): `worker/motor.js`
- [Schedule interpretation](https://github.com/facuavero/telar/blob/master/worker/programado.js): `worker/programado.js`

### Integrations

- [Gmail integration](https://github.com/facuavero/telar/blob/master/worker/gmail.js): `worker/gmail.js`
- [Slack integration](https://github.com/facuavero/telar/blob/master/worker/slack.js): `worker/slack.js`
- [AI step](https://github.com/facuavero/telar/blob/master/worker/ia.js): `worker/ia.js`

### Persistence and security

- [Signing and encryption](https://github.com/facuavero/telar/blob/master/worker/cripto.js): `worker/cripto.js`
- [Supabase access](https://github.com/facuavero/telar/blob/master/worker/supabase.js): `worker/supabase.js`
- [Application data schema](https://github.com/facuavero/telar/blob/master/db/schema.sql): `db/schema.sql`

### Other components

- **User**
- **Supabase service**
- **Google APIs**
- **Slack API**
- **Gemini API**
- **Browser**

## Connections

- User → Automation interface: configures workflows (evidence: `diseno/app/app.js`)
- Automation interface → App data access: loads and saves (evidence: `diseno/app/app.js`)
- Browser → Web authentication: authenticates
- Desktop wrapper → Automation interface: loads web app (evidence: `desktop/main.js`)
- HTTP and trigger routes → Workflow execution: runs automation (evidence: `worker/index.js`)
- HTTP and trigger routes → Schedule interpretation: checks schedule (evidence: `worker/index.js`)
- HTTP and trigger routes → Supabase access: authorizes and reads (evidence: `worker/index.js`)
- HTTP and trigger routes → Signing and encryption: signs and validates (evidence: `worker/index.js`)
- HTTP and trigger routes → Gmail integration: handles OAuth (evidence: `worker/index.js`)
- HTTP and trigger routes → Slack integration: handles OAuth (evidence: `worker/index.js`)
- Workflow execution → AI step: requests AI step (evidence: `worker/motor.js`)
- Workflow execution → Gmail integration: uses mail actions (evidence: `worker/motor.js`)
- Workflow execution → Slack integration: sends messages (evidence: `worker/motor.js`)
- Workflow execution → Supabase access: stores run data (evidence: `worker/motor.js`)
- Gmail integration → Signing and encryption: encrypts tokens (evidence: `worker/gmail.js`)
- Gmail integration → Supabase access: reads and updates connections (evidence: `worker/gmail.js`)
- Slack integration → Signing and encryption: encrypts tokens (evidence: `worker/slack.js`)
- Slack integration → Supabase access: reads and writes connections (evidence: `worker/slack.js`)
- Supabase access → Supabase service: reads and writes (evidence: `worker/supabase.js`)
- Google APIs → Gmail integration: OAuth and mail API
- Slack integration → Slack API: calls API (evidence: `worker/slack.js`)
- AI step → Gemini API: requests generation (evidence: `worker/ia.js`)
