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.
|
||||
|
||||
> ⚠️ **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
|
||||
|
||||
@@ -22,7 +22,7 @@ HexaHost-Backend/
|
||||
│ ├── header.php # HTML-Header-Template
|
||||
│ ├── footer.php # HTML-Footer-Template
|
||||
│ └── functions.php # PHP-Hilfsfunktionen
|
||||
├── LICENSE # LGPL-2.1 Lizenz
|
||||
├── LICENSE # BSL-1.1 Lizenz
|
||||
└── README.md # Diese Datei
|
||||
```
|
||||
|
||||
@@ -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)
|
||||
@@ -345,7 +389,22 @@ dist/
|
||||
|
||||
## 📄 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