# andyadja74-cyber/copy_newia architecture

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

- Interactive diagram: https://gitdiagram.com/andyadja74-cyber/copy_newia
- Repository: https://github.com/andyadja74-cyber/copy_newia

## Overview

Titan is a French-language WhatsApp bot with a web-based multi-account pairing and administration service. A user requests a pairing or joins the waiting queue through the web app; the manager validates and schedules the request, launches a bot worker, and tracks its pairing and connection state. Once connected, the worker processes WhatsApp messages and sends command responses. The bot also provides utility, social, media, and voice features. The README is empty, so capabilities and relationships here are based on the supplied source excerpts; some worker and browser wiring is not shown.

Main entry points: [`index.js`](https://github.com/andyadja74-cyber/copy_newia/blob/main/index.js) (Message handling), [`public/index.html`](https://github.com/andyadja74-cyber/copy_newia/blob/main/public/index.html) (Connection app), [`manager.js`](https://github.com/andyadja74-cyber/copy_newia/blob/main/manager.js) (Session manager), [`public/admin.html`](https://github.com/andyadja74-cyber/copy_newia/blob/main/public/admin.html) (Admin page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web management"]
  node_manager["Session manager<br/>[manager.js]"]
end

subgraph group_runtime["WhatsApp runtime"]
  node_worker["Bot worker<br/>[index.js]"]
  node_dispatch["Message handling<br/>[index.js]"]
  node_sending["Reply delivery<br/>[index.js]"]
end

subgraph group_features["Bot features"]
  node_catalog["Command catalog<br/>[index.js]"]
  node_social["Social commands<br/>[index.js]"]
  node_utilities["Utility commands<br/>[index.js]"]
  node_translation["Translation<br/>[index.js]"]
  node_voice["Voice features<br/>[index.js]"]
  node_botdata["Bot state and responses<br/>[data.js]"]
end

subgraph group_assets["Web and media assets"]
  node_webapp["Connection app<br/>[index.html]"]
  node_adminui["Admin page<br/>[admin.html]"]
  node_menuimages["Menu images<br/>[menu-images.js]"]
  node_music["Music control<br/>[musique.js]"]
  node_musicfile["Music audio<br/>[musique.mp3]"]
  node_serviceworker["Offline support<br/>[sw.js]"]
  node_mediafiles["Bot media"]
end

node_visitor(("Web user"))
node_whatsapp(("WhatsApp"))
node_google["Google services"]
node_mymemory["MyMemory"]
node_wiktionary["Wiktionary"]

node_visitor -->|"requests pairing"| node_webapp
node_webapp -.->|"calls API"| node_manager
node_visitor -->|"manages sessions"| node_adminui
node_adminui -.->|"calls admin API"| node_manager
node_manager -.->|"launches worker"| node_worker
node_whatsapp -.->|"provides messages"| node_dispatch
node_dispatch -->|"checks commands"| node_catalog
node_dispatch -->|"handles commands"| node_social
node_dispatch -.->|"handles commands"| node_utilities
node_dispatch -->|"routes translations"| node_translation
node_dispatch -.->|"routes voice commands"| node_voice
node_translation -->|"requests translation"| node_google
node_translation -->|"uses fallback"| node_mymemory
node_utilities -->|"looks up words"| node_wiktionary
node_social -->|"uses response data"| node_botdata
node_dispatch -->|"uses bot state"| node_botdata
node_catalog -.->|"includes menu imagery"| node_menuimages
node_dispatch -->|"sends replies"| node_sending
node_sending -.->|"sends messages"| node_whatsapp
node_voice -->|"requests speech audio"| node_google
node_webapp -.->|"loads music control"| node_music
node_music -->|"plays audio"| node_musicfile
node_webapp -.->|"registers offline support"| node_serviceworker
node_worker -.->|"uses media assets"| node_mediafiles

click node_manager "https://github.com/andyadja74-cyber/copy_newia/blob/main/manager.js"
click node_webapp "https://github.com/andyadja74-cyber/copy_newia/blob/main/public/index.html"
click node_adminui "https://github.com/andyadja74-cyber/copy_newia/blob/main/public/admin.html"
click node_worker "https://github.com/andyadja74-cyber/copy_newia/blob/main/index.js"
click node_dispatch "https://github.com/andyadja74-cyber/copy_newia/blob/main/index.js"
click node_sending "https://github.com/andyadja74-cyber/copy_newia/blob/main/index.js"
click node_catalog "https://github.com/andyadja74-cyber/copy_newia/blob/main/index.js"
click node_social "https://github.com/andyadja74-cyber/copy_newia/blob/main/index.js"
click node_utilities "https://github.com/andyadja74-cyber/copy_newia/blob/main/index.js"
click node_translation "https://github.com/andyadja74-cyber/copy_newia/blob/main/index.js"
click node_voice "https://github.com/andyadja74-cyber/copy_newia/blob/main/index.js"
click node_botdata "https://github.com/andyadja74-cyber/copy_newia/blob/main/data.js"
click node_menuimages "https://github.com/andyadja74-cyber/copy_newia/blob/main/menu-images.js"
click node_music "https://github.com/andyadja74-cyber/copy_newia/blob/main/public/musique.js"
click node_musicfile "https://github.com/andyadja74-cyber/copy_newia/blob/main/public/musique.mp3"
click node_serviceworker "https://github.com/andyadja74-cyber/copy_newia/blob/main/public/sw.js"
click node_mediafiles "https://github.com/andyadja74-cyber/copy_newia/tree/main/media"

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_manager,node_visitor toneBlue
class node_worker,node_dispatch,node_sending toneAmber
class node_catalog,node_social,node_utilities,node_translation,node_voice,node_botdata toneMint
class node_webapp,node_adminui,node_menuimages,node_music,node_musicfile,node_serviceworker,node_mediafiles toneRose
class node_whatsapp,node_google,node_mymemory,node_wiktionary toneIndigo
```

## Components

### Web management

- [Session manager](https://github.com/andyadja74-cyber/copy_newia/blob/main/manager.js): `manager.js`

### WhatsApp runtime

- [Bot worker](https://github.com/andyadja74-cyber/copy_newia/blob/main/index.js): `index.js`
- [Message handling](https://github.com/andyadja74-cyber/copy_newia/blob/main/index.js): `index.js`
- [Reply delivery](https://github.com/andyadja74-cyber/copy_newia/blob/main/index.js): `index.js`

### Bot features

- [Command catalog](https://github.com/andyadja74-cyber/copy_newia/blob/main/index.js): `index.js`
- [Social commands](https://github.com/andyadja74-cyber/copy_newia/blob/main/index.js): `index.js`
- [Utility commands](https://github.com/andyadja74-cyber/copy_newia/blob/main/index.js): `index.js`
- [Translation](https://github.com/andyadja74-cyber/copy_newia/blob/main/index.js): `index.js`
- [Voice features](https://github.com/andyadja74-cyber/copy_newia/blob/main/index.js): `index.js`
- [Bot state and responses](https://github.com/andyadja74-cyber/copy_newia/blob/main/data.js): `data.js`

### Web and media assets

- [Connection app](https://github.com/andyadja74-cyber/copy_newia/blob/main/public/index.html): `public/index.html`
- [Admin page](https://github.com/andyadja74-cyber/copy_newia/blob/main/public/admin.html): `public/admin.html`
- [Menu images](https://github.com/andyadja74-cyber/copy_newia/blob/main/menu-images.js): `menu-images.js`
- [Music control](https://github.com/andyadja74-cyber/copy_newia/blob/main/public/musique.js): `public/musique.js`
- [Music audio](https://github.com/andyadja74-cyber/copy_newia/blob/main/public/musique.mp3): `public/musique.mp3`
- [Offline support](https://github.com/andyadja74-cyber/copy_newia/blob/main/public/sw.js): `public/sw.js`
- [Bot media](https://github.com/andyadja74-cyber/copy_newia/tree/main/media): `media`

### Other components

- **Web user**
- **WhatsApp**
- **Google services**
- **MyMemory**
- **Wiktionary**

## Connections

- Web user → Connection app: requests pairing
- Connection app → Session manager: calls API
- Web user → Admin page: manages sessions
- Admin page → Session manager: calls admin API
- Session manager → Bot worker: launches worker (evidence: `index.js`)
- WhatsApp → Message handling: provides messages
- Message handling → Command catalog: checks commands (evidence: `index.js`)
- Message handling → Social commands: handles commands (evidence: `index.js`)
- Message handling → Utility commands: handles commands (evidence: `index.js`)
- Message handling → Translation: routes translations (evidence: `index.js`)
- Message handling → Voice features: routes voice commands (evidence: `index.js`)
- Translation → Google services: requests translation (evidence: `index.js`)
- Translation → MyMemory: uses fallback (evidence: `index.js`)
- Utility commands → Wiktionary: looks up words (evidence: `index.js`)
- Social commands → Bot state and responses: uses response data (evidence: `index.js`)
- Message handling → Bot state and responses: uses bot state (evidence: `index.js`)
- Command catalog → Menu images: includes menu imagery (evidence: `index.js`)
- Message handling → Reply delivery: sends replies (evidence: `index.js`)
- Reply delivery → WhatsApp: sends messages
- Voice features → Google services: requests speech audio (evidence: `index.js`)
- Connection app → Music control: loads music control
- Music control → Music audio: plays audio (evidence: `public/musique.js`)
- Connection app → Offline support: registers offline support
- Bot worker → Bot media: uses media assets
