┌─────────────────────────────────────────────────────────────┐
│ Environnement local │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────────┐ │
│ │ Eleventy │ │ Node.js │ │ SQLite │ │
│ │ (build) │ │ server │ │ (vectors.db) │ │
│ └──────┬───────┘ └──────┬───────┘ └────────┬─────────┘ │
└─────────┼─────────────────┼───────────────────┼─────────────┘
│ │ │
│ deploy.js │ SFTP manuel │ copié avec
│ (SSH) │ │ server/
▼ ▼ ▼
┌─────────────────────────────────────────────────────────────┐
│ Infomaniak │
│ ┌──────────────────┐ ┌────────────────────────────┐ │
│ │ Hébergement Web │ │ Hébergement Node.js │ │
│ │ wonderweb.ch │ ───► │ v2.wonderweb.ch/api │ │
│ │ (site statique) │ │ (API chatbot) │ │
│ └──────────────────┘ └────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
Créer .env à la racine du projet :
DEPLOY_USER = 'votre_user_ftp'
DEPLOY_HOST = 'xxxxx.ftp.infomaniak.com'
DEPLOY_AGENT = "/private/tmp/com.apple.launchd.xxx/Listeners" # echo $SSH_AUTH_SOCK
DEPLOY_PATH = "/home/clients/xxx/web"
Pour trouver
DEPLOY_AGENT, exécuterecho $SSH_AUTH_SOCKdans le terminal.
# 1. Build du site statique
npm run build
# 2. Déploiement via SSH
npm run deploy
Le script deploy.js utilise ssh-deploy-release pour envoyer le dossier _site/ vers le serveur.
/home/clients/xxx/sites/v2.wonderweb.ch)Copier le dossier server/ vers Infomaniak via SFTP (Cyberduck, FileZilla, etc.) :
server/
├── src/ # Code source
├── scripts/ # Scripts utilitaires
├── data/
│ └── chatbot-vectors.db # Base SQLite (générée par npm run reindex)
├── package.json
├── package-lock.json
└── .env # À créer sur le serveur (NE PAS COMMIT)
Créer server/.env directement sur le serveur Infomaniak :
# Infomaniak définit PORT automatiquement, pas besoin de le spécifier
INFOMANIAK_API_KEY=votre_cle_api_infomaniak
INFOMANIAK_PRODUCT_ID=100044
CORS_ORIGIN=https://wonderweb.ch
DATABASE_PATH=./data/chatbot-vectors.db
Via SSH sur le serveur :
cd /home/clients/xxx/sites/v2.wonderweb.ch
npm install
npm start
Infomaniak gère automatiquement le redémarrage du serveur Node.js (pas besoin de PM2).
Éditer les fichiers JSON dans _data/ :
chatbot-content.json - Contenu principal (services, about, contact)projets.json - Liste des projets/réalisationschatbotConfig.json - Prompt système et configuration du botRegénérer les vecteurs d'embedding :
cd server
npm run reindex
server/data/chatbot-vectors.db vers le serveurÉditer uniquement _data/chatbotConfig.json :
{
"systemPrompt": "Tu es l'assistant de Wonderweb...",
"welcomeMessage": "Bonjour ! Je suis...",
"welcomeActions": ["Question 1", "Question 2"],
...
}
Puis rebuild et deploy le frontend :
npm run build && npm run deploy
# Modifications locales
git add . && git commit -m "Update"
# Build et deploy frontend
npm run build && npm run deploy
# 1. Éditer les fichiers _data/*.json
# 2. Reindex les vecteurs
cd server && npm run reindex
# 3. Upload server/ vers Infomaniak (SFTP)
# 4. Redémarrer Node.js si nécessaire (via Manager Infomaniak)
| Composant | URL | Description |
|---|---|---|
| Site principal | https://wonderweb.ch | Frontend Eleventy |
| Page chatbot | https://wonderweb.ch/chat | Interface chatbot |
| API Chatbot | https://v2.wonderweb.ch/api | Backend Node.js |
| Health check | https://v2.wonderweb.ch/health | État du serveur |
| Méthode | Endpoint | Description |
|---|---|---|
| GET | /health | Vérification état serveur |
| POST | /api/search | Recherche sémantique |
| POST | /api/chat-stream | Chat avec streaming SSE |
https://v2.wonderweb.ch/healthINFOMANIAK_API_KEY est correcteVérifier que CORS_ORIGIN dans .env correspond au domaine du frontend.
Exécuter npm run reindex dans le dossier server/ puis re-upload data/chatbot-vectors.db.
| Fichier | Description |
|---|---|
deploy.js | Script déploiement frontend (SSH) |
server/src/index.js | Point d'entrée API Express |
server/scripts/build-vectors.js | Script de réindexation |
_data/chatbotConfig.json | Configuration du chatbot |
_data/chatbot-content.json | Contenu pour le RAG |