Split API and frontend, migrate SQLite to PostgreSQL

- api.fahrschultermin.de: full API entry point with CORS + session auth
- fahrschultermin.de: frontend only, no more /api/v1 routing
- Database.php: PostgreSQL support (pgsql driver + lastval())
- All repositories: use Database::lastInsertId() for PG compatibility
- config/app.php: PostgreSQL connection settings + CORS config
- bootstrap.php: pass full $config to Database::configure()
- public/index.php: fetch-patch to redirect /api/v1 to api.fahrschultermin.de
- database/schema_pgsql.sql: full PostgreSQL schema (BIGSERIAL)
- database/import_pgsql.sql: 518 rows migrated from SQLite
This commit is contained in:
Hermes Agent
2026-05-18 23:49:42 +02:00
parent 33d61c2fc7
commit 2d6c0ad3aa
15 changed files with 930 additions and 89 deletions

View File

@@ -4,10 +4,35 @@ declare(strict_types=1);
return [
'app_name' => 'DriveTime Planner',
'env' => 'local',
'debug' => true,
'env' => 'production',
'debug' => false,
// Database: set db_driver to 'pgsql' or 'sqlite'
'db_driver' => 'pgsql',
'db_host' => '127.0.0.1',
'db_port' => '5433',
'db_database' => 'fahrschultermin',
'db_username' => 'fahrschultermin_api',
'db_password' => 'X9wL3pN7kRtHvMbZs4cGfYu2Dj6qAe8t',
// Legacy SQLite path (used when db_driver = 'sqlite')
'db_path' => __DIR__ . '/../storage/database/app.sqlite',
// Session
'session_path' => __DIR__ . '/../storage/sessions',
'session_name' => 'drive_time_session',
'session_domain' => '.fahrschultermin.de',
// API
'api_base_url' => 'https://api.fahrschultermin.de',
'frontend_url' => 'https://fahrschultermin.de',
// CORS
'cors_allowed_origins' => [
'https://fahrschultermin.de',
'https://www.fahrschultermin.de',
],
// Frontend asset path (for fahrschultermin.de frontend)
'frontend_entry' => __DIR__ . '/../public/assets/index.js',
];