feat: Initialize project with configuration files and basic structure

This commit is contained in:
Thibault Pouch
2026-05-01 10:57:26 +02:00
parent 268f7949dc
commit c2920dbbdc
11 changed files with 151 additions and 0 deletions

9
pages/dashboard.vue Normal file
View File

@@ -0,0 +1,9 @@
<script setup lang="ts">
definePageMeta({ middleware: 'auth' });
</script>
<template>
<div class="p-8">
<h1 class="text-2xl font-bold">Dashboard</h1>
</div>
</template>

46
pages/login.vue Normal file
View File

@@ -0,0 +1,46 @@
<script setup lang="ts">
import { useAuthStore } from '~/stores/auth';
definePageMeta({ layout: false });
const auth = useAuthStore();
const email = ref('');
const password = ref('');
const error = ref('');
async function submit() {
error.value = '';
try {
await auth.login({ email: email.value, password: password.value });
await navigateTo('/dashboard');
} catch {
error.value = 'Invalid credentials.';
}
}
</script>
<template>
<div class="min-h-screen flex items-center justify-center bg-gray-50">
<form class="w-full max-w-sm space-y-4" @submit.prevent="submit">
<h1 class="text-2xl font-bold text-center">CrowMate Intranet</h1>
<p v-if="error" class="text-red-500 text-sm text-center">{{ error }}</p>
<input
v-model="email"
type="email"
placeholder="Email"
required
class="w-full border rounded px-3 py-2 text-sm"
/>
<input
v-model="password"
type="password"
placeholder="Password"
required
class="w-full border rounded px-3 py-2 text-sm"
/>
<button type="submit" class="w-full bg-black text-white rounded py-2 text-sm font-medium">
Sign in
</button>
</form>
</div>
</template>