scaffold: Vue 3 frontend — router, stores, views, composables, layouts

Complete frontend skeleton: Vite + Vue 3 + TypeScript + Tailwind CSS,
Pinia stores (auth, server, wipe, plugins), authenticated API composable,
full route tree with auth guards, DashboardLayout with sidebar nav,
23 view stubs across auth/admin/public, all TypeScript interfaces.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Vantz Stockwell
2026-02-14 21:42:21 -05:00
parent 175d6f0a7b
commit e2f2f64d33
46 changed files with 3335 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
import { defineStore } from 'pinia'
import { ref, computed } from 'vue'
import type { User, License } from '@/types'
export const useAuthStore = defineStore('auth', () => {
const user = ref<User | null>(null)
const license = ref<License | null>(null)
const accessToken = ref<string | null>(null)
const refreshToken = ref<string | null>(null)
const isAuthenticated = computed(() => !!accessToken.value)
const hasLicense = computed(() => !!license.value)
const isLicenseActive = computed(() => license.value?.status === 'active')
function setAuth(data: { access_token: string; refresh_token: string; user: User }) {
accessToken.value = data.access_token
refreshToken.value = data.refresh_token
user.value = data.user
}
function setLicense(data: License) {
license.value = data
}
function logout() {
user.value = null
license.value = null
accessToken.value = null
refreshToken.value = null
}
function hasModule(moduleSlug: string): boolean {
return license.value?.modules_enabled?.includes(moduleSlug) ?? false
}
return {
user,
license,
accessToken,
refreshToken,
isAuthenticated,
hasLicense,
isLicenseActive,
setAuth,
setLicense,
logout,
hasModule,
}
}, {
persist: {
pick: ['accessToken', 'refreshToken', 'user', 'license'],
},
})