Slim API deployment - composer install + full CRUD endpoints
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule ^ index.php [QSA,L]
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"src/main.jsx": {
|
||||
"file": "assets/main-F76uNDS1.js",
|
||||
"name": "main",
|
||||
"src": "src/main.jsx",
|
||||
"isEntry": true,
|
||||
"css": [
|
||||
"assets/main-C54NZrM5.css"
|
||||
]
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>fahrschultermin.de – Erfolgreich eingerichtet</title>
|
||||
<style>
|
||||
body { font-family: sans-serif; line-height: 1.6; max-width: 800px; margin: 2rem auto; padding: 0 1rem; }
|
||||
h1 { color: #2c3e50; }
|
||||
.box { background: #f8f9fa; border-left: 4px solid #3498db; padding: 1rem; margin: 1.5rem 0; }
|
||||
code { background: #eee; padding: 0.2rem 0.4rem; border-radius: 3px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>✅ fahrschultermin.de ist betriebsbereit</h1>
|
||||
<p>Diese Seite wurde automatisch vom Webhosting‑Stack erzeugt.</p>
|
||||
<div class="box">
|
||||
<strong>Nächste Schritte:</strong>
|
||||
<ul>
|
||||
<li>Ersetze diesen Inhalt durch deine eigene Website.</li>
|
||||
<li>Lade Dateien in das öffentliche Verzeichnis dieser Domain hoch.</li>
|
||||
<li>Für PHP‑Anwendungen lege eine <code>index.php</code> an.</li>
|
||||
</ul>
|
||||
</div>
|
||||
<p><small>Server: core</small></p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
$bootstrap = require __DIR__ . '/../app/bootstrap.php';
|
||||
|
||||
use App\Http\Controllers\AppointmentsController;
|
||||
use App\Http\Controllers\AuthController;
|
||||
use App\Http\Controllers\BootstrapController;
|
||||
use App\Http\Controllers\InstructorsController;
|
||||
use App\Http\Controllers\ReferenceDataController;
|
||||
use App\Http\Controllers\StudentsController;
|
||||
use App\Http\Controllers\TenantsController;
|
||||
use App\Http\Controllers\UsersController;
|
||||
|
||||
$router = $bootstrap['router'];
|
||||
$request = new App\Support\Request();
|
||||
$path = $request->path();
|
||||
|
||||
if ($request->method() === 'OPTIONS') {
|
||||
http_response_code(204);
|
||||
exit;
|
||||
}
|
||||
|
||||
if (str_starts_with($path, '/api/v1')) {
|
||||
$auth = new AuthController();
|
||||
$bootstrapController = new BootstrapController();
|
||||
$students = new StudentsController();
|
||||
$references = new ReferenceDataController();
|
||||
$appointments = new AppointmentsController();
|
||||
$users = new UsersController();
|
||||
$tenants = new TenantsController();
|
||||
$instructors = new InstructorsController();
|
||||
|
||||
$router->post('/api/v1/auth/login', [$auth, 'login']);
|
||||
$router->post('/api/v1/auth/logout', [$auth, 'logout']);
|
||||
$router->get('/api/v1/auth/me', [$auth, 'me']);
|
||||
$router->get('/api/v1/bootstrap', $bootstrapController);
|
||||
$router->get('/api/v1/students', [$students, 'index']);
|
||||
$router->post('/api/v1/students', [$students, 'store']);
|
||||
$router->patch('/api/v1/students/{id}/training', [$students, 'updateTraining']);
|
||||
$router->patch('/api/v1/students/{id}', [$students, 'update']);
|
||||
$router->delete('/api/v1/students/{id}', [$students, 'destroy']);
|
||||
$router->get('/api/v1/lesson-types', [$references, 'lessonTypes']);
|
||||
$router->post('/api/v1/lesson-types', [$references, 'storeLessonType']);
|
||||
$router->post('/api/v1/lesson-types/reorder', [$references, 'reorderLessonTypes']);
|
||||
$router->patch('/api/v1/lesson-types/{id}', [$references, 'updateLessonType']);
|
||||
$router->delete('/api/v1/lesson-types/{id}', [$references, 'destroyLessonType']);
|
||||
$router->post('/api/v1/lesson-types/visibility', [$references, 'updateLessonTypeMatrix']);
|
||||
$router->get('/api/v1/license-class-templates', [$references, 'templates']);
|
||||
$router->post('/api/v1/license-class-templates', [$references, 'storeTemplate']);
|
||||
$router->patch('/api/v1/license-class-templates/{id}', [$references, 'updateTemplate']);
|
||||
$router->get('/api/v1/instructors', [$instructors, 'index']);
|
||||
$router->post('/api/v1/instructors', [$instructors, 'store']);
|
||||
$router->patch('/api/v1/instructors/{id}', [$instructors, 'update']);
|
||||
$router->get('/api/v1/users', [$users, 'index']);
|
||||
$router->post('/api/v1/users', [$users, 'store']);
|
||||
$router->patch('/api/v1/users/{id}', [$users, 'update']);
|
||||
$router->get('/api/v1/tenants', [$tenants, 'index']);
|
||||
$router->post('/api/v1/tenants', [$tenants, 'store']);
|
||||
$router->patch('/api/v1/tenants/{id}', [$tenants, 'update']);
|
||||
$router->patch('/api/v1/tenant/profile', [$tenants, 'updateOwn']);
|
||||
$router->get('/api/v1/appointments', [$appointments, 'index']);
|
||||
$router->post('/api/v1/appointments/validate', [$appointments, 'validate']);
|
||||
$router->post('/api/v1/appointments', [$appointments, 'store']);
|
||||
$router->patch('/api/v1/appointments/{id}', [$appointments, 'update']);
|
||||
$router->delete('/api/v1/appointments/{id}', [$appointments, 'destroy']);
|
||||
|
||||
$router->dispatch();
|
||||
exit;
|
||||
}
|
||||
|
||||
$assetManifestPath = __DIR__ . '/assets/.vite/manifest.json';
|
||||
$mainAsset = '/assets/index.js';
|
||||
$styleAsset = '/assets/index.css';
|
||||
|
||||
if (is_file($assetManifestPath)) {
|
||||
$manifest = json_decode(file_get_contents($assetManifestPath), true);
|
||||
$entry = $manifest['src/main.jsx'] ?? null;
|
||||
if (is_array($entry)) {
|
||||
$mainAsset = '/assets/' . ltrim((string) $entry['file'], '/');
|
||||
if (!empty($entry['css'][0])) {
|
||||
$styleAsset = '/assets/' . ltrim((string) $entry['css'][0], '/');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?><!doctype html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>DriveTime Planner</title>
|
||||
<link rel="stylesheet" href="<?= htmlspecialchars($styleAsset, ENT_QUOTES) ?>">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="<?= htmlspecialchars($mainAsset, ENT_QUOTES) ?>"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user