Vollständige Migration weg von PocketBase. Neuer Stack: - better-sqlite3 (WAL-Mode, direkte SQLite-Abfragen) - jose (JWT HS256, 30 Tage Laufzeit) - bcryptjs (Passwort-Hashing, cost 12) Neue Dateien: - src/lib/server/db.ts → SQLite-Singleton + Schema + Helpers - src/lib/server/auth.ts → JWT sign/verify, bcrypt, Bearer-Token - src/lib/user.ts → Svelte-Store (ersetzt pb.authStore) - src/lib/api.ts → fetch()-Wrapper (ersetzt pb.collection()) - src/app.d.ts → App.Locals TypeScript-Deklaration - 30 neue API-Routes unter src/routes/api/ Entfernt: - Abhängigkeit von pocketbase npm-Paket (bleibt im package.json bis alle Referenzen bereinigt sind) - PocketBase-Container aus docker-compose.yml - Migrations und Hooks aus Deploy-Pipeline Docker: Ein einziger Container, SQLite-Volume unter /data/ Makefile: PocketBase-spezifische Targets entfernt seed.js: Komplett neu für neue REST-API
50 lines
892 B
Svelte
50 lines
892 B
Svelte
<script lang="ts">
|
|
import { goto } from '$app/navigation';
|
|
import { onMount } from 'svelte';
|
|
import { get } from 'svelte/store';
|
|
import { user } from '$lib/user';
|
|
|
|
let { children } = $props();
|
|
|
|
onMount(() => {
|
|
if (!!get(user)) {
|
|
goto('/');
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<div class="auth-wrap">
|
|
<div class="auth-card">
|
|
<a href="/" class="logo">vereins.haus</a>
|
|
{@render children()}
|
|
</div>
|
|
</div>
|
|
|
|
<style>
|
|
.auth-wrap {
|
|
min-height: 100dvh;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 1.5rem;
|
|
background: #f8fafc;
|
|
}
|
|
|
|
.auth-card {
|
|
width: 100%;
|
|
max-width: 400px;
|
|
background: #fff;
|
|
border-radius: 12px;
|
|
padding: 2rem;
|
|
box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
|
|
}
|
|
|
|
.logo {
|
|
display: block;
|
|
font-size: 1.4rem;
|
|
font-weight: 700;
|
|
color: #1e40af;
|
|
margin-bottom: 1.5rem;
|
|
letter-spacing: -0.02em;
|
|
}
|
|
</style>
|