Implementiere Kundenportal mit zentraler Appwrite-Anbindung.
Express-Server für Appwrite-Auth, Session, Projekt-Dashboard und Gitea-Webhook; statisches Frontend und Schema-Dokumentation für woms-database. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
70
README.md
Normal file
70
README.md
Normal file
@@ -0,0 +1,70 @@
|
||||
# Webklar Kundenbereich
|
||||
|
||||
Kundenportal für Website-Projekte. Liest ausschließlich aus der **zentralen Appwrite-Datenbank des Ticketsystems** (`woms-database` auf `ticket.webklar.com`).
|
||||
|
||||
- **Keine** Kundenanlage im Portal
|
||||
- **Keine** Admin-Funktionen
|
||||
- Login über **Appwrite Auth** (ein User pro Kunde, verknüpft über `customers.appwriteUserId`)
|
||||
|
||||
Verwaltung (Kunden, Passwörter, Projekte, Freischaltung): **Ticketsystem**.
|
||||
|
||||
## Struktur
|
||||
|
||||
```
|
||||
server/ Express-API, Appwrite, Gitea-Webhook
|
||||
public/ Login & Dashboard (statisch)
|
||||
```
|
||||
|
||||
## Schnellstart
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
# SESSION_SECRET (min. 32 Zeichen) und APPWRITE_API_KEY setzen
|
||||
npm install
|
||||
npm run dev
|
||||
```
|
||||
|
||||
Öffnen: http://localhost:3000
|
||||
|
||||
## API
|
||||
|
||||
| Methode | Pfad | Beschreibung |
|
||||
|---------|------|----------------|
|
||||
| POST | `/api/auth/login` | Appwrite Login + Portal-Prüfungen |
|
||||
| POST | `/api/auth/logout` | Session beenden |
|
||||
| GET | `/api/auth/me` | Aktueller Kunde |
|
||||
| GET | `/api/projects` | Eigene `websiteProjects` |
|
||||
| GET | `/api/features` | Eigene `portalFeatures` (enabled) |
|
||||
| POST | `/webhook/gitea?token=…` | Gitea Push → Deploy + DB-Update |
|
||||
|
||||
## Appwrite
|
||||
|
||||
Schema und Collection-Anlage: siehe [APPWRITE_SCHEMA.md](./APPWRITE_SCHEMA.md).
|
||||
|
||||
```
|
||||
Endpoint: https://ticket.webklar.com/v1
|
||||
Project: 6a1058610003c5a13a05
|
||||
Database: woms-database
|
||||
```
|
||||
|
||||
## Gitea / Preview
|
||||
|
||||
- Template: https://git.webklar.com/knso/webklar-preview-template.git
|
||||
- Webhook-URL: `https://project.webklar.com/webhook/gitea`
|
||||
- Secret: `GITEA_WEBHOOK_TOKEN` in `.env`
|
||||
- Vorschau: `https://<subdomain>.project.webklar.com`
|
||||
|
||||
`customerId` wird **im Ticketsystem** am `websiteProjects`-Eintrag gesetzt, nicht im Webhook.
|
||||
|
||||
## Deployment
|
||||
|
||||
```bash
|
||||
npm start
|
||||
# Reverse Proxy (nginx) → Port 3000
|
||||
# PREVIEW_DEPLOY_ROOT für statische Vorschau-Dateien
|
||||
```
|
||||
|
||||
## Repositories
|
||||
|
||||
- Portal: https://git.webklar.com/knso/Webklar-Kundenbereich.git
|
||||
- Template: https://git.webklar.com/knso/webklar-preview-template.git
|
||||
Reference in New Issue
Block a user