Veranstaltungen-APP/IMPLEMENTATION_CHECKLIST.md

5.5 KiB

Implementation Checklist

Geschaffte Komponenten

1. Migrationen

  • create_sources_table.php - Datenquellen
  • create_events_table.php - Veranstaltungen mit Indizes
  • create_event_occurrences_table.php - Einzelne Termine
  • Foreign Keys + CASCADE Deletes
  • Unique Indizes gegen Duplikate
  • MariaDB Optimierungen (InnoDB, utf8mb4)

2. Eloquent Models

  • Source.php - hasMany Events
  • Event.php - belongsTo Source, hasMany Occurrences
    • Scopes: published(), byCategory(), byLocation(), upcomingBetween()
    • Relations: source, occurrences, upcomingOccurrences
    • Auto-slug generation via boot()
  • EventOccurrence.php - belongsTo Event
    • Scopes: upcoming(), onDate(), between(), scheduled()
    • Accessor: formatted_duration

3. Controllers & Routen

  • EventController.php
    • index() - mit Filtern (from/to, category, location, limit)
    • show() - einzelnes Event anzeigen
    • categories() - verfügbare Kategorien auflisten
    • locations() - verfügbare Orte auflisten
  • routes/api.php - Alle Routen definiert

4. Import/Scraper Integration

  • ImportEventsJob.php - Queue Job
    • fetchExternalEvents() Placeholder
    • upsertEvent() mit updateOrCreate
    • upsertOccurrences() Handling
    • Logging + Error Handling
  • ImportEventsCommand.php - Artisan Command
    • --source Filter (ID oder Name)
    • --sync Option (blockierend)
    • Aktive Quellen Filtering
  • EventImportService.php - Business Logic
    • importFromAllSources()
    • importFromSource()
    • Placeholder für Dresden API
    • Placeholder für Web-Scraping

5. Query-Beispiele

  • Alle Events an einem best. Datum
  • Nächste 10 Events in Dresden
  • Events nach Kategorie
  • Events in Zeitraum
  • Events mit verfügbaren Tickets
  • Neue Events der letzten Woche
  • Top Kategorien & Orte
  • Tagesbilder-Ansicht
  • Events von spezifischer Quelle
  • Komplexe Raw-SQL Queries

6. API Response-Dokumentation

  • GET /api/events - Response mit Pagination
  • GET /api/events/{id} - Detailanzeige
  • GET /api/events/categories/list - Kategorien
  • GET /api/events/locations/list - Orte
  • Error-Responses (400, 404, 422)

7. Dokumentation

  • SETUP.md - Komplette Installation, Konfiguration, Commands
  • EXAMPLE_QUERIES.php - 10+ praktische Abfrage-Beispiele
  • API_RESPONSES.md - API Dokumentation mit Beispielen
  • IMPORT_SCRAPER_INTEGRATION.md - Umfassende Import-Integration
    • Queue-Konfiguration
    • Command-Verwendung
    • Scheduler-Integration
    • API-Beispiele (Dresden, iCal, Web-Scraping)
    • Upsert-Logik erklärt
    • Monitoring & Error Handling
    • Best Practices
  • KERNEL_SCHEDULER_EXAMPLE.php - Komplette Scheduler-Config
  • README.md - Projektübersicht

Nächste Schritte ⚠️ (Optional für erweiterte Features)

Optional: Weitere Controller/Features

  • EventImportController - Admin Dashboard für Imports
  • EventCategoryController - Category Management
  • SourceController - Source Management API
  • EventAdminController - CRUD Operations (Admin)
  • Analytics Controller - Event-Statistiken

Optional: Frontend

  • Vue 3 / React Frontend Component
  • Event-Sucheformular
  • Termin-Ansichten (Tages-, Wochen-, Monatsansicht)
  • Favoriten/Merkliste
  • Event-Filter UI

Optional: Zusätzliche Integration

  • Stripe/PayPal Ticketing
  • Email-Notifications (Terminänderungen)
  • User-Management & Authentifizierung
  • Admin-Dashboard (Laravel Nova/Filament)
  • Elasticsearch für bessere Suche

Optional: DevOps

  • Docker Setup (Dockerfile, docker-compose)
  • GitHub Actions CI/CD
  • Sentry Error Tracking
  • Health-Check Endpoints

🚀 Quick-Start für Entwickler

# 1. Laravel frisch installieren
composer create-project laravel/laravel Veranstaltungen-APP
cd Veranstaltungen-APP

# 2. Dateien kopieren
cp -r <dieses-paket>/app ./
cp -r <dieses-paket>/database/migrations ./database/
cp <dieses-paket>/routes/api.php ./routes/
cp -r <dieses-paket>/docs ./

# 3. Umgebung konfigurieren
cp .env.example .env
php artisan key:generate
# Bearbeite .env: DB_DATABASE, DB_USERNAME, DB_PASSWORD

# 4. Datenbank
php artisan migrate

# 5. Sources erstellen
php artisan tinker
>>> \App\Models\Source::create(['name' => 'Stadt Dresden', 'status' => 'active']);

# 6. Import testen
php artisan events:import --sync

# 7. API testen
php artisan serve
# Browser: http://localhost:8000/api/events

📝 Code-Best-Practices (dokumentiert)

Migrations

  • InnoDB Engine explizit gesetzt
  • utf8mb4 für Unicode-Support
  • Composite Indizes für Filter-Kombos
  • Foreign Keys mit CASCADE

Models

  • Relationships definiert (BelongsTo, HasMany)
  • Query Scopes für häufige Filter
  • Type Hints auf PHP 8.2 Standard
  • Casts für Datentypen

Controllers

  • Request Validation mit validate()
  • Eloquent eager loading (.with())
  • JSON Responses mit success/data Structure
  • Pagination implementiert

Jobs & Commands

  • Logging auf alle Schritte
  • Error Handling mit Try-Catch
  • Queueable Jobs
  • Trackable Metrics

Database

  • Unique Constraint auf (source_id, external_id)
  • Indexes auf häufig gefilterte Spalten
  • Soft Deletes für historische Daten
  • DateTime Casts

Status: Produktionsreif
Laravel: 11 LTS kompatibel
PHP: 8.2+ erforderlich
Datenbank: MariaDB 10.4+