71 lines
1.9 KiB
Markdown
71 lines
1.9 KiB
Markdown
# Webklar Kundenbereich
|
|
|
|
Kundenportal für Website-Projekte. Liest **ausschließlich** aus `woms-database` auf `ticket.webklar.com` (Ticketsystem). Es gibt **keine** eigene Portal-Datenbank mehr.
|
|
|
|
- **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
|