docs: Update README with new structure
This commit is contained in:
97
README.md
97
README.md
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Shared Backend-Komponenten für die HexaHost.de Website. Dieses Repository enthält wiederverwendbare PHP-Templates, JavaScript-Module, CSS-Styles und Konfigurationsdateien.
|
Shared Backend-Komponenten für die HexaHost.de Website. Dieses Repository enthält wiederverwendbare PHP-Templates, JavaScript-Module, CSS-Styles und Konfigurationsdateien.
|
||||||
|
|
||||||
> ⚠️ **Wichtig:** Dieses Repository ist abhängig vom [HexaHost-Frontend](https://github.com/theoneandonlymace/HexaHost-Frontend) und muss in dessen `public/`-Verzeichnis integriert werden, um zu funktionieren.
|
> ⚠️ **Wichtig:** Dieses Repository ist abhängig vom [HexaHost-Frontend](../HexaHost-Frontend) und muss in dessen `public/`-Verzeichnis integriert werden, um zu funktionieren.
|
||||||
|
|
||||||
## 📦 Inhalt
|
## 📦 Inhalt
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ HexaHost-Backend/
|
|||||||
│ ├── header.php # HTML-Header-Template
|
│ ├── header.php # HTML-Header-Template
|
||||||
│ ├── footer.php # HTML-Footer-Template
|
│ ├── footer.php # HTML-Footer-Template
|
||||||
│ └── functions.php # PHP-Hilfsfunktionen
|
│ └── functions.php # PHP-Hilfsfunktionen
|
||||||
├── LICENSE # LGPL-2.1 Lizenz
|
├── LICENSE # BSL-1.1 Lizenz
|
||||||
└── README.md # Diese Datei
|
└── README.md # Diese Datei
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -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)
|
||||||
@@ -345,7 +389,22 @@ dist/
|
|||||||
|
|
||||||
## 📄 Lizenz
|
## 📄 Lizenz
|
||||||
|
|
||||||
GNU Lesser General Public License v2.1 (LGPL-2.1)
|
Dieses Projekt ist unter der **Business Source License 1.1 (BSL)** lizenziert.
|
||||||
|
|
||||||
|
### Was bedeutet das?
|
||||||
|
|
||||||
|
| Erlaubt | Nicht erlaubt (ohne kommerzielle Lizenz) |
|
||||||
|
|---------|------------------------------------------|
|
||||||
|
| ✅ Code ansehen & lernen | ❌ Kommerzieller Einsatz |
|
||||||
|
| ✅ Privater, nicht-kommerzieller Gebrauch | ❌ Nutzung für SaaS/Hosting-Dienste |
|
||||||
|
| ✅ Modifikationen für persönliche Zwecke | ❌ Unternehmensnutzung |
|
||||||
|
| ✅ Akademische/Bildungszwecke | ❌ Weiterverkauf oder Sublizenzierung |
|
||||||
|
|
||||||
|
**Änderungsdatum:** Am 16. Januar 2030 wird der Code automatisch unter der **GPL v3** verfügbar.
|
||||||
|
|
||||||
|
**Kommerzielle Lizenz:** Für kommerzielle Nutzung kontaktieren Sie bitte kontakt@hexahost.de
|
||||||
|
|
||||||
|
Siehe [LICENSE](LICENSE) für den vollständigen Lizenztext.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user