Files
WebNationsGlory_ServeurBuil…/QUICKSTART.md
y.campiontrebouta@innotexnas.ovh 4e12afe105 feat: migrate application port from 3000 to 4001 and fix circular dependencies
- Change default port to 4001 across all configuration files (server.js, docker-compose.yml, .env, Dockerfile)
- Update frontend API URL to use new port 4001
- Fix circular dependency issues in route files by using process.env.SERVER_DIR instead of importing from server.js
- Apply to all routes: auth.js, backup.js, logs.js, players.js, rcon.js, server.js, whitelist.js
- Fix environment variable loading in start.sh to properly handle paths with spaces
- Quote SERVER_DIR path in .env to preserve spaces in directory paths
- Update all documentation references from port 3000 to 4001 (README, QUICKSTART, CONFIGURATION, INDEX)
- Remove debug console.log statements from auth.js
- Remove test utility file test-ops.js

Fixes: Port conflict issues, circular dependency warnings, environment variable parsing
2026-02-04 19:27:00 +01:00

137 lines
3.1 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 🎯 Guide Rapide - Démarrage en 5 Minutes
## Prérequis
- Node.js 14+ installé
- Serveur Minecraft avec RCON activé
- Vous devez être OP sur le serveur
## ⚡ Installation Express
### 1⃣ Configuration du serveur MC (10 secondes)
Éditer le fichier `server.properties` du serveur Minecraft:
```properties
enable-rcon=true
rcon.port=25575
rcon.password=YourPassword123
```
Redémarrer le serveur MC.
### 2⃣ Installation de l'app (2 minutes)
```bash
cd /home/innotex/Documents/Projet/Serveur\ NationsGlory/WebNationsGlory_ServeurBuild_Red
# Installation automatique
./install.sh
```
### 3⃣ Configuration (1 minute)
```bash
# Éditer le fichier
nano backend/.env
```
Vérifiez:
```env
PORT=4001
SERVER_DIR=/home/innotex/Documents/Projet/Serveur NationsGlory/NationsGlory_ServeurBuild_Red
RCON_HOST=localhost
RCON_PORT=25575
```
### 4⃣ Lancement (30 secondes)
```bash
./start.sh
```
Vous devriez voir:
```
🚀 Backend Admin NationsGlory démarré sur http://localhost:4001
```
### 5⃣ Accès (10 secondes)
Ouvrez: **http://localhost:4001**
## 👤 Premier Compte
1. Remplissez le formulaire d'enregistrement:
- Nom d'utilisateur: `admin` (ou ce que vous voulez)
- Mot de passe: Votre mot de passe
- Pseudo Minecraft: **VOTRE NOM DE JOUEUR** (doit être OP!)
2. Cliquez "Créer le compte"
3. Connectez-vous avec vos identifiants
## ✅ Test Rapide
1. Allez à l'onglet **Console RCON**
2. Tapez: `/time query daytime`
3. Cliquez "Envoyer"
4. Vous devriez voir l'heure du serveur
Si ça marche = ✓ Tout est bon!
## 🎮 Commandes Utiles
```
/say Bienvenue! → Message à tous
/tp @s 0 100 0 → Se téléporter
/give @p diamond 64 → Donner des items
/weather clear → Météo
/difficulty 3 → Difficulté
/time set day → Midi
```
## ⚠️ Problèmes Courants
| Problème | Solution |
|----------|----------|
| "Timeout RCON" | Vérifier que le serveur MC est en ligne |
| "Mot de passe incorrect" | Vérifier dans server.properties |
| "Joueur n'est pas OP" | Faire `/op NomDuJoueur` sur le serveur MC |
| "Impossible de se connecter" | Vérifier que `npm start` est lancé |
## 📁 Fichiers Importants
```
backend/
├── .env ← Configuration (à modifier)
├── package.json ← Dépendances
└── src/
├── server.js ← Point d'entrée
└── routes/ ← API endpoints
frontend/
└── public/
└── index.html ← Interface web
```
## 🔐 Sécurité Basique
1. Changez `SESSION_SECRET` dans `.env` (ligne importante)
2. Utilisez un mot de passe RCON fort
3. Ne partagez pas vos identifiants
## 📖 Documentation Complète
- **README.md** - Vue d'ensemble complète
- **CONFIGURATION.md** - Configuration détaillée
- **DEPLOYMENT.md** - Déploiement en production
## 🆘 Besoin d'aide?
1. Vérifiez les logs: `npm start` affiche tout
2. Testez RCON: `echo "status" | nc localhost 25575`
3. Lisez CONFIGURATION.md pour plus de détails
---
**Vous êtes prêt!** 🚀 Profitez de votre interface!