- Fix 050_data_validation_constraints.sql: Replace IF NOT EXISTS with DO blocks - PostgreSQL doesn't support IF NOT EXISTS with ADD CONSTRAINT - Add quick troubleshooting guide (DEPANNAGE_RAPIDE.md) - Note: .env file is gitignored (as expected)
135 lines
2.8 KiB
Markdown
135 lines
2.8 KiB
Markdown
# 🔧 Dépannage Rapide - Veza Integration
|
|
|
|
## ✅ Problèmes Résolus
|
|
|
|
### 1. Migration SQL `050_data_validation_constraints.sql` ❌ → ✅
|
|
|
|
**Problème**: `syntax error at or near "NOT"` - PostgreSQL ne supporte pas `IF NOT EXISTS` avec `ADD CONSTRAINT`
|
|
|
|
**Solution**: Migration corrigée pour utiliser des blocs `DO $$` (comme dans `930_add_missing_foreign_keys.sql`)
|
|
|
|
**Status**: ✅ **CORRIGÉ**
|
|
|
|
---
|
|
|
|
### 2. Port Redis Occupé ❌ → ✅
|
|
|
|
**Problème**: `address already in use` sur port 6379
|
|
|
|
**Solution**:
|
|
```bash
|
|
# Arrêter l'instance existante
|
|
docker stop veza_redis
|
|
|
|
# Redémarrer via docker-compose
|
|
docker compose up -d redis
|
|
```
|
|
|
|
**Status**: ✅ **RÉSOLU**
|
|
|
|
---
|
|
|
|
## 🚀 Démarrage Rapide (Après Corrections)
|
|
|
|
### Option 1: Backend + Frontend Seulement (Recommandé pour tests)
|
|
|
|
```bash
|
|
# Terminal 1: Infrastructure
|
|
make infra-up
|
|
|
|
# Terminal 2: Backend
|
|
cd veza-backend-api
|
|
go run cmd/api/main.go
|
|
|
|
# Terminal 3: Frontend
|
|
cd apps/web
|
|
npm run dev
|
|
```
|
|
|
|
**URLs**:
|
|
- Frontend: http://localhost:3000
|
|
- Backend: http://localhost:8080
|
|
- Swagger: http://localhost:8080/docs
|
|
|
|
---
|
|
|
|
### Option 2: Tout-en-un (avec Makefile)
|
|
|
|
```bash
|
|
# Ignorer les erreurs Rust (non bloquant)
|
|
make dev 2>&1 | grep -v "libsqlite3-sys"
|
|
```
|
|
|
|
**Note**: Les erreurs Rust (chat-server, stream-server) ne bloquent pas l'intégration backend/frontend.
|
|
|
|
---
|
|
|
|
## ⚙️ Configuration Backend
|
|
|
|
Le fichier `.env` a été créé automatiquement dans `veza-backend-api/.env`:
|
|
|
|
```bash
|
|
APP_ENV=development
|
|
JWT_SECRET=dev-secret-key-minimum-32-characters-long-for-testing
|
|
DATABASE_URL=postgres://veza:password@localhost:5432/veza?sslmode=disable
|
|
REDIS_URL=redis://localhost:6379
|
|
CORS_ALLOWED_ORIGINS=http://localhost:3000,http://localhost:5173
|
|
APP_PORT=8080
|
|
LOG_LEVEL=INFO
|
|
```
|
|
|
|
---
|
|
|
|
## 🧪 Test Rapide
|
|
|
|
```bash
|
|
# 1. Vérifier infrastructure
|
|
docker compose ps
|
|
|
|
# 2. Vérifier backend
|
|
curl http://localhost:8080/health
|
|
|
|
# 3. Vérifier frontend
|
|
curl http://localhost:3000
|
|
|
|
# 4. Ouvrir dans navigateur
|
|
open http://localhost:3000
|
|
```
|
|
|
|
---
|
|
|
|
## 🐛 Problèmes Connus (Non Bloquants)
|
|
|
|
### Erreur Rust `libsqlite3-sys`
|
|
|
|
**Message**: `failed to select a version for libsqlite3-sys`
|
|
|
|
**Impact**: ⚠️ **NON BLOQUANT** - Les serveurs Rust (chat, stream) ne sont pas nécessaires pour tester l'intégration backend/frontend.
|
|
|
|
**Solution**: Ignorer cette erreur ou corriger les dépendances Rust séparément.
|
|
|
|
---
|
|
|
|
### Go Version (air)
|
|
|
|
**Message**: `requires go >= 1.25 (running go 1.24.10)`
|
|
|
|
**Impact**: ⚠️ **NON BLOQUANT** - Le backend démarre avec `go run` même sans `air`.
|
|
|
|
**Solution**: Utiliser `go run cmd/api/main.go` au lieu de `air`.
|
|
|
|
---
|
|
|
|
## ✅ Checklist Avant Test
|
|
|
|
- [x] Migration SQL corrigée
|
|
- [x] Redis démarré
|
|
- [x] Backend `.env` configuré
|
|
- [ ] Backend démarré (port 8080)
|
|
- [ ] Frontend démarré (port 3000)
|
|
- [ ] Test dans navigateur
|
|
|
|
---
|
|
|
|
**Guide complet**: Voir `GUIDE_DEMARRAGE_INTEGRATION.md`
|
|
|