b1363aeab985eab2449fa80238143afe932bce9e
- Any-LLM Gateway setup with Docker Compose - Laravel 11 admin interface with Livewire - Dashboard with usage statistics and charts - Gateway Users management with budget tracking - API Keys management with revocation - Budget templates with assignment - Usage Logs with filtering and CSV export - Model Pricing management with calculator - PostgreSQL database integration - Complete authentication system for admins
Any-LLM Gateway + Laravel Admin
Vollständiges Docker-Setup mit:
- Any-LLM Gateway (API Gateway für LLMs)
- Laravel Admin Panel (Verwaltungsoberfläche)
- PostgreSQL (Datenbank)
- Adminer (Datenbank-Management-Tool)
- Gateway Tester (Test-Oberfläche)
🚀 Quick Start
Voraussetzungen
- Docker & Docker Compose installiert
- Ports 80, 8000, 8080, 8081 verfügbar
Installation
cd /opt/any-llm
./setup-laravel.sh
Das Setup-Script führt automatisch aus:
- ✅ Laravel Installation
- ✅ Livewire & Breeze Setup
- ✅ Docker Container Build & Start
- ✅ Datenbank-Migrationen
- ✅ Admin-User Erstellung
- ✅ Assets-Kompilierung
⏱️ Dauer: ca. 5-10 Minuten
🌐 URLs & Zugangsdaten
Services
| Service | URL | Beschreibung |
|---|---|---|
| Laravel Admin | http://localhost:80 | Verwaltungsoberfläche |
| Gateway API | http://localhost:8000 | Any-LLM Gateway |
| Gateway Tester | http://localhost:8080 | Test-Interface |
| Adminer | http://localhost:8081 | PostgreSQL Management |
Login-Daten
Laravel Admin
Email: admin@example.com
Password: password123
Adminer (PostgreSQL)
System: PostgreSQL
Server: postgres
Username: gateway
Password: gateway
Database: gateway
📁 Projekt-Struktur
/opt/any-llm/
├── config.yml # Gateway Konfiguration
├── docker-compose.yml # Docker Services
├── setup-laravel.sh # Setup Script
│
├── laravel/ # Laravel Docker Config
│ ├── Dockerfile
│ ├── nginx.conf
│ ├── supervisord.conf
│ └── php.ini
│
├── laravel-app/ # Laravel Projekt (wird generiert)
│ ├── app/
│ ├── database/
│ ├── resources/
│ └── ...
│
├── web/ # Gateway Tester
│ ├── index.html
│ └── default.conf
│
└── LARAVEL_IMPLEMENTATION.md # Detailliertes Implementierungskonzept
🔧 Docker Commands
Container Management
# Alle Container starten
docker compose up -d
# Alle Container stoppen
docker compose down
# Logs anzeigen
docker compose logs -f
# Logs eines bestimmten Services
docker compose logs -f laravel
docker compose logs -f gateway
# Container neu bauen
docker compose up -d --build
# In Container einloggen
docker compose exec laravel bash
docker compose exec postgres psql -U gateway -d gateway
Laravel Commands (im Container)
# Artisan Commands
docker compose exec laravel php artisan migrate
docker compose exec laravel php artisan make:model ModelName
docker compose exec laravel php artisan make:controller ControllerName
# Composer
docker compose exec laravel composer install
docker compose exec laravel composer require package-name
# NPM
docker compose exec laravel npm install
docker compose exec laravel npm run dev
docker compose exec laravel npm run build
# Tinker (Laravel REPL)
docker compose exec laravel php artisan tinker
🗄️ Datenbank
Schema
Die Gateway-Datenbank enthält folgende Tabellen:
users → Gateway API Users
api_keys → Virtual Keys
usage_logs → Request Tracking
budgets → Budget Definitions
budget_reset_logs → Budget History
model_pricing → Model Cost Configuration
admins → Laravel Admin Users (neu)
Zugriff
Via Adminer Web-Interface:
- http://localhost:8081
- Login mit oben genannten Credentials
Via CLI:
docker compose exec postgres psql -U gateway -d gateway
# Beispiel-Queries
SELECT * FROM users;
SELECT * FROM usage_logs ORDER BY timestamp DESC LIMIT 10;
🛠️ Entwicklung
Laravel Development
# In Laravel Container einloggen
docker compose exec laravel bash
# Routes anzeigen
php artisan route:list
# Model erstellen
php artisan make:model MyModel -m
# Controller erstellen
php artisan make:controller MyController --resource
# Livewire Component erstellen
php artisan make:livewire MyComponent
Frontend Development
# NPM Dev Server (mit Hot Reload)
docker compose exec laravel npm run dev
# Production Build
docker compose exec laravel npm run build
# Tailwind JIT Mode
# → Läuft automatisch mit npm run dev
📝 Nächste Schritte
1. Models erstellen
Folge dem Implementierungskonzept in LARAVEL_IMPLEMENTATION.md:
docker compose exec laravel php artisan make:model GatewayUser
docker compose exec laravel php artisan make:model ApiKey
docker compose exec laravel php artisan make:model UsageLog
docker compose exec laravel php artisan make:model Budget
docker compose exec laravel php artisan make:model ModelPricing
2. Controllers implementieren
docker compose exec laravel php artisan make:controller DashboardController
docker compose exec laravel php artisan make:controller GatewayUserController --resource
3. Views erstellen
Die Views werden in laravel-app/resources/views/ erstellt.
Struktur:
resources/views/
├── layouts/
│ ├── app.blade.php
│ └── navigation.blade.php
├── dashboard.blade.php
├── gateway-users/
│ ├── index.blade.php
│ ├── show.blade.php
│ └── ...
└── ...
🐛 Troubleshooting
Container startet nicht
# Logs prüfen
docker compose logs laravel
# Container neu bauen
docker compose down
docker compose up -d --build
Permissions Fehler
# Storage Permissions setzen
docker compose exec laravel chmod -R 777 storage bootstrap/cache
Port bereits belegt
Ports in docker-compose.yml anpassen:
laravel:
ports:
- "8001:80" # Statt 80:80
Datenbank Connection Fehler
# Prüfe ob PostgreSQL läuft
docker compose ps postgres
# Teste Connection
docker compose exec laravel php artisan migrate:status
Assets werden nicht geladen
# Assets neu kompilieren
docker compose exec laravel npm run build
# Storage Link neu erstellen
docker compose exec laravel php artisan storage:link
🔐 Sicherheit
Production Checklist
Vor dem Production-Deployment:
-
✅
.envWerte ändern:APP_ENV=production APP_DEBUG=false APP_KEY=... (neu generieren!) -
✅ Starkes Admin-Passwort setzen
-
✅ PostgreSQL Passwort ändern
-
✅ Adminer auf localhost beschränken oder deaktivieren
-
✅ SSL/TLS einrichten (Let's Encrypt)
-
✅ Laravel Caches aktivieren:
php artisan config:cache php artisan route:cache php artisan view:cache
📚 Dokumentation
- Implementierungskonzept:
LARAVEL_IMPLEMENTATION.md - Any-LLM Gateway: https://github.com/mozilla-ai/any-llm
- Laravel Docs: https://laravel.com/docs
- Livewire Docs: https://livewire.laravel.com
- Tailwind CSS: https://tailwindcss.com
🆘 Support
Bei Fragen oder Problemen:
- Logs prüfen:
docker compose logs -f - Container Status:
docker compose ps - Implementierungskonzept lesen:
LARAVEL_IMPLEMENTATION.md
📋 Checkliste
- Setup Script ausgeführt
- Laravel läuft auf http://localhost:80
- Admin-Login funktioniert
- Adminer erreichbar (http://localhost:8081)
- Gateway API funktioniert (http://localhost:8000)
- Models erstellt (siehe Implementierungskonzept)
- Controllers implementiert
- Dashboard Views erstellt
- Statistiken funktionieren
- Production-ready gemacht
Viel Erfolg mit der Entwicklung! 🚀
Description
Any-LLM Gateway with Laravel Admin Interface - Comprehensive AI gateway management system combining Any-LLM Gateway with Laravel-based administrative interface for managing AI provider access, user authentication, usage tracking, and budgets.
Languages
PHP
57.8%
Blade
41.9%
Dockerfile
0.2%
JavaScript
0.1%