# dazbot13-max/dazbot-officiel architecture

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

- Interactive diagram: https://gitdiagram.com/dazbot13-max/dazbot-officiel
- Repository: https://github.com/dazbot13-max/dazbot-officiel

## Overview

DazBot is a Node.js WhatsApp linked-device bot. Users interact through WhatsApp commands and messages; `index.js` is the central runtime that handles status automation, dispatches features, and sends results back through the WhatsApp connection. Other major workflows recover deleted messages, schedule messages or statuses, and generate personality-based AI replies. The README also documents media downloads, group mentions, and website screenshots. The map follows documented capabilities and sampled module behavior; wiring for features whose dispatch code was not sampled is left out where uncertain.

Main entry points: [`index.js`](https://github.com/dazbot13-max/dazbot-officiel/blob/main/index.js) (Bot runtime), [`scheduler.js`](https://github.com/dazbot13-max/dazbot-officiel/blob/main/scheduler.js) (Task scheduler), [`aiService.js`](https://github.com/dazbot13-max/dazbot-officiel/blob/main/aiService.js) (AI service), [`downloaders.js`](https://github.com/dazbot13-max/dazbot-officiel/blob/main/downloaders.js) (Platform downloads)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_wa["WhatsApp runtime"]
  node_runtime["Bot runtime<br/>[index.js]"]
  node_config["Bot configuration<br/>[config.js]"]
end

subgraph group_automation["Automation features"]
  node_status["Status reactions<br/>[index.js]"]
  node_recovery["Deleted-message recovery<br/>[antidelete.js]"]
  node_scheduler["Task scheduler<br/>[scheduler.js]"]
end

subgraph group_ai["AI replies"]
  node_ai["AI service<br/>[aiService.js]"]
  node_personality["Bot personality<br/>[personality.json]"]
end

subgraph group_tools["Media and tools"]
  node_downloads["Platform downloads<br/>[downloaders.js]"]
  node_facebook["Facebook download<br/>[facebook.js]"]
  node_screenshot["Website screenshot<br/>[screenshot.js]"]
  node_tagall["Group mentions<br/>[tagall.js]"]
end

subgraph group_state["Persistent state"]
  node_taskstore["Scheduled tasks"]
  node_auth["WhatsApp auth storage<br/>[supabaseAuth.js]"]
end

node_user(("WhatsApp user"))
node_whatsapp{{"WhatsApp"}}
node_aiapi{{"AI providers"}}
node_supabase[("Supabase")]
node_mediaapis{{"Media services"}}

node_user -->|"sends commands"| node_whatsapp
node_whatsapp -->|"delivers events"| node_runtime
node_runtime -->|"sends replies"| node_whatsapp
node_runtime -->|"reads settings"| node_config
node_runtime -->|"handles statuses"| node_status
node_runtime -->|"dispatches messages"| node_recovery
node_recovery -->|"sends reports"| node_whatsapp
node_runtime -->|"manages tasks"| node_scheduler
node_scheduler -->|"loads and saves"| node_taskstore
node_scheduler -->|"sends scheduled posts"| node_whatsapp
node_runtime -->|"requests replies"| node_ai
node_ai -->|"loads style"| node_personality
node_ai -->|"requests completion"| node_aiapi
node_runtime -->|"provides auth storage"| node_auth
node_auth -->|"reads and writes session"| node_supabase
node_runtime -->|"dispatches download"| node_downloads
node_runtime -->|"dispatches download"| node_facebook
node_runtime -->|"dispatches capture"| node_screenshot
node_runtime -->|"dispatches mentions"| node_tagall
node_downloads -->|"retrieves media"| node_mediaapis
node_facebook -->|"retrieves video"| node_mediaapis
node_screenshot -->|"requests capture"| node_mediaapis
node_downloads -->|"sends media"| node_whatsapp
node_facebook -->|"sends video"| node_whatsapp
node_screenshot -->|"sends screenshot"| node_whatsapp
node_tagall -->|"sends mentions"| node_whatsapp

click node_runtime "https://github.com/dazbot13-max/dazbot-officiel/blob/main/index.js"
click node_config "https://github.com/dazbot13-max/dazbot-officiel/blob/main/config.js"
click node_status "https://github.com/dazbot13-max/dazbot-officiel/blob/main/index.js"
click node_recovery "https://github.com/dazbot13-max/dazbot-officiel/blob/main/antidelete.js"
click node_scheduler "https://github.com/dazbot13-max/dazbot-officiel/blob/main/scheduler.js"
click node_taskstore "https://github.com/dazbot13-max/dazbot-officiel/blob/main/scheduled_tasks.json"
click node_ai "https://github.com/dazbot13-max/dazbot-officiel/blob/main/aiService.js"
click node_personality "https://github.com/dazbot13-max/dazbot-officiel/blob/main/personality.json"
click node_auth "https://github.com/dazbot13-max/dazbot-officiel/blob/main/supabaseAuth.js"
click node_downloads "https://github.com/dazbot13-max/dazbot-officiel/blob/main/downloaders.js"
click node_facebook "https://github.com/dazbot13-max/dazbot-officiel/blob/main/facebook.js"
click node_screenshot "https://github.com/dazbot13-max/dazbot-officiel/blob/main/screenshot.js"
click node_tagall "https://github.com/dazbot13-max/dazbot-officiel/blob/main/tagall.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_runtime,node_config,node_user toneBlue
class node_status,node_recovery,node_scheduler,node_supabase toneAmber
class node_ai,node_personality toneMint
class node_downloads,node_facebook,node_screenshot,node_tagall toneRose
class node_taskstore,node_auth,node_whatsapp,node_aiapi,node_mediaapis toneIndigo
```

## Components

### WhatsApp runtime

- [Bot runtime](https://github.com/dazbot13-max/dazbot-officiel/blob/main/index.js): `index.js`
- [Bot configuration](https://github.com/dazbot13-max/dazbot-officiel/blob/main/config.js): `config.js`

### Automation features

- [Status reactions](https://github.com/dazbot13-max/dazbot-officiel/blob/main/index.js): `index.js`
- [Deleted-message recovery](https://github.com/dazbot13-max/dazbot-officiel/blob/main/antidelete.js): `antidelete.js`
- [Task scheduler](https://github.com/dazbot13-max/dazbot-officiel/blob/main/scheduler.js): `scheduler.js`

### AI replies

- [AI service](https://github.com/dazbot13-max/dazbot-officiel/blob/main/aiService.js): `aiService.js`
- [Bot personality](https://github.com/dazbot13-max/dazbot-officiel/blob/main/personality.json): `personality.json`

### Media and tools

- [Platform downloads](https://github.com/dazbot13-max/dazbot-officiel/blob/main/downloaders.js): `downloaders.js`
- [Facebook download](https://github.com/dazbot13-max/dazbot-officiel/blob/main/facebook.js): `facebook.js`
- [Website screenshot](https://github.com/dazbot13-max/dazbot-officiel/blob/main/screenshot.js): `screenshot.js`
- [Group mentions](https://github.com/dazbot13-max/dazbot-officiel/blob/main/tagall.js): `tagall.js`

### Persistent state

- [Scheduled tasks](https://github.com/dazbot13-max/dazbot-officiel/blob/main/scheduled_tasks.json): `scheduled_tasks.json`
- [WhatsApp auth storage](https://github.com/dazbot13-max/dazbot-officiel/blob/main/supabaseAuth.js): `supabaseAuth.js`

### Other components

- **WhatsApp user**
- **WhatsApp**
- **AI providers**
- **Supabase**
- **Media services**

## Connections

- WhatsApp user → WhatsApp: sends commands
- WhatsApp → Bot runtime: delivers events
- Bot runtime → WhatsApp: sends replies
- Bot runtime → Bot configuration: reads settings
- Bot runtime → Status reactions: handles statuses
- Bot runtime → Deleted-message recovery: dispatches messages
- Deleted-message recovery → WhatsApp: sends reports
- Bot runtime → Task scheduler: manages tasks
- Task scheduler → Scheduled tasks: loads and saves
- Task scheduler → WhatsApp: sends scheduled posts
- Bot runtime → AI service: requests replies
- AI service → Bot personality: loads style
- AI service → AI providers: requests completion
- Bot runtime → WhatsApp auth storage: provides auth storage
- WhatsApp auth storage → Supabase: reads and writes session
- Bot runtime → Platform downloads: dispatches download
- Bot runtime → Facebook download: dispatches download
- Bot runtime → Website screenshot: dispatches capture
- Bot runtime → Group mentions: dispatches mentions
- Platform downloads → Media services: retrieves media
- Facebook download → Media services: retrieves video
- Website screenshot → Media services: requests capture
- Platform downloads → WhatsApp: sends media
- Facebook download → WhatsApp: sends video
- Website screenshot → WhatsApp: sends screenshot
- Group mentions → WhatsApp: sends mentions
