feat(portal): strip Vuexy demo content and create clean portal shell

Remove all demo pages, dialogs, sidebar navigation, and layout components.
Create minimal top-bar portal layout with auth-aware navigation, placeholder
pages for volunteer registration, dashboard, shifts, profile, artist advance,
and login. Add Pinia auth store, axios with Sanctum support, and router guards.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-10 17:38:55 +02:00
parent 853271f0c2
commit 87f0bcce6e
54 changed files with 558 additions and 4185 deletions

View File

@@ -0,0 +1,28 @@
import type { Router } from 'vue-router'
import { useAuthStore } from '@/stores/useAuthStore'
export function setupGuards(router: Router) {
router.beforeEach(async (to) => {
const authStore = useAuthStore()
if (!authStore.isInitialized) {
await authStore.initialize()
}
const requiresAuth = to.meta.requiresAuth === true
// Public routes — no auth check needed
if (!requiresAuth) {
// Redirect authenticated users away from login
if (authStore.isAuthenticated && to.path === '/login') {
return { path: '/dashboard' }
}
return
}
// Auth required — redirect to login if not authenticated
if (!authStore.isAuthenticated) {
return { path: '/login', query: { to: to.fullPath } }
}
})
}

View File

@@ -4,6 +4,7 @@ import type { App } from 'vue'
import type { RouteRecordRaw } from 'vue-router/auto'
import { createRouter, createWebHistory } from 'vue-router/auto'
import { setupGuards } from './guards'
function recursiveLayouts(route: RouteRecordRaw): RouteRecordRaw {
if (route.children) {
@@ -29,6 +30,8 @@ const router = createRouter({
],
})
setupGuards(router)
export { router }
export default function (app: App) {