Grundgerüst: SvelteKit 5 + PocketBase + VitePWA
- Docker Compose Setup (PocketBase + SvelteKit Node) - Auth: Login, Registrierung (Verein + User in PocketBase) - Geschützte App-Shell mit Bottom-Navigation (Mobile-first) - Platzhalterseiten: Mitglieder, Termine, Beiträge, Nachrichten - TypeScript-Typen für alle Collections - PWA-Manifest für vereins.haus - Makefile für SSH-Deploy auf Synology DS
This commit is contained in:
commit
773046c80d
26 changed files with 7779 additions and 0 deletions
138
app/src/routes/(app)/+layout.svelte
Normal file
138
app/src/routes/(app)/+layout.svelte
Normal file
|
|
@ -0,0 +1,138 @@
|
|||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import { page } from '$app/stores';
|
||||
import { onMount } from 'svelte';
|
||||
import { pb } from '$lib/pb';
|
||||
|
||||
let { children } = $props();
|
||||
|
||||
onMount(() => {
|
||||
if (!pb.authStore.isValid) {
|
||||
goto('/login');
|
||||
}
|
||||
});
|
||||
|
||||
function logout() {
|
||||
pb.authStore.clear();
|
||||
goto('/login');
|
||||
}
|
||||
|
||||
const navItems = [
|
||||
{ href: '/', label: 'Übersicht', icon: '⊞' },
|
||||
{ href: '/mitglieder', label: 'Mitglieder', icon: '👥' },
|
||||
{ href: '/termine', label: 'Termine', icon: '📅' },
|
||||
{ href: '/beitraege', label: 'Beiträge', icon: '💶' },
|
||||
{ href: '/nachrichten', label: 'Nachrichten', icon: '✉️' },
|
||||
];
|
||||
</script>
|
||||
|
||||
<div class="shell">
|
||||
<header>
|
||||
<span class="logo">vereins.haus</span>
|
||||
<button class="logout-btn" onclick={logout}>Abmelden</button>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
{@render children()}
|
||||
</main>
|
||||
|
||||
<nav class="bottom-nav">
|
||||
{#each navItems as item}
|
||||
<a
|
||||
href={item.href}
|
||||
class:active={$page.url.pathname === item.href}
|
||||
>
|
||||
<span class="nav-icon">{item.icon}</span>
|
||||
<span class="nav-label">{item.label}</span>
|
||||
</a>
|
||||
{/each}
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.shell {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 100dvh;
|
||||
}
|
||||
|
||||
header {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0.75rem 1rem;
|
||||
background: #fff;
|
||||
border-bottom: 1px solid #e2e8f0;
|
||||
}
|
||||
|
||||
.logo {
|
||||
font-size: 1.1rem;
|
||||
font-weight: 700;
|
||||
color: #1e40af;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
.logout-btn {
|
||||
background: none;
|
||||
border: none;
|
||||
font-size: 0.85rem;
|
||||
color: #64748b;
|
||||
padding: 0.25rem 0.5rem;
|
||||
}
|
||||
|
||||
.logout-btn:hover {
|
||||
color: #1e293b;
|
||||
}
|
||||
|
||||
main {
|
||||
flex: 1;
|
||||
padding: 1.25rem 1rem;
|
||||
padding-bottom: calc(70px + env(safe-area-inset-bottom));
|
||||
max-width: 720px;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.bottom-nav {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: calc(60px + env(safe-area-inset-bottom));
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
background: #fff;
|
||||
border-top: 1px solid #e2e8f0;
|
||||
display: flex;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.bottom-nav a {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.15rem;
|
||||
color: #94a3b8;
|
||||
transition: color .15s;
|
||||
font-size: 0.7rem;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.bottom-nav a.active {
|
||||
color: #1e40af;
|
||||
}
|
||||
|
||||
.nav-icon {
|
||||
font-size: 1.3rem;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.nav-label {
|
||||
font-size: 0.65rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
</style>
|
||||
1
app/src/routes/(app)/+layout.ts
Normal file
1
app/src/routes/(app)/+layout.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
export const ssr = false;
|
||||
72
app/src/routes/(app)/+page.svelte
Normal file
72
app/src/routes/(app)/+page.svelte
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
<script lang="ts">
|
||||
import { pb } from '$lib/pb';
|
||||
|
||||
const vereinsname = pb.authStore.record?.name ?? 'Dein Verein';
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>Übersicht — vereins.haus</title>
|
||||
</svelte:head>
|
||||
|
||||
<h1>Willkommen, {vereinsname}</h1>
|
||||
|
||||
<div class="cards">
|
||||
<a href="/mitglieder" class="card">
|
||||
<span class="card-icon">👥</span>
|
||||
<span class="card-label">Mitglieder</span>
|
||||
</a>
|
||||
<a href="/termine" class="card">
|
||||
<span class="card-icon">📅</span>
|
||||
<span class="card-label">Termine</span>
|
||||
</a>
|
||||
<a href="/beitraege" class="card">
|
||||
<span class="card-icon">💶</span>
|
||||
<span class="card-label">Beiträge</span>
|
||||
</a>
|
||||
<a href="/nachrichten" class="card">
|
||||
<span class="card-icon">✉️</span>
|
||||
<span class="card-label">Nachrichten</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
h1 {
|
||||
font-size: 1.4rem;
|
||||
font-weight: 700;
|
||||
color: #1e293b;
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.cards {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: #fff;
|
||||
border: 1.5px solid #e2e8f0;
|
||||
border-radius: 12px;
|
||||
padding: 1.5rem 1rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
transition: border-color .15s, box-shadow .15s;
|
||||
}
|
||||
|
||||
.card:hover {
|
||||
border-color: #1e40af;
|
||||
box-shadow: 0 2px 8px rgba(30,64,175,.1);
|
||||
}
|
||||
|
||||
.card-icon {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
.card-label {
|
||||
font-size: 0.9rem;
|
||||
font-weight: 600;
|
||||
color: #1e293b;
|
||||
}
|
||||
</style>
|
||||
27
app/src/routes/(app)/beitraege/+page.svelte
Normal file
27
app/src/routes/(app)/beitraege/+page.svelte
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<script lang="ts">
|
||||
</script>
|
||||
|
||||
<svelte:head><title>Beiträge — vereins.haus</title></svelte:head>
|
||||
|
||||
<div class="page-header">
|
||||
<h1>Beiträge</h1>
|
||||
<button class="btn-primary">+ Beitragsart</button>
|
||||
</div>
|
||||
|
||||
<p class="placeholder">SEPA-Beitragseinzug — in Entwicklung</p>
|
||||
|
||||
<style>
|
||||
.page-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
h1 { font-size: 1.4rem; font-weight: 700; color: #1e293b; }
|
||||
.btn-primary {
|
||||
background: #1e40af; color: #fff; border: none;
|
||||
border-radius: 8px; padding: 0.5rem 1rem;
|
||||
font-size: 0.9rem; font-weight: 600;
|
||||
}
|
||||
.placeholder { color: #94a3b8; font-size: 0.95rem; }
|
||||
</style>
|
||||
27
app/src/routes/(app)/mitglieder/+page.svelte
Normal file
27
app/src/routes/(app)/mitglieder/+page.svelte
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<script lang="ts">
|
||||
</script>
|
||||
|
||||
<svelte:head><title>Mitglieder — vereins.haus</title></svelte:head>
|
||||
|
||||
<div class="page-header">
|
||||
<h1>Mitglieder</h1>
|
||||
<button class="btn-primary">+ Mitglied</button>
|
||||
</div>
|
||||
|
||||
<p class="placeholder">Mitgliederverwaltung — in Entwicklung</p>
|
||||
|
||||
<style>
|
||||
.page-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
h1 { font-size: 1.4rem; font-weight: 700; color: #1e293b; }
|
||||
.btn-primary {
|
||||
background: #1e40af; color: #fff; border: none;
|
||||
border-radius: 8px; padding: 0.5rem 1rem;
|
||||
font-size: 0.9rem; font-weight: 600;
|
||||
}
|
||||
.placeholder { color: #94a3b8; font-size: 0.95rem; }
|
||||
</style>
|
||||
27
app/src/routes/(app)/nachrichten/+page.svelte
Normal file
27
app/src/routes/(app)/nachrichten/+page.svelte
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<script lang="ts">
|
||||
</script>
|
||||
|
||||
<svelte:head><title>Nachrichten — vereins.haus</title></svelte:head>
|
||||
|
||||
<div class="page-header">
|
||||
<h1>Nachrichten</h1>
|
||||
<button class="btn-primary">+ Nachricht</button>
|
||||
</div>
|
||||
|
||||
<p class="placeholder">Nachrichten & Push-Benachrichtigungen — in Entwicklung</p>
|
||||
|
||||
<style>
|
||||
.page-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
h1 { font-size: 1.4rem; font-weight: 700; color: #1e293b; }
|
||||
.btn-primary {
|
||||
background: #1e40af; color: #fff; border: none;
|
||||
border-radius: 8px; padding: 0.5rem 1rem;
|
||||
font-size: 0.9rem; font-weight: 600;
|
||||
}
|
||||
.placeholder { color: #94a3b8; font-size: 0.95rem; }
|
||||
</style>
|
||||
27
app/src/routes/(app)/termine/+page.svelte
Normal file
27
app/src/routes/(app)/termine/+page.svelte
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<script lang="ts">
|
||||
</script>
|
||||
|
||||
<svelte:head><title>Termine — vereins.haus</title></svelte:head>
|
||||
|
||||
<div class="page-header">
|
||||
<h1>Termine</h1>
|
||||
<button class="btn-primary">+ Termin</button>
|
||||
</div>
|
||||
|
||||
<p class="placeholder">Terminkalender — in Entwicklung</p>
|
||||
|
||||
<style>
|
||||
.page-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
h1 { font-size: 1.4rem; font-weight: 700; color: #1e293b; }
|
||||
.btn-primary {
|
||||
background: #1e40af; color: #fff; border: none;
|
||||
border-radius: 8px; padding: 0.5rem 1rem;
|
||||
font-size: 0.9rem; font-weight: 600;
|
||||
}
|
||||
.placeholder { color: #94a3b8; font-size: 0.95rem; }
|
||||
</style>
|
||||
Loading…
Add table
Add a link
Reference in a new issue