161 lines
4.6 KiB
Markdown
161 lines
4.6 KiB
Markdown
# CLAUDE.md
|
|
|
|
## Projekt-Übersicht
|
|
|
|
**mivita.care** - Laravel 11 CRM für Netzwerk-Marketing (MLM) mit E-Commerce, Provisionsberechnung, DHL-Versand und Multi-Tenancy.
|
|
|
|
## Tech Stack
|
|
|
|
| Komponente | Technologie |
|
|
|------------|-------------|
|
|
| Framework | Laravel 11 (Classic MVC) |
|
|
| Frontend | Bootstrap 4 (Appwork Theme), Blade Templates |
|
|
| Auth | Laravel Passport (OAuth2/API) |
|
|
| Database | MySQL 8 |
|
|
| Data Tables | Yajra Datatables |
|
|
| Testing | Pest PHP |
|
|
| Queue | Laravel Horizon + Redis |
|
|
| PDF | barryvdh/laravel-dompdf |
|
|
| Slugs | Eloquent-Sluggable |
|
|
| Forms | Spatie\Html |
|
|
|
|
## Wichtige Regeln (Constraints)
|
|
|
|
1. **Kein Livewire / Keine Vue-Komponenten** - Nutze reines Blade + Bootstrap
|
|
2. **Formulare** - Nutze `Spatie\Html` für Formular-Generierung (nicht reines HTML)
|
|
3. **Datentabellen** - Nutze ausschließlich `Yajra\Datatables` für Listenansichten im Admin
|
|
4. **PDF** - Rechnungen/Berichte via `barryvdh/laravel-dompdf`
|
|
5. **SEO/Slugs** - Nutze `Eloquent-Sluggable` für Berater-Profile/Produkte
|
|
6. **Code Style** - Immer `./vendor/bin/pint` nach Änderungen ausführen
|
|
|
|
## Custom Packages
|
|
|
|
| Package | Pfad | Beschreibung |
|
|
|---------|------|--------------|
|
|
| DHL Integration | `packages/acme-laravel-dhl` | Versand-Labels und Tracking |
|
|
| Shopping Cart | `packages/digital-bird/shoppingcart` | Warenkorb-System |
|
|
|
|
## Projekt-Struktur
|
|
|
|
```
|
|
app/
|
|
├── Console/Commands/ # Artisan Commands (Business*, User*)
|
|
├── Cron/ # Scheduled Task Logic
|
|
├── Http/Controllers/ # 40+ Controller
|
|
├── Models/ # Eloquent Models
|
|
├── Repositories/ # Data Access Layer
|
|
├── Services/ # Business Logic
|
|
│ └── BusinessPlan/ # MLM-Berechnungen
|
|
packages/ # Custom Packages
|
|
dev/ # Dokumentation
|
|
```
|
|
|
|
## Wichtige Dateien
|
|
|
|
- **MLM-Berechnung**: `app/Services/BusinessPlan/TreeCalcBotOptimized.php`
|
|
- **Cron Jobs**: `app/Console/Kernel.php`
|
|
- **Domain Resolver**: Multi-Tenant Middleware
|
|
- **Cart Systems**: AboOrderCart, HomepartyCart, ShopApiOrderCart
|
|
|
|
## Development Commands
|
|
|
|
### Laravel Basis
|
|
```bash
|
|
php artisan serve # Dev Server
|
|
php artisan migrate # Migrations
|
|
php artisan cache:clear # Cache leeren
|
|
php artisan config:clear
|
|
php artisan route:clear
|
|
php artisan view:clear
|
|
```
|
|
|
|
### Code Quality
|
|
```bash
|
|
./vendor/bin/pint # Code formatieren
|
|
./vendor/bin/pest # Tests ausführen
|
|
./vendor/bin/pest --filter=TestName # Einzelner Test
|
|
```
|
|
|
|
### IDE Helper
|
|
```bash
|
|
php artisan ide-helper:generate
|
|
php artisan ide-helper:models
|
|
php artisan ide-helper:meta
|
|
```
|
|
|
|
### Assets
|
|
```bash
|
|
npm install && npm run dev # Development
|
|
npm run production # Production Build
|
|
```
|
|
|
|
### Business Commands
|
|
```bash
|
|
# Provisionsberechnung (empfohlen: optimierte Version)
|
|
php artisan business:store-optimized {month} {year}
|
|
php artisan business:store-optimized {month} {year} --clear
|
|
|
|
# Daten löschen
|
|
php artisan business:clear-data {month} {year} [--force]
|
|
|
|
# Level Reports
|
|
php artisan business:level-reports {month} {year}
|
|
|
|
# User Management
|
|
php artisan user:cleanup
|
|
php artisan user:make_abo_order
|
|
|
|
# Zahlungen
|
|
php artisan payments:check-accounts
|
|
|
|
# Test Account
|
|
php artisan business:test-account
|
|
```
|
|
|
|
## Scheduled Tasks (Cron)
|
|
|
|
| Zeit | Command | Beschreibung |
|
|
|------|---------|--------------|
|
|
| 02:00 | `payments:check-accounts` | Zahlungsprüfung |
|
|
| 03:00 | `business:store-optimized 0 0` | Provisionsberechnung |
|
|
| 03:30 | `user:cleanup` | User-Bereinigung |
|
|
| 04:00 | `user:make_abo_order` | Abo-Bestellungen |
|
|
|
|
## Docker Environment
|
|
|
|
```bash
|
|
docker-compose up -d # Services starten
|
|
./vendor/bin/sail artisan [command] # Artisan im Container
|
|
./vendor/bin/sail shell # Shell im Container
|
|
```
|
|
|
|
### Services
|
|
- **laravel.test** - Hauptanwendung (Traefik + SSL)
|
|
- **horizon** - Queue Worker
|
|
- **mysql** - MySQL 8.0
|
|
- **redis** - Cache/Session
|
|
- **mailpit** - Mail Testing (`mivita-mail.test`)
|
|
|
|
### Domains
|
|
- Main: `mivita.test`
|
|
- Wildcard: `*.mivita.test`
|
|
- Mail: `mivita-mail.test`
|
|
|
|
## MLM-Architektur
|
|
|
|
### Kernkonzepte
|
|
- **Consultants (Berater)**: Hierarchie mit Upline/Downline
|
|
- **TreeCalcBotOptimized**: Provisionsberechnung für MLM-Strukturen
|
|
- **BusinessPlan Services**: Sales Volumes, Ränge, Boni
|
|
|
|
### Performance
|
|
- Memory Monitoring in optimierten Commands
|
|
- Automatic Garbage Collection
|
|
- Performance Logging
|
|
|
|
## Hinweise für Claude
|
|
|
|
- Nutze immer `TreeCalcBotOptimized` für neue Business-Features
|
|
- Prüfe Custom Packages in `packages/` vor Änderungen
|
|
- Beachte Multi-Tenant Domain-Logik bei Routing-Änderungen
|
|
- DHL-Integration unterstützt Sandbox/Production Mode
|