Docs: fahrschuldesk Projektplan angelegt
This commit is contained in:
329
docs/fahrschuldesk/PLAN.md
Normal file
329
docs/fahrschuldesk/PLAN.md
Normal file
@@ -0,0 +1,329 @@
|
|||||||
|
# fahrschuldesk — Projektplan
|
||||||
|
|
||||||
|
## 1. Überblick
|
||||||
|
|
||||||
|
**fahrschuldesk** ist eine SaaS-Plattform zur Verwaltung von Fahrschulen. Plattformbetreiber (Admin-Team) können Fahrschulen als Mandanten anlegen und verwalten. Jede Fahrschule erhält eine modulare Oberfläche mit Kundenverwaltung, Kalender, Messenger und optionaler Lernsoftware.
|
||||||
|
|
||||||
|
**Status:** Planungsphase (Initialsetup)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. Architektur
|
||||||
|
|
||||||
|
### 2.1 Domains
|
||||||
|
|
||||||
|
| Domain | Zweck | Pfad |
|
||||||
|
|---|---|---|
|
||||||
|
| `fahrschuldesk.de` | WebUI (Frontend) | `www/fahrschuldesk.de/public/` |
|
||||||
|
| `api.fahrschuldesk.de` | REST API (Backend) | `www/api.fahrschuldesk.de/public/` |
|
||||||
|
|
||||||
|
### 2.2 Tech-Stack
|
||||||
|
|
||||||
|
- **Frontend:** Vue 3 + Vite (SPA)
|
||||||
|
- **Backend:** PHP (Laravel oder Slim Framework)
|
||||||
|
- **Datenbank:** PostgreSQL (fahrschuldesk DB, Host: 10.255.30.11:5433)
|
||||||
|
- **Auth:** JWT-basiert
|
||||||
|
- **Deploy:** Git → Server via rsync
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. Hierarchie & Datenmodell
|
||||||
|
|
||||||
|
```
|
||||||
|
Plattform-Admins (intern)
|
||||||
|
└── Fahrschule (Mandant)
|
||||||
|
└── Filialen
|
||||||
|
└── Benutzer
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3.1 Tabellen
|
||||||
|
|
||||||
|
#### Plattform-Admins (interne Verwaltung)
|
||||||
|
```
|
||||||
|
platform_admins
|
||||||
|
- id
|
||||||
|
- email (unique)
|
||||||
|
- password_hash
|
||||||
|
- name
|
||||||
|
- role (super_admin | support | sales)
|
||||||
|
- created_at
|
||||||
|
- updated_at
|
||||||
|
- last_login_at
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Fahrschulen (Mandanten)
|
||||||
|
```
|
||||||
|
tenants
|
||||||
|
- id
|
||||||
|
- name
|
||||||
|
- slug (unique, für Subdomain?)
|
||||||
|
- email (Rechnungs-Kontakt)
|
||||||
|
- phone
|
||||||
|
- address
|
||||||
|
- status (active | suspended | trial)
|
||||||
|
- trial_ends_at
|
||||||
|
- created_at
|
||||||
|
- updated_at
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Filialen
|
||||||
|
```
|
||||||
|
branches
|
||||||
|
- id
|
||||||
|
- tenant_id (FK)
|
||||||
|
- name
|
||||||
|
- address
|
||||||
|
- phone
|
||||||
|
- email
|
||||||
|
- opening_hours (JSON)
|
||||||
|
- created_at
|
||||||
|
- updated_at
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Benutzer
|
||||||
|
```
|
||||||
|
users
|
||||||
|
- id
|
||||||
|
- tenant_id (FK)
|
||||||
|
- branch_id (FK, nullable)
|
||||||
|
- email (unique pro Tenant)
|
||||||
|
- password_hash
|
||||||
|
- first_name
|
||||||
|
- last_name
|
||||||
|
- user_type (office | instructor | lecturer | student | admin)
|
||||||
|
- status (active | inactive)
|
||||||
|
- created_at
|
||||||
|
- updated_at
|
||||||
|
- last_login_at
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Module (pro Fahrschule zuweisbar)
|
||||||
|
```
|
||||||
|
modules
|
||||||
|
- id
|
||||||
|
- key (office | calendar | messenger | learning_blank | learning_premium)
|
||||||
|
- name
|
||||||
|
- description
|
||||||
|
- monthly_price
|
||||||
|
- is_active (Plattform-global)
|
||||||
|
|
||||||
|
tenant_modules
|
||||||
|
- id
|
||||||
|
- tenant_id (FK)
|
||||||
|
- module_id (FK)
|
||||||
|
- status (enabled | disabled)
|
||||||
|
- enabled_at
|
||||||
|
- expires_at (nullable)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Lerninhalte (Premium-Modul)
|
||||||
|
```
|
||||||
|
learning_contents
|
||||||
|
- id
|
||||||
|
- tenant_id (FK, nullable — null = Plattform-global)
|
||||||
|
- category
|
||||||
|
- title
|
||||||
|
- description
|
||||||
|
- content_type (video | document | quiz | exercise)
|
||||||
|
- content_url
|
||||||
|
- thumbnail_url
|
||||||
|
- is_premium (nur mit Premium-Modul)
|
||||||
|
- created_at
|
||||||
|
- updated_at
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Fahrschüler-Fortschritt
|
||||||
|
```
|
||||||
|
student_progress
|
||||||
|
- id
|
||||||
|
- user_id (FK, student)
|
||||||
|
- content_id (FK)
|
||||||
|
- status (not_started | in_progress | completed)
|
||||||
|
- completed_at
|
||||||
|
- notes (Lehrer-Kommentare)
|
||||||
|
- created_at
|
||||||
|
- updated_at
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. API-Struktur
|
||||||
|
|
||||||
|
### 4.1 Auth
|
||||||
|
```
|
||||||
|
POST /api/auth/login (Admin/Login)
|
||||||
|
POST /api/auth/logout
|
||||||
|
GET /api/auth/me
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4.2 Plattform-Admin (nur Admins)
|
||||||
|
```
|
||||||
|
GET /api/admin/tenants
|
||||||
|
POST /api/admin/tenants
|
||||||
|
GET /api/admin/tenants/:id
|
||||||
|
PUT /api/admin/tenants/:id
|
||||||
|
DELETE /api/admin/tenants/:id
|
||||||
|
|
||||||
|
GET /api/admin/tenants/:id/modules
|
||||||
|
POST /api/admin/tenants/:id/modules
|
||||||
|
DELETE /api/admin/tenants/:id/modules/:moduleId
|
||||||
|
|
||||||
|
GET /api/admin/platform-modules
|
||||||
|
GET /api/admin/platform-modules/:id
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4.3 Tenant-Admin (Fahrschule)
|
||||||
|
```
|
||||||
|
GET /api/branches
|
||||||
|
POST /api/branches
|
||||||
|
PUT /api/branches/:id
|
||||||
|
DELETE /api/branches/:id
|
||||||
|
|
||||||
|
GET /api/users
|
||||||
|
POST /api/users
|
||||||
|
GET /api/users/:id
|
||||||
|
PUT /api/users/:id
|
||||||
|
DELETE /api/users/:id
|
||||||
|
|
||||||
|
GET /api/my-modules
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4.4 Users (allgemein pro Tenant)
|
||||||
|
```
|
||||||
|
GET /api/calendar/events
|
||||||
|
POST /api/calendar/events
|
||||||
|
PUT /api/calendar/events/:id
|
||||||
|
DELETE /api/calendar/events/:id
|
||||||
|
|
||||||
|
GET /api/messages
|
||||||
|
POST /api/messages
|
||||||
|
GET /api/messages/conversations
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4.5 Lernsoftware
|
||||||
|
```
|
||||||
|
GET /api/learning/contents
|
||||||
|
GET /api/learning/contents/:id
|
||||||
|
GET /api/learning/my-progress
|
||||||
|
POST /api/learning/my-progress
|
||||||
|
PUT /api/learning/my-progress/:contentId
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. Rollen & Rechte
|
||||||
|
|
||||||
|
### Plattform-Admins (intern)
|
||||||
|
| Rolle | Rechte |
|
||||||
|
|---|---|
|
||||||
|
| super_admin | Alles: Tenants, Admins, Module, Settings |
|
||||||
|
| support | Tenants einsehen/verwalten, keine Admins |
|
||||||
|
| sales | Tenants anlegen, keine Settings |
|
||||||
|
|
||||||
|
### Fahrschul-Benutzer
|
||||||
|
| Typ | Beschreibung |
|
||||||
|
|---|---|
|
||||||
|
| admin | Voller Zugriff auf eigene Fahrschule |
|
||||||
|
| office | Büromitarbeiter: Kunden, Kalender, Berichte |
|
||||||
|
| instructor | Fahrlehrer: Kalender, eigene Fahrschüler |
|
||||||
|
| lecturer | Dozent: Kalender, eigene Unterrichtseinheiten |
|
||||||
|
| student | Fahrschüler: Lernsoftware, eigener Fortschritt |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 6. Modul-System
|
||||||
|
|
||||||
|
### 6.1 Verfügbare Module
|
||||||
|
|
||||||
|
| Key | Name | Beschreibung |
|
||||||
|
|---|---|---|
|
||||||
|
| `office` | Office | Kundenverwaltung, Fahrzeugverwaltung, Berichte |
|
||||||
|
| `calendar` | Kalender | Terminplanung, Unterrichtszeiten |
|
||||||
|
| `messenger` | Messenger | Interne Kommunikation |
|
||||||
|
| `learning_blank` | Lernsoftware (Blanko) | Eigene Inhalte erstellen, keine Premium-Inhalte |
|
||||||
|
| `learning_premium` | Lernsoftware (Premium) | Inkl. vorgefertigter Lerninhalte |
|
||||||
|
|
||||||
|
### 6.2 Modul-Zuordnung
|
||||||
|
|
||||||
|
- Jede Fahrschule kann Module einzeln aktivieren/deaktivieren
|
||||||
|
- Preise werden pro Modul hinterlegt (für Abrechnung)
|
||||||
|
- Das Modul `learning_blank` und `learning_premium` schließen sich gegenseitig aus
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 7. Frontend-Struktur (fahrschuldesk.de)
|
||||||
|
|
||||||
|
```
|
||||||
|
src/
|
||||||
|
├── views/
|
||||||
|
│ ├── auth/
|
||||||
|
│ │ ├── Login.vue
|
||||||
|
│ │ └── Logout.vue
|
||||||
|
│ ├── admin/ (Plattform-Admin-Bereich)
|
||||||
|
│ │ ├── Dashboard.vue
|
||||||
|
│ │ ├── Tenants.vue
|
||||||
|
│ │ ├── TenantEdit.vue
|
||||||
|
│ │ └── Modules.vue
|
||||||
|
│ ├── tenant/ (Fahrschule-Bereich)
|
||||||
|
│ │ ├── Dashboard.vue
|
||||||
|
│ │ ├── Users.vue
|
||||||
|
│ │ ├── Branches.vue
|
||||||
|
│ │ ├── Office.vue
|
||||||
|
│ │ ├── Calendar.vue
|
||||||
|
│ │ ├── Messenger.vue
|
||||||
|
│ │ └── Learning.vue
|
||||||
|
│ └── student/ (Fahrschüler-Bereich)
|
||||||
|
│ ├── Dashboard.vue
|
||||||
|
│ └── Learning.vue
|
||||||
|
├── components/
|
||||||
|
├── stores/ (Pinia)
|
||||||
|
├── router/
|
||||||
|
└── api/ (API-Client)
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 8. Deployment-Workflow
|
||||||
|
|
||||||
|
```
|
||||||
|
Lokal (~/drivetimeplaner/www/fahrschuldesk.de/)
|
||||||
|
└── git commit + push
|
||||||
|
↓
|
||||||
|
Git (https://git.shadow-land.de/madgerm/drivetimeplaner)
|
||||||
|
↓ git push (oder rsync via CI/CD)
|
||||||
|
Server (/srv/web/fahrschuldesk/domains/fahrschuldesk.de/public/)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Sync-Befehle
|
||||||
|
```bash
|
||||||
|
# Server → Lokal (Daten holen)
|
||||||
|
rsync -az --exclude='storage/sessions/' --exclude='storage/database/' \
|
||||||
|
-e "ssh -p 2225" fahrschuldesk@fahrschuldesk.de:/srv/web/fahrschuldesk/domains/ www/
|
||||||
|
|
||||||
|
# Lokal → Server (deployen)
|
||||||
|
rsync -az --exclude='storage/sessions/' --exclude='storage/database/' \
|
||||||
|
-e "ssh -p 2225" www/fahrschuldesk.de/public/ \
|
||||||
|
fahrschuldesk@fahrschuldesk.de:/srv/web/fahrschuldesk/domains/fahrschuldesk.de/public/
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 9. Offene Fragen / Next Steps
|
||||||
|
|
||||||
|
- [ ] Tech-Stack final abstimmen (Laravel vs. Slim vs. anderes?)
|
||||||
|
- [ ] Auth-Flow: Login-Seite designen
|
||||||
|
- [ ] Erste Migration: Plattform-Admins + Tenants + Users
|
||||||
|
- [ ] Mockups/UI-Design für Dashboard
|
||||||
|
- [ ] Premium-Lerninhalte: woher kommen? Eigene Erstellung oder Drittanbieter?
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 10. Phase 1 — Erste Schritte
|
||||||
|
|
||||||
|
### Ziel: Grundgerüst stehen
|
||||||
|
|
||||||
|
1. **DB-Schema:** Migrationen schreiben für alle Tabellen
|
||||||
|
2. **API-Skelett:** Auth + Tenant-CRUD + Module-CRUD
|
||||||
|
3. **Frontend-Skelett:** Vue 3 + Vite + Router + Pinia
|
||||||
|
4. **Login-Seite:** Plattform-Admin Login
|
||||||
|
5. **Admin-Dashboard:** Tenants auflisten, anlegen, Module zuweisen
|
||||||
Reference in New Issue
Block a user