docs: Update README with new main branch structure
This commit is contained in:
76
README.md
76
README.md
@@ -30,11 +30,19 @@ HexaHost-Backend/
|
|||||||
|
|
||||||
Die Backend-Dateien müssen in das Frontend-Repository integriert werden:
|
Die Backend-Dateien müssen in das Frontend-Repository integriert werden:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Vom main Branch die Produktionsdateien kopieren
|
||||||
|
cd HexaHost-Backend
|
||||||
|
git checkout main
|
||||||
|
cp -r assets config includes ../HexaHost-Frontend/public/
|
||||||
|
git checkout develop
|
||||||
|
```
|
||||||
|
|
||||||
|
Oder mit einem Befehl:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Aus dem Projekt-Root-Verzeichnis
|
# Aus dem Projekt-Root-Verzeichnis
|
||||||
cp -r HexaHost-Backend/assets/* HexaHost-Frontend/public/assets/
|
cd HexaHost-Backend && git checkout main && cp -r assets config includes ../HexaHost-Frontend/public/ && git checkout develop
|
||||||
cp -r HexaHost-Backend/config/* HexaHost-Frontend/public/config/
|
|
||||||
cp -r HexaHost-Backend/includes/* HexaHost-Frontend/public/includes/
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Zielstruktur im Frontend
|
### Zielstruktur im Frontend
|
||||||
@@ -270,14 +278,27 @@ $debug_config = [
|
|||||||
|
|
||||||
```
|
```
|
||||||
Branches:
|
Branches:
|
||||||
├── main → Produktions-Code (mit obfuscated dist/)
|
├── main → Produktions-Code (optimierte Dateien direkt im Root)
|
||||||
└── develop → Entwicklungs-Code (lesbarer Source)
|
└── develop → Entwicklungs-Code (lesbarer Source + Build-System)
|
||||||
```
|
```
|
||||||
|
|
||||||
| Branch | Inhalt | Verwendung |
|
| Branch | Inhalt | Verwendung |
|
||||||
|--------|--------|------------|
|
|--------|--------|------------|
|
||||||
| `main` | Lesbare Quellen + `dist/` Ordner | Für Produktion: Dateien aus `dist/` verwenden |
|
| `main` | Optimierte `assets/`, `config/`, `includes/` im Root | Für Produktion: direkt kopieren |
|
||||||
| `develop` | Nur lesbare Quellen + Build-System | Für Entwicklung |
|
| `develop` | Lesbare Quellen + `dist/` Build-Output | Für Entwicklung |
|
||||||
|
|
||||||
|
### Struktur im `main` Branch
|
||||||
|
|
||||||
|
```
|
||||||
|
HexaHost-Backend/ (main)
|
||||||
|
├── assets/ ← Minifiziertes CSS, obfusciertes JS
|
||||||
|
│ ├── css/
|
||||||
|
│ └── js/
|
||||||
|
├── config/ ← PHP-Konfiguration
|
||||||
|
├── includes/ ← PHP-Templates
|
||||||
|
├── README.md
|
||||||
|
└── LICENSE
|
||||||
|
```
|
||||||
|
|
||||||
### Workflow
|
### Workflow
|
||||||
|
|
||||||
@@ -289,12 +310,24 @@ npm run build # dist/ neu generieren
|
|||||||
git add .
|
git add .
|
||||||
git commit -m "feat: ..."
|
git commit -m "feat: ..."
|
||||||
|
|
||||||
# Release
|
# Release (automatisch mit deploy script)
|
||||||
|
npm run deploy # Build + Copy to main + Push
|
||||||
|
```
|
||||||
|
|
||||||
|
### Manueller Release
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git checkout develop
|
||||||
|
npm run build
|
||||||
|
git add dist/ && git commit -m "build: ..."
|
||||||
git checkout main
|
git checkout main
|
||||||
git merge develop
|
git checkout develop -- dist/
|
||||||
npm run build # dist/ aktualisieren
|
# Dateien von dist/ ins Root verschieben
|
||||||
git add dist/
|
mv dist/assets dist/config dist/includes .
|
||||||
git commit -m "build: Update production files"
|
rm -rf dist/
|
||||||
|
git add -A && git commit -m "deploy: Update"
|
||||||
|
git push origin main
|
||||||
|
git checkout develop
|
||||||
```
|
```
|
||||||
|
|
||||||
## 🔨 Build-System
|
## 🔨 Build-System
|
||||||
@@ -311,20 +344,21 @@ npm install
|
|||||||
npm run build # Alles bauen (JS + CSS + PHP)
|
npm run build # Alles bauen (JS + CSS + PHP)
|
||||||
npm run build:js # Nur JavaScript obfuscieren
|
npm run build:js # Nur JavaScript obfuscieren
|
||||||
npm run build:css # Nur CSS minifizieren
|
npm run build:css # Nur CSS minifizieren
|
||||||
|
npm run deploy # Build + Deploy zu main Branch
|
||||||
npm run clean # dist/ Ordner löschen
|
npm run clean # dist/ Ordner löschen
|
||||||
```
|
```
|
||||||
|
|
||||||
### Ausgabe
|
### Build-Ausgabe (`dist/`)
|
||||||
|
|
||||||
Nach dem Build enthält der `dist/` Ordner:
|
Nach dem Build enthält der `dist/` Ordner im develop Branch:
|
||||||
|
|
||||||
```
|
```
|
||||||
dist/
|
dist/
|
||||||
├── assets/
|
├── assets/
|
||||||
│ ├── css/
|
│ ├── css/
|
||||||
│ │ └── style.css # Minifiziert
|
│ │ └── style.css # Minifiziert (-25%)
|
||||||
│ └── js/
|
│ └── js/
|
||||||
│ ├── main.js # Obfusciert
|
│ ├── main.js # Obfusciert (Code-Schutz)
|
||||||
│ ├── contact.js # Obfusciert
|
│ ├── contact.js # Obfusciert
|
||||||
│ └── cookie-consent.js # Obfusciert
|
│ └── cookie-consent.js # Obfusciert
|
||||||
├── config/
|
├── config/
|
||||||
@@ -336,6 +370,16 @@ dist/
|
|||||||
└── functions.php # Kopiert
|
└── functions.php # Kopiert
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Deploy-Prozess
|
||||||
|
|
||||||
|
Das `npm run deploy` Script:
|
||||||
|
1. Prüft ob du auf `develop` bist
|
||||||
|
2. Führt `npm run build` aus
|
||||||
|
3. Wechselt zu `main`
|
||||||
|
4. Kopiert `dist/` Inhalte direkt ins Root
|
||||||
|
5. Committed und pusht zu `origin/main`
|
||||||
|
6. Wechselt zurück zu `develop`
|
||||||
|
|
||||||
## 📋 Voraussetzungen
|
## 📋 Voraussetzungen
|
||||||
|
|
||||||
- **Node.js 18+** (für Build-System)
|
- **Node.js 18+** (für Build-System)
|
||||||
|
|||||||
Reference in New Issue
Block a user