Dernière MAJ : 24/01/2026
| Composant | Emplacement |
|---|---|
| Container | needfinder sur prod-portainer (192.168.1.12) |
| Port | 5200 |
| Code source | GitLab gouroubleu/needfinder |
| Database | Supabase PROD (postgres, schema needfinder) |
SERVER: supabase-db-prod (prod-portainer)
│
└── DATABASE: postgres
│
└── SCHEMA: needfinder
│
├── sources (2 rows)
├── posts (450+ rows)
├── needs (270+ rows)
├── mentions (270+ rows)
└── collection_logs (81+ rows)
postgresql://needfinder_service:UK3GlkfwnFZZVAGxScyz5DF6@supabase-db-prod:5432/postgres
Note : Le code utilise SET search_path TO needfinder pour accéder au schema.
| Table | PK | Description |
|---|---|---|
| sources | UUID | Reddit, HackerNews |
| posts | UUID | Posts collectés (Reddit/HN) |
| needs | UUID | Besoins détectés par IA |
| mentions | UUID | Liens need ↔ post |
| collection_logs | UUID | Historique collectes |
Actions effectuées :
needfinder sur DEV : DROP DATABASEneedfinder-collector-dev : docker rmpostgres (DEV) : NettoyéesEtat actuel : Aucune donnée NeedFinder sur DEV. Tout est sur PROD.
Le schema needfinder est inclus dans le backup O2switch (cron toutes les 6h) :
/stock_8to/33800-stack/scripts/backup/pg-to-o2switch.sho2switch:~/backup/postgres/# Dump schema needfinder depuis PROD
ssh gouroubleu@prod-portainer.local "docker exec supabase-db-prod pg_dump -U postgres postgres --schema=needfinder --inserts" > /stock_8to/backups/needfinder/needfinder_$(date +%Y%m%d_%H%M).sql
ssh gouroubleu@prod-portainer.local "docker exec -i supabase-db-prod psql -U postgres" < /stock_8to/backups/needfinder/FICHIER.sql
| Endpoint | URL |
|---|---|
| Health | http://192.168.1.12:5200/health |
| Stats | http://192.168.1.12:5200/api/stats |
| Posts | http://192.168.1.12:5200/api/posts |
| Needs | http://192.168.1.12:5200/api/needs |
| Logs | http://192.168.1.12:5200/api/logs |
| Swagger | http://192.168.1.12:5200/swagger |
| URL | Usage |
|---|---|
| https://needfinder-api.33800.nowhere84.com | API PROD via nginx |
| https://dashboard.nowhere84.com/needfinder.html | Dashboard (données live via API) |
Post → submitAnalysisJobAsync() → AI-Orchestrator (queue)
↓
Ollama traite
↓
Webhook /api/webhook/analysis
↓
Need créé → submitTranslationJobAsync()
↓
Webhook /api/webhook/translation
↓
need_statement_fr mis à jour
| Endpoint | Usage |
|---|---|
| POST /api/webhook/analysis | Reçoit résultats analyse (crée need si has_need=true) |
| POST /api/webhook/translation | Reçoit traduction FR |
| POST /api/analyze/async?batch=N | Soumet N posts en async |
| POST /api/analyze/all | Lance traitement complet (background) |
| GET /api/analyze/stats | Stats pending/submitted/completed/failed |
| Status | Description |
|---|---|
| pending | Pas encore soumis |
| submitted | Job envoyé à l'orchestrator |
| completed | Analyse terminée |
| failed | Erreur d'analyse |
submitAnalysisJobAsync(postId, prompt, options) → job_id
submitTranslationJobAsync(targetId, targetType, text, field) → job_id
Quand un need est créé, la traduction FR est automatiquement soumise via submitTranslationJobAsync().
| Date | Problème | Cause | Resolution |
|---|---|---|---|
| 07/01/2026 | Perte données décembre | Migration vers Proxmox1, volume réinitialisé | Recollecte |
| 11/01/2026 | Changement architecture | Passage postgres.public → needfinder.needfinder | Migration schema |
| 20/01/2026 | Confusion schéma | Retour à needfinder.needfinder | Documentation |
| 23/01/2026 | Migration PROD | DEV → PROD pour backup O2switch | Migration + nettoyage DEV |
| 24/01/2026 | Dashboard sans données live | generate-needfinder.sh pointait sur DEV (.51) | Corrigé vers PROD (.12) |
Leçons :
DATABASE postgres, SCHEMA needfinder (PROD)| Fichier | Variable | Valeur correcte | Impact si cassé |
|---|---|---|---|
generate-needfinder.sh |
API_URL | http://192.168.1.12:5200 |
Dashboard sans données live |
generate-needfinder.sh |
limit | 5000 (pas 200) |
Stats incorrectes, needs manquants |
generate.d/01-index.sh |
services.needfinder | Doit exister dans current.json | Widget index cassé |
ATTENTION : Après migration PROD, TOUJOURS mettre à jour les scripts de génération dashboard.
ATTENTION : Le fichier services-registry.json peut être créé par root (via cron). Si git add échoue avec "Permission denied", faire : sudo chown gouroubleu:gouroubleu services-registry.json
Règle : 1 projet = 1 schema dédié
| Projet | Database | Schema |
|---|---|---|
| NeedFinder | postgres (PROD) | needfinder |
| Notifications | postgres (PROD) | notifications |
| QwikPress | postgres (PROD) | qwikpress |
| ... | ... | ... |
Avantages :
# Vérifier la connexion actuelle du container
ssh gouroubleu@prod-portainer.local "docker exec needfinder env | grep DB"
# Compter les données
ssh gouroubleu@prod-portainer.local "docker exec supabase-db-prod psql -U postgres -d postgres -c \"
SELECT 'posts' as t, count(*) FROM needfinder.posts
UNION ALL SELECT 'needs', count(*) FROM needfinder.needs
UNION ALL SELECT 'mentions', count(*) FROM needfinder.mentions;
\""
# Vérifier le health
curl -s http://192.168.1.12:5200/health | jq
# Vérifier via API publique
curl -s https://needfinder-api.33800.nowhere84.com/api/stats | jq