149 lines
		
	
	
		
			3.5 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			149 lines
		
	
	
		
			3.5 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
| # 🚀 Guide de Démarrage Rapide - ObsiViewer
 | |
| 
 | |
| ## Mode Développement (Local)
 | |
| 
 | |
| ### Prérequis
 | |
| - Node.js 20+
 | |
| - Docker (pour Meilisearch)
 | |
| - Un vault Obsidian existant
 | |
| 
 | |
| ### Étapes
 | |
| 
 | |
| ```bash
 | |
| # 1. Installer les dépendances
 | |
| npm install
 | |
| 
 | |
| # 2. Configurer les variables d'environnement
 | |
| cp .env.example .env
 | |
| # Éditer .env et définir VAULT_PATH vers votre vault
 | |
| 
 | |
| # 3. Lancer Meilisearch
 | |
| npm run meili:up
 | |
| 
 | |
| # 4. Indexer votre vault
 | |
| npm run meili:reindex
 | |
| 
 | |
| # 5. Lancer le backend (terminal 1)
 | |
| VAULT_PATH=/chemin/vers/vault MEILI_MASTER_KEY=devMeiliKey123 node server/index.mjs
 | |
| 
 | |
| # 6. Lancer le frontend (terminal 2)
 | |
| npm run dev
 | |
| ```
 | |
| 
 | |
| ### Accès
 | |
| - **Frontend**: http://localhost:3000
 | |
| - **Backend API**: http://localhost:4000
 | |
| - **Meilisearch**: http://localhost:7700
 | |
| 
 | |
| ---
 | |
| 
 | |
| ## Mode Production (Docker Compose)
 | |
| 
 | |
| ### Prérequis
 | |
| - Docker
 | |
| - Docker Compose
 | |
| 
 | |
| ### Étapes
 | |
| 
 | |
| ```bash
 | |
| # 1. Configurer les variables
 | |
| cd docker-compose
 | |
| cp .env.example .env
 | |
| # Éditer .env et définir DIR_OBSIVIEWER_VAULT (chemin ABSOLU)
 | |
| 
 | |
| # 2. Lancer tous les services
 | |
| docker compose up -d
 | |
| 
 | |
| # 3. Indexer le vault
 | |
| cd ..
 | |
| npm run meili:reindex
 | |
| ```
 | |
| 
 | |
| ### Accès
 | |
| - **Application**: http://localhost:8080
 | |
| - **Meilisearch**: http://localhost:7700
 | |
| 
 | |
| ---
 | |
| 
 | |
| ## Variables d'Environnement Importantes
 | |
| 
 | |
| | Variable | Description | Exemple |
 | |
| |----------|-------------|---------|
 | |
| | `VAULT_PATH` | Chemin vers votre vault Obsidian | `./vault` ou `/home/user/Documents/ObsidianVault` |
 | |
| | `MEILI_MASTER_KEY` | Clé d'authentification Meilisearch | `devMeiliKey123` |
 | |
| | `MEILI_HOST` | URL de Meilisearch | `http://127.0.0.1:7700` |
 | |
| | `PORT` | Port du serveur backend | `4000` |
 | |
| 
 | |
| ---
 | |
| 
 | |
| ## Commandes Utiles
 | |
| 
 | |
| ### Meilisearch
 | |
| ```bash
 | |
| npm run meili:up          # Démarrer Meilisearch
 | |
| npm run meili:down        # Arrêter Meilisearch
 | |
| npm run meili:reindex     # Réindexer le vault
 | |
| npm run meili:rebuild     # Redémarrer + réindexer
 | |
| ```
 | |
| 
 | |
| ### Développement
 | |
| ```bash
 | |
| npm run dev               # Frontend seul (mode démo)
 | |
| npm run build             # Build production
 | |
| npm run preview           # Servir le build
 | |
| node server/index.mjs     # Backend Express
 | |
| ```
 | |
| 
 | |
| ### Docker
 | |
| ```bash
 | |
| cd docker-compose
 | |
| docker compose up -d      # Démarrer
 | |
| docker compose down       # Arrêter
 | |
| docker compose logs -f    # Voir les logs
 | |
| ```
 | |
| 
 | |
| ---
 | |
| 
 | |
| ## Dépannage
 | |
| 
 | |
| ### Le backend ne trouve pas mon vault
 | |
| **Problème**: `Vault directory: C:\dev\git\web\ObsiViewer\vault` au lieu de votre vault
 | |
| 
 | |
| **Solution**: Définir `VAULT_PATH` avant de lancer le serveur:
 | |
| ```bash
 | |
| VAULT_PATH=/chemin/vers/vault node server/index.mjs
 | |
| ```
 | |
| 
 | |
| ### Meilisearch refuse la connexion
 | |
| **Problème**: `invalid_api_key` ou connexion refusée
 | |
| 
 | |
| **Solutions**:
 | |
| 1. Vérifier que Meilisearch est démarré: `docker ps | grep meilisearch`
 | |
| 2. Vérifier la clé: `docker exec obsiviewer-meilisearch printenv MEILI_MASTER_KEY`
 | |
| 3. Utiliser la même clé partout: `.env`, `docker-compose/.env`, et commandes
 | |
| 
 | |
| ### L'indexation échoue
 | |
| **Problème**: `Index not found` ou erreurs d'indexation
 | |
| 
 | |
| **Solutions**:
 | |
| 1. Vérifier que `VAULT_PATH` pointe vers le bon dossier
 | |
| 2. Relancer l'indexation: `npm run meili:reindex`
 | |
| 3. Vérifier les logs: `docker logs obsiviewer-meilisearch`
 | |
| 
 | |
| ### Le frontend ne se connecte pas au backend
 | |
| **Problème**: Erreurs CORS ou 404
 | |
| 
 | |
| **Solutions**:
 | |
| 1. Vérifier que le backend tourne sur le bon port
 | |
| 2. Vérifier `proxy.conf.json` pour le dev
 | |
| 3. En production, rebuild l'app: `npm run build`
 | |
| 
 | |
| ---
 | |
| 
 | |
| ## Support
 | |
| 
 | |
| Pour plus de détails, consultez:
 | |
| - [README.md](./README.md) - Documentation complète
 | |
| - [docker-compose/README.md](./docker-compose/README.md) - Guide Docker
 | |
| - [MEILISEARCH_SETUP.md](./MEILISEARCH_SETUP.md) - Configuration Meilisearch
 |