# henrygokugt99/daima-md architecture

> Architecture diagram of the GitHub repository henrygokugt99/daima-md, 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/henrygokugt99/daima-md
- Repository: https://github.com/henrygokugt99/daima-md

## Overview

DAIMA MD is a WhatsApp automation bot. Its main runtime handles incoming messages and group events, while registered commands provide user-facing features and moderation; persistent policy and rank data support those features. The README documents session-based setup and warns about WhatsApp account risks, but does not describe command loading or most feature behavior. The map distinguishes evidenced calls and references from connections that remain uncertain because source files were not sampled.

Main entry points: [`flash.js`](https://github.com/henrygokugt99/daima-md/blob/main/flash.js) (Message Runtime), [`framework/zokou.js`](https://github.com/henrygokugt99/daima-md/blob/main/framework/zokou.js) (Command Registry), [`commandes/groupe.js`](https://github.com/henrygokugt99/daima-md/blob/main/commandes/groupe.js) (Group Commands), [`bdd/antilien.js`](https://github.com/henrygokugt99/daima-md/blob/main/bdd/antilien.js) (Anti-link Policy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Bot Runtime"]
  node_message_runtime["Message Runtime<br/>[flash.js]"]
  node_command_registry["Command Registry<br/>[zokou.js]"]
end

subgraph group_commands["Commands"]
  node_group_commands["Group Commands<br/>[groupe.js]"]
  node_admin_commands["Admin Commands<br/>[Mods.js]"]
  node_feature_commands["Feature Commands"]
  node_youtube_download["YouTube Downloads<br/>[yt-search.js]"]
  node_rank_commands["Rank Commands<br/>[rank.js]"]
end

subgraph group_moderation["Moderation State"]
  node_anti_link["Anti-link Policy<br/>[antilien.js]"]
  node_anti_bot["Anti-bot Policy<br/>[antibot.js]"]
  node_ban_lists["Ban Lists"]
  node_access_lists["Sudo Access<br/>[sudo.js]"]
  node_warnings["Warnings<br/>[warn.js]"]
  node_welcome["Welcome Settings<br/>[welcome.js]"]
  node_rank_data[("Rank Data<br/>[level.js]")]
end

subgraph group_support["Shared Services"]
  node_configuration["Bot Configuration<br/>[set.js]"]
  node_download_helpers["Download Helpers<br/>[Function.js]"]
  node_text_styling["Text Styling<br/>[stylish-font.js]"]
end

node_user(("WhatsApp User"))
node_whatsapp(("WhatsApp"))
node_postgres[("PostgreSQL")]

node_user -->|"sends messages"| node_whatsapp
node_whatsapp -.->|"delivers events"| node_message_runtime
node_message_runtime -->|"sends replies"| node_whatsapp
node_group_commands -->|"registers commands"| node_command_registry
node_admin_commands -->|"registers commands"| node_command_registry
node_youtube_download -->|"registers commands"| node_command_registry
node_rank_commands -->|"registers commands"| node_command_registry
node_group_commands -->|"reads policy"| node_anti_link
node_group_commands -->|"reads policy"| node_anti_bot
node_group_commands -.->|"handles group actions"| node_message_runtime
node_message_runtime -->|"checks policy"| node_anti_link
node_message_runtime -->|"checks policy"| node_anti_bot
node_message_runtime -->|"checks bans"| node_ban_lists
node_message_runtime -->|"checks access"| node_access_lists
node_message_runtime -->|"uses warnings"| node_warnings
node_message_runtime -->|"uses settings"| node_welcome
node_message_runtime -->|"updates rank"| node_rank_data
node_rank_commands -->|"reads rank"| node_rank_data
node_anti_link -->|"reads and writes"| node_postgres
node_anti_bot -->|"reads and writes"| node_postgres
node_rank_data -->|"reads and writes"| node_postgres
node_anti_link -->|"loads settings"| node_configuration
node_anti_bot -->|"loads settings"| node_configuration
node_rank_data -->|"loads settings"| node_configuration
node_youtube_download -.->|"uses helpers"| node_download_helpers
node_feature_commands -.->|"registers commands"| node_command_registry
node_text_styling -.->|"uses settings"| node_configuration

click node_message_runtime "https://github.com/henrygokugt99/daima-md/blob/main/flash.js"
click node_command_registry "https://github.com/henrygokugt99/daima-md/blob/main/framework/zokou.js"
click node_group_commands "https://github.com/henrygokugt99/daima-md/blob/main/commandes/groupe.js"
click node_admin_commands "https://github.com/henrygokugt99/daima-md/blob/main/commandes/Mods.js"
click node_feature_commands "https://github.com/henrygokugt99/daima-md/tree/main/commandes"
click node_anti_link "https://github.com/henrygokugt99/daima-md/blob/main/bdd/antilien.js"
click node_anti_bot "https://github.com/henrygokugt99/daima-md/blob/main/bdd/antibot.js"
click node_ban_lists "https://github.com/henrygokugt99/daima-md/tree/main/bdd"
click node_access_lists "https://github.com/henrygokugt99/daima-md/blob/main/bdd/sudo.js"
click node_warnings "https://github.com/henrygokugt99/daima-md/blob/main/bdd/warn.js"
click node_welcome "https://github.com/henrygokugt99/daima-md/blob/main/bdd/welcome.js"
click node_rank_data "https://github.com/henrygokugt99/daima-md/blob/main/bdd/level.js"
click node_configuration "https://github.com/henrygokugt99/daima-md/blob/main/set.js"
click node_download_helpers "https://github.com/henrygokugt99/daima-md/blob/main/framework/dl/Function.js"
click node_youtube_download "https://github.com/henrygokugt99/daima-md/blob/main/commandes/yt-search.js"
click node_rank_commands "https://github.com/henrygokugt99/daima-md/blob/main/commandes/rank.js"
click node_text_styling "https://github.com/henrygokugt99/daima-md/blob/main/framework/stylish-font.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_message_runtime,node_command_registry,node_user toneBlue
class node_group_commands,node_admin_commands,node_feature_commands,node_youtube_download,node_rank_commands,node_postgres toneAmber
class node_anti_link,node_anti_bot,node_ban_lists,node_access_lists,node_warnings,node_welcome,node_rank_data toneMint
class node_configuration,node_download_helpers,node_text_styling toneRose
class node_whatsapp toneIndigo
```

## Components

### Bot Runtime

- [Message Runtime](https://github.com/henrygokugt99/daima-md/blob/main/flash.js): `flash.js`
- [Command Registry](https://github.com/henrygokugt99/daima-md/blob/main/framework/zokou.js): `framework/zokou.js`

### Commands

- [Group Commands](https://github.com/henrygokugt99/daima-md/blob/main/commandes/groupe.js): `commandes/groupe.js`
- [Admin Commands](https://github.com/henrygokugt99/daima-md/blob/main/commandes/Mods.js): `commandes/Mods.js`
- [Feature Commands](https://github.com/henrygokugt99/daima-md/tree/main/commandes): `commandes`
- [YouTube Downloads](https://github.com/henrygokugt99/daima-md/blob/main/commandes/yt-search.js): `commandes/yt-search.js`
- [Rank Commands](https://github.com/henrygokugt99/daima-md/blob/main/commandes/rank.js): `commandes/rank.js`

### Moderation State

- [Anti-link Policy](https://github.com/henrygokugt99/daima-md/blob/main/bdd/antilien.js): `bdd/antilien.js`
- [Anti-bot Policy](https://github.com/henrygokugt99/daima-md/blob/main/bdd/antibot.js): `bdd/antibot.js`
- [Ban Lists](https://github.com/henrygokugt99/daima-md/tree/main/bdd): `bdd`
- [Sudo Access](https://github.com/henrygokugt99/daima-md/blob/main/bdd/sudo.js): `bdd/sudo.js`
- [Warnings](https://github.com/henrygokugt99/daima-md/blob/main/bdd/warn.js): `bdd/warn.js`
- [Welcome Settings](https://github.com/henrygokugt99/daima-md/blob/main/bdd/welcome.js): `bdd/welcome.js`
- [Rank Data](https://github.com/henrygokugt99/daima-md/blob/main/bdd/level.js): `bdd/level.js`

### Shared Services

- [Bot Configuration](https://github.com/henrygokugt99/daima-md/blob/main/set.js): `set.js`
- [Download Helpers](https://github.com/henrygokugt99/daima-md/blob/main/framework/dl/Function.js): `framework/dl/Function.js`
- [Text Styling](https://github.com/henrygokugt99/daima-md/blob/main/framework/stylish-font.js): `framework/stylish-font.js`

### Other components

- **WhatsApp User**
- **WhatsApp**
- **PostgreSQL**

## Connections

- WhatsApp User → WhatsApp: sends messages
- WhatsApp → Message Runtime: delivers events
- Message Runtime → WhatsApp: sends replies (evidence: `flash.js`)
- Group Commands → Command Registry: registers commands (evidence: `commandes/groupe.js`)
- Admin Commands → Command Registry: registers commands (evidence: `commandes/Mods.js`)
- YouTube Downloads → Command Registry: registers commands (evidence: `commandes/yt-search.js`)
- Rank Commands → Command Registry: registers commands (evidence: `commandes/rank.js`)
- Group Commands → Anti-link Policy: reads policy (evidence: `commandes/groupe.js`)
- Group Commands → Anti-bot Policy: reads policy (evidence: `commandes/groupe.js`)
- Group Commands → Message Runtime: handles group actions
- Message Runtime → Anti-link Policy: checks policy (evidence: `flash.js`)
- Message Runtime → Anti-bot Policy: checks policy (evidence: `flash.js`)
- Message Runtime → Ban Lists: checks bans (evidence: `flash.js`)
- Message Runtime → Sudo Access: checks access (evidence: `flash.js`)
- Message Runtime → Warnings: uses warnings (evidence: `flash.js`)
- Message Runtime → Welcome Settings: uses settings (evidence: `flash.js`)
- Message Runtime → Rank Data: updates rank (evidence: `flash.js`)
- Rank Commands → Rank Data: reads rank (evidence: `commandes/rank.js`)
- Anti-link Policy → PostgreSQL: reads and writes (evidence: `bdd/antilien.js`)
- Anti-bot Policy → PostgreSQL: reads and writes (evidence: `bdd/antibot.js`)
- Rank Data → PostgreSQL: reads and writes (evidence: `bdd/level.js`)
- Anti-link Policy → Bot Configuration: loads settings (evidence: `bdd/antilien.js`)
- Anti-bot Policy → Bot Configuration: loads settings (evidence: `bdd/antibot.js`)
- Rank Data → Bot Configuration: loads settings (evidence: `bdd/level.js`)
- YouTube Downloads → Download Helpers: uses helpers
- Feature Commands → Command Registry: registers commands (evidence: `commandes/yt-search.js`)
- Text Styling → Bot Configuration: uses settings
