Skip to content

🛠️ Stack Tecnologico

Ultimo aggiornamento: 04/04/2026 18:00

Infrastruttura

Componente Tecnologia Dettagli
Server DigitalOcean Droplet 2GB RAM, 1vCPU, Ubuntu 22.04, fra1
Runtime Node.js 20 LTS
Process Manager PM2 6.0 Fork mode per Puppeteer
Browser Chrome 146 Headless per whatsapp-web.js
Database JSON su disco notebook.json + chatStore
Docs MkDocs Material 9.7 Auto-sync ogni ora

AI Stack

Modello Ruolo Note
Gemini 2.5 Flash AI Primaria Via OpenAI-compatible endpoint
ChatGPT gpt-4o-mini Fallback HTTP diretto (no npm lib)

WhatsApp

Componente Dettagli
Libreria whatsapp-web.js v1.34.6
Sessione LocalAuth (Puppeteer)
Eventi message_create (non message)
ID Format @lid (Linked Identity) + @c.us
Bot WID 393337708642@c.us

Architettura Bot

graph TD
    A[Messaggio WhatsApp] --> B{Taccuino}
    B -->|Salva SEMPRE| C[notebook.json]
    B --> D{Bot Menzionato?}
    D -->|No| E[Silenzio]
    D -->|Si: @tag / keyword / reply| F[Cervello AI]
    F --> G[Gemini 2.5 Flash]
    G -->|Errore| H[ChatGPT Fallback]
    G --> I[Risposta WhatsApp]
    H --> I

Trigger Bot nei Gruppi

Metodo Esempio PrioritĂ 
@Mention @ITALIA SUSHI ROBOT dimmi i prezzi 1
Swipe-Reply Rispondi a msg del bot 2
Keyword "bot quanto costa?" 3
Tag vuoto @ISR (da solo) → legge contesto 4

Protezioni Memoria

Protezione Dettaglio
Scrittura atomica tmp + rename
Backup rotativo Ogni 5 min, 10 copie
Backup Git Ogni 6h via cron
Crash handler SIGINT/SIGTERM/uncaught → save
CapacitĂ  10.000 msg/chat, nessun TTL