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:
|
||||
|
||||
```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
|
||||
# Aus dem Projekt-Root-Verzeichnis
|
||||
cp -r HexaHost-Backend/assets/* HexaHost-Frontend/public/assets/
|
||||
cp -r HexaHost-Backend/config/* HexaHost-Frontend/public/config/
|
||||
cp -r HexaHost-Backend/includes/* HexaHost-Frontend/public/includes/
|
||||
cd HexaHost-Backend && git checkout main && cp -r assets config includes ../HexaHost-Frontend/public/ && git checkout develop
|
||||
```
|
||||
|
||||
### Zielstruktur im Frontend
|
||||
@@ -270,14 +278,27 @@ $debug_config = [
|
||||
|
||||
```
|
||||
Branches:
|
||||
├── main → Produktions-Code (mit obfuscated dist/)
|
||||
└── develop → Entwicklungs-Code (lesbarer Source)
|
||||
├── main → Produktions-Code (optimierte Dateien direkt im Root)
|
||||
└── develop → Entwicklungs-Code (lesbarer Source + Build-System)
|
||||
```
|
||||
|
||||
| Branch | Inhalt | Verwendung |
|
||||
|--------|--------|------------|
|
||||
| `main` | Lesbare Quellen + `dist/` Ordner | Für Produktion: Dateien aus `dist/` verwenden |
|
||||
| `develop` | Nur lesbare Quellen + Build-System | Für Entwicklung |
|
||||
| `main` | Optimierte `assets/`, `config/`, `includes/` im Root | Für Produktion: direkt kopieren |
|
||||
| `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
|
||||
|
||||
@@ -289,12 +310,24 @@ npm run build # dist/ neu generieren
|
||||
git add .
|
||||
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 merge develop
|
||||
npm run build # dist/ aktualisieren
|
||||
git add dist/
|
||||
git commit -m "build: Update production files"
|
||||
git checkout develop -- dist/
|
||||
# Dateien von dist/ ins Root verschieben
|
||||
mv dist/assets dist/config dist/includes .
|
||||
rm -rf dist/
|
||||
git add -A && git commit -m "deploy: Update"
|
||||
git push origin main
|
||||
git checkout develop
|
||||
```
|
||||
|
||||
## 🔨 Build-System
|
||||
@@ -311,20 +344,21 @@ npm install
|
||||
npm run build # Alles bauen (JS + CSS + PHP)
|
||||
npm run build:js # Nur JavaScript obfuscieren
|
||||
npm run build:css # Nur CSS minifizieren
|
||||
npm run deploy # Build + Deploy zu main Branch
|
||||
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/
|
||||
├── assets/
|
||||
│ ├── css/
|
||||
│ │ └── style.css # Minifiziert
|
||||
│ │ └── style.css # Minifiziert (-25%)
|
||||
│ └── js/
|
||||
│ ├── main.js # Obfusciert
|
||||
│ ├── main.js # Obfusciert (Code-Schutz)
|
||||
│ ├── contact.js # Obfusciert
|
||||
│ └── cookie-consent.js # Obfusciert
|
||||
├── config/
|
||||
@@ -336,6 +370,16 @@ dist/
|
||||
└── 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
|
||||
|
||||
- **Node.js 18+** (für Build-System)
|
||||
|
||||
Reference in New Issue
Block a user