Initial Kaffeekasse SaaS restart

This commit is contained in:
2026-06-15 17:13:38 +02:00
commit b08eb93547
54 changed files with 4617 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^ index.php [QSA,L]
+434
View File
@@ -0,0 +1,434 @@
:root {
--bg: #f6efe6;
--bg-accent: #efe0cd;
--surface: rgba(255, 252, 248, 0.92);
--surface-strong: #fffaf2;
--text: #1f140f;
--muted: #6b544a;
--border: rgba(86, 48, 26, 0.14);
--primary: #8f4518;
--primary-strong: #6f2f0e;
--secondary: #124f47;
--success: #e7f7ef;
--danger: #ffe3df;
--shadow: 0 20px 60px rgba(86, 48, 26, 0.12);
--radius: 24px;
}
* {
box-sizing: border-box;
}
body {
margin: 0;
min-height: 100vh;
color: var(--text);
font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
background:
radial-gradient(circle at top left, rgba(143, 69, 24, 0.18), transparent 26rem),
radial-gradient(circle at top right, rgba(18, 79, 71, 0.14), transparent 24rem),
linear-gradient(160deg, var(--bg) 0%, #fcf7f0 48%, var(--bg-accent) 100%);
}
.page-backdrop {
position: fixed;
inset: 0;
pointer-events: none;
background:
linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
background-size: 3rem 3rem;
mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), transparent 70%);
}
.shell {
width: min(1180px, calc(100% - 2rem));
margin: 0 auto;
}
.site-header {
position: sticky;
top: 0;
z-index: 20;
backdrop-filter: blur(18px);
background: rgba(246, 239, 230, 0.72);
border-bottom: 1px solid var(--border);
}
.header-inner,
.footer-grid,
.button-row,
.metric-row,
.top-nav,
.inline-head,
.two-column,
.grid-three,
.content-grid,
.plan-grid,
.metric-cards {
display: grid;
gap: 1rem;
}
.header-inner {
grid-template-columns: auto 1fr;
align-items: center;
padding: 1rem 0;
}
.brand {
display: inline-flex;
align-items: center;
gap: 0.85rem;
color: inherit;
text-decoration: none;
}
.brand strong,
.hero h1,
.page-head h1,
.section-head h2 {
letter-spacing: -0.03em;
}
.brand small,
.muted,
.stack-list small,
.feature-list,
.metric-row span,
.top-nav a,
.site-footer p {
color: var(--muted);
}
.brand-mark {
display: inline-grid;
place-items: center;
width: 2.75rem;
height: 2.75rem;
border-radius: 0.9rem;
background: linear-gradient(135deg, var(--primary), #c07a3d);
color: white;
font-weight: 700;
}
.top-nav {
grid-auto-flow: column;
justify-content: end;
align-items: center;
}
.top-nav a {
text-decoration: none;
padding: 0.65rem 0.9rem;
border-radius: 999px;
}
.top-nav a.active,
.top-nav a:hover {
background: rgba(18, 79, 71, 0.08);
color: var(--secondary);
}
.main-shell {
padding: 2rem 0 4rem;
}
.hero,
.two-column,
.content-grid,
.plan-grid,
.metric-cards {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.hero {
align-items: stretch;
margin-bottom: 2rem;
}
.hero-copy,
.hero-card,
.card,
.form-card,
.table-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
box-shadow: var(--shadow);
}
.hero-copy {
padding: 2.4rem;
}
.hero-card {
padding: 2rem;
align-self: stretch;
background:
linear-gradient(180deg, rgba(255,255,255,0.84), rgba(255,250,242,0.94)),
linear-gradient(135deg, rgba(18,79,71,0.12), transparent 50%);
}
.hero h1,
.page-head h1 {
font-size: clamp(2.2rem, 4vw, 4.6rem);
line-height: 0.96;
margin: 0.6rem 0 1rem;
}
.lead {
font-size: 1.15rem;
line-height: 1.7;
max-width: 56rem;
}
.button-row,
.metric-row {
grid-auto-flow: column;
justify-content: start;
}
.button {
display: inline-flex;
justify-content: center;
align-items: center;
padding: 0.95rem 1.25rem;
border-radius: 999px;
border: 1px solid transparent;
text-decoration: none;
font-weight: 700;
cursor: pointer;
}
.button-primary {
color: white;
background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}
.button-secondary {
color: var(--secondary);
border-color: rgba(18, 79, 71, 0.24);
background: rgba(18, 79, 71, 0.08);
}
.metric-row {
list-style: none;
padding: 0;
margin: 1.4rem 0 0;
align-items: end;
}
.metric-row strong {
display: block;
font-size: 1.7rem;
}
.eyebrow {
display: inline-block;
text-transform: uppercase;
letter-spacing: 0.18em;
font-size: 0.72rem;
color: var(--primary);
font-weight: 700;
}
.feature-list,
.stack-list,
.step-list {
margin: 1rem 0 0;
padding-left: 1.2rem;
}
.stats-panel,
.metric-cards,
.content-grid,
.plan-grid,
.grid-three {
margin-top: 1.5rem;
}
.stats-panel {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 0.85rem;
}
.stats-panel div,
.metric-card {
padding: 1rem;
border-radius: 1rem;
background: rgba(255,255,255,0.74);
border: 1px solid var(--border);
}
.metric-card strong,
.stats-panel strong {
display: block;
font-size: 1.7rem;
}
.content-grid,
.plan-grid,
.grid-three {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
.card,
.form-card,
.table-card,
.timeline {
padding: 1.4rem;
}
.highlighted {
border-color: rgba(143, 69, 24, 0.38);
background: linear-gradient(180deg, rgba(255, 251, 244, 0.98), rgba(250, 236, 219, 0.9));
}
.page-head {
margin-bottom: 1.5rem;
}
.inline-head {
grid-template-columns: 1fr auto;
align-items: center;
}
.form-card,
.table-card {
overflow: hidden;
}
.form-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 1rem;
}
.slim {
max-width: 34rem;
}
label {
display: grid;
gap: 0.45rem;
margin-bottom: 1rem;
font-weight: 700;
}
input,
select,
textarea,
button {
font: inherit;
}
input,
select,
textarea {
width: 100%;
padding: 0.85rem 1rem;
border-radius: 1rem;
border: 1px solid rgba(86, 48, 26, 0.18);
background: rgba(255,255,255,0.95);
}
table {
width: 100%;
border-collapse: collapse;
}
th,
td {
padding: 0.95rem 0.8rem;
border-bottom: 1px solid rgba(86, 48, 26, 0.08);
text-align: left;
vertical-align: top;
}
th {
font-size: 0.82rem;
text-transform: uppercase;
letter-spacing: 0.12em;
color: var(--muted);
}
.stack-list {
list-style: none;
padding: 0;
}
.stack-list li {
display: grid;
gap: 0.2rem;
padding: 0.85rem 0;
border-bottom: 1px solid rgba(86, 48, 26, 0.08);
}
.flash {
margin-bottom: 1rem;
padding: 1rem 1.2rem;
border-radius: 1rem;
font-weight: 700;
}
.flash-success {
background: var(--success);
border: 1px solid rgba(18, 79, 71, 0.16);
}
.flash-error {
background: var(--danger);
border: 1px solid rgba(143, 69, 24, 0.16);
}
.code-block {
overflow: auto;
padding: 1rem;
border-radius: 1rem;
background: #201814;
color: #fef0df;
}
.text-link {
color: var(--secondary);
text-decoration: none;
}
.site-footer {
padding: 0 0 2rem;
}
.footer-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
padding: 1.5rem;
background: rgba(255,255,255,0.64);
border: 1px solid var(--border);
border-radius: var(--radius);
}
@media (max-width: 960px) {
.hero,
.two-column,
.content-grid,
.plan-grid,
.metric-cards,
.grid-three,
.footer-grid,
.form-grid,
.inline-head {
grid-template-columns: 1fr;
}
.top-nav,
.button-row,
.metric-row {
grid-auto-flow: row;
justify-content: start;
}
.header-inner {
grid-template-columns: 1fr;
}
}
+123
View File
@@ -0,0 +1,123 @@
<?php
declare(strict_types=1);
use App\Controllers\PlatformController;
use App\Controllers\TenantController;
use App\Core\Response;
$app = require dirname(__DIR__) . '/app/bootstrap.php';
$platform = new PlatformController(
$app['rootPath'],
$app['config'],
$app['database'],
$app['view'],
$app['session'],
$app['csrf']
);
$tenantController = new TenantController(
$app['database'],
$app['view'],
$app['session'],
$app['csrf']
);
$path = current_path();
$method = $_SERVER['REQUEST_METHOD'] ?? 'GET';
try {
if ($path === '/' && $method === 'GET') {
$platform->home();
return;
}
if ($path === '/install') {
$method === 'POST' ? $platform->installSubmit() : $platform->installForm();
return;
}
if ($path === '/register') {
$method === 'POST' ? $platform->registerSubmit() : $platform->registerForm();
return;
}
if ($path === '/admin/login') {
$method === 'POST' ? $platform->adminLoginSubmit() : $platform->adminLoginForm();
return;
}
if ($path === '/admin' && $method === 'GET') {
$platform->adminDashboard();
return;
}
if ($path === '/admin/logout' && $method === 'POST') {
$platform->adminLogout();
return;
}
if ($path === '/api/rfid/intake' && $method === 'POST') {
$tenantController->rfidIngest();
return;
}
if (preg_match('#^/t/([^/]+)(?:/(.*))?$#', $path, $matches)) {
$tenantSlug = rawurldecode($matches[1]);
$subPath = trim((string) ($matches[2] ?? ''), '/');
if ($subPath === '' && $method === 'GET') {
$tenantController->dashboard($tenantSlug);
return;
}
if ($subPath === 'login') {
$method === 'POST' ? $tenantController->loginSubmit($tenantSlug) : $tenantController->loginForm($tenantSlug);
return;
}
if ($subPath === 'logout' && $method === 'POST') {
$tenantController->logout($tenantSlug);
return;
}
if ($subPath === 'members') {
$tenantController->members($tenantSlug);
return;
}
if ($subPath === 'products') {
$tenantController->products($tenantSlug);
return;
}
if ($subPath === 'bookings') {
$tenantController->bookings($tenantSlug);
return;
}
if ($subPath === 'payments') {
$tenantController->payments($tenantSlug);
return;
}
if ($subPath === 'paper-sheets') {
$tenantController->paperSheets($tenantSlug);
return;
}
if ($subPath === 'rfid') {
$tenantController->rfid($tenantSlug);
return;
}
}
Response::notFound();
} catch (\Throwable $throwable) {
http_response_code(500);
error_log($throwable->__toString());
echo '<h1>Fehler</h1>';
echo '<p>' . e($app['config']['debug'] ? $throwable->getMessage() : 'Die Anfrage konnte gerade nicht verarbeitet werden.') . '</p>';
}
+12
View File
@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
$path = parse_url($_SERVER['REQUEST_URI'] ?? '/', PHP_URL_PATH);
$file = __DIR__ . ($path === '/' ? '/index.php' : (string) $path);
if ($path !== '/' && is_file($file)) {
return false;
}
require __DIR__ . '/index.php';